From nobody Sat Apr 20 15:04:58 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) client-ip=78.46.105.101; envelope-from=seabios-bounces@seabios.org; helo=coreboot.org; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass(p=reject dis=none) header.from=seabios.org ARC-Seal: i=1; a=rsa-sha256; t=1643799091; cv=none; d=zohomail.com; s=zohoarc; b=WAQHbtoT3h2GtjA9XNNKD9gn12GDQTQvwBo10c/GukDkFJ3Rclp0W5ijyojxNms3uh7FSb0iDUhYibFF8ogxEG+FMDXKc9sMWFGhI8SylyfSwV5LprvZPwXzln4VSIvbzI+OlkRSQ/GQ8cygGvSEEW1+jblP4s5wwIcB4wxg41Y= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1643799091; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Owner:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Subject:To; bh=uIseCocrvaMSIPWNzzPKSBuKu70ru29LyW415gD0hzo=; b=nzabW9T2XZ2lUHoCr8EEB/B9je2fsWretuJK6pMkRLJpoVJeImxDIRH7QEVSLzFZ050L7//RV7boIEmRLpS8tkW45punLEWQAKjqlK75Q0bhefpYonu+e77tb5nVQiDUvpTX9KmvvTYKz1S7xwA3zECvbOORChAJIXbmzPx6heY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of seabios.org designates 78.46.105.101 as permitted sender) smtp.mailfrom=seabios-bounces@seabios.org; dmarc=pass header.from= (p=reject dis=none) Return-Path: Received: from coreboot.org (coreboot.org [78.46.105.101]) by mx.zohomail.com with SMTPS id 1643799091199757.6863053100524; Wed, 2 Feb 2022 02:51:31 -0800 (PST) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTPA id 0453916E3662; Wed, 2 Feb 2022 10:51:26 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by coreboot.org (Postfix) with ESMTP id 32FC916E3607 for ; Wed, 2 Feb 2022 10:51:13 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by smtp-border-fw-80006.pdx80.corp.amazon.com with ESMTP; 02 Feb 2022 10:50:55 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) by email-inbound-relay-iad-1d-ca048aa0.us-east-1.amazon.com (Postfix) with ESMTPS id DFE5580419; Wed, 2 Feb 2022 10:50:53 +0000 (UTC) Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) EX13MTAUWC002.ant.amazon.com (10.43.162.240) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Wed, 2 Feb 2022 10:50:53 +0000 Received: from authenticated-user (PRIMARY_HOSTNAME [PUBLIC_IP]) (10.43.162.244) with Microsoft SMTP Server (TLS) id 15.0.1497.28; Wed, 2 Feb 2022 10:50:52 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=seabios.org; s=dkim; t=1643799088; h=from:from:sender:reply-to:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-owner: list-unsubscribe:list-subscribe:list-post; bh=uIseCocrvaMSIPWNzzPKSBuKu70ru29LyW415gD0hzo=; b=ZroSKBtxGKiP1OSzrg/Ol389Wie5K2lhQNsYSqLGQNNuLPyzxBUScFbBTBUywGfq7E+K7K A+DwDtRwFp3AR//mMPx+FCd+WCht8xR7khK5KSiM315J/Tg5BFt6ONo/S+dSCGyllFoFTh hbRgYZCNl+3RwlEpNzr6MX9yEkxu+yA= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amazon.com; i=@amazon.com; q=dns/txt; s=amazon201209; t=1643799074; x=1675335074; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=vH3clISeeuI1nLtZ9NFHbk4xUS8sLI3m5HDUjyeRhn8=; b=OlCBCWAKPpEZKOo2eiJt2ejo/5R3MbEcgwoMO0Ud55tY/zEMtVbl7B3P ybeXNTEpvg4hh352tqD83aiwwVK4PjHFBGGlBFcyluM3dmBV+p0DRz8PY 76HsqkZYyOd51HIkze6rUjSix0hDNAlu97dG5VXBUzYD7j3nm7uJx5EMo 8=; X-IronPort-AV: E=Sophos;i="5.88,336,1635206400"; d="scan'208";a="59814737" Message-ID: Date: Wed, 2 Feb 2022 11:50:50 +0100 MIME-Version: 1.0 To: Kevin O'Connor , Florian Larysch References: <20220123164357.23695-1-fl@n621.de> <20220201193910.rn5bwitfiwvcrxsm@n621.de> In-Reply-To: X-ClientProxiedBy: EX13D37UWA001.ant.amazon.com (10.43.160.61) To EX13D20UWC001.ant.amazon.com (10.43.162.244) Precedence: Bulk Content-Type: text/plain; charset="utf-8"; format="flowed" Message-ID-Hash: ERJFP7X654E5IAHLQMWMCDXMPBWFXYWT X-Message-ID-Hash: ERJFP7X654E5IAHLQMWMCDXMPBWFXYWT X-MailFrom: prvs=025cfbdc6=graf@amazon.de X-Mailman-Rule-Misses: dmarc-mitigation; no-senders; approved; emergency; loop; banned-address; member-moderation; header-match-seabios.seabios.org-0; header-match-seabios.seabios.org-1; nonmember-moderation; administrivia; implicit-dest; max-recipients; max-size; news-moderation; no-subject; digests; suspicious-header CC: seabios@seabios.org, Gerd Hoffmann X-Mailman-Version: 3.3.5rc1 Subject: [SeaBIOS] Re: [PATCH] nvme: fix LBA format data structure List-Id: SeaBIOS mailing list Archived-At: List-Archive: List-Help: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: From: Alexander Graf via SeaBIOS Reply-To: Alexander Graf Content-Transfer-Encoding: quoted-printable Authentication-Results: coreboot.org; auth=pass smtp.auth=mailman@coreboot.org smtp.mailfrom=seabios-bounces@seabios.org X-Spamd-Bar: ---- X-ZohoMail-DKIM: pass (identity @seabios.org) X-ZM-MESSAGEID: 1643799094028100001 On 02.02.22 02:52, Kevin O'Connor wrote: > On Tue, Feb 01, 2022 at 08:39:10PM +0100, Florian Larysch wrote: >> On Thu, Jan 27, 2022 at 11:37:52AM -0500, Kevin O'Connor wrote: >>> Thanks. I don't know enough about NVMe to review this patch though. >>> Maybe Julian or Alex could comment? >> Happy to hear their comments on this. However, I can also try to explain >> the reasoning in a bit more detail. >> >> This follows from the NVMe spec[1]: The Identify command returns a data >> structure that contains packed LBAF records (Figure 249, starting at >> offset 131). This is represented by struct nvme_identify_ns in the >> SeaBIOS code. >> >> Figure 250 gives the structure of these records and this is where the >> aforementioned discrepancy lies. > Thanks. I agree that this should be fixed in SeaBIOS. > > However, your patch removes the "reserved" field, which doesn't look > correct. It sounds like the "res" struct member should remain, but > the "lbads" and "rp" members should be turned into a new "lbads_rp" > member. Also, the nvme.c code should be updated so that the read of > lbads performs the proper bit masking. Looking at the spec, lbads is a full well aligned 8 bits. The collision=20 here is between rp and res, with rp taking only 2 bits and res the=20 remaining 6. Is using bitfields acceptable in SeaBIOS? If so, the patch=20 below should automatically give us masking as well. Alex diff --git a/src/hw/nvme-int.h b/src/hw/nvme-int.h index f9c807e..9b3015b 100644 Reviewed-by: Alexander Graf --- a/src/hw/nvme-int.h +++ b/src/hw/nvme-int.h @@ -145,8 +145,8 @@ struct nvme_identify_ns_list { =C2=A0struct nvme_lba_format { =C2=A0=C2=A0=C2=A0=C2=A0 u16 ms; =C2=A0=C2=A0=C2=A0=C2=A0 u8=C2=A0 lbads; -=C2=A0=C2=A0=C2=A0 u8=C2=A0 rp; -=C2=A0=C2=A0=C2=A0 u8=C2=A0 res; +=C2=A0=C2=A0=C2=A0 u8=C2=A0 rp : 2; +=C2=A0=C2=A0=C2=A0 u8=C2=A0 res : 6; =C2=A0}; =C2=A0struct nvme_identify_ns { Amazon Development Center Germany GmbH Krausenstr. 38 10117 Berlin Geschaeftsfuehrung: Christian Schlaeger, Jonathan Weiss Eingetragen am Amtsgericht Charlottenburg unter HRB 149173 B Sitz: Berlin Ust-ID: DE 289 237 879 _______________________________________________ SeaBIOS mailing list -- seabios@seabios.org To unsubscribe send an email to seabios-leave@seabios.org