From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail05.groups.io (mail05.groups.io [45.79.224.7]) by spool.mail.gandi.net (Postfix) with ESMTPS id E2655AC103F for ; Tue, 26 Nov 2024 10:40:53 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=s96bIQmYiZ74vTyuHK5+xAvp8F4XEsBJ5P2NtMabHzU=; c=relaxed/simple; d=groups.io; h=Date:From:To:CC:Subject:Message-ID:In-Reply-To:References:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Resent-Date:Resent-From:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Type:Content-Transfer-Encoding; s=20240830; t=1732617653; v=1; x=1732876852; b=DoDfzvUJQsWT3x9jcLDSOWCc8NssHqZtU+OGYKXogLB3BWUz3yPXEkM2FsSHmJtyULf+CT3l iqCTdIXkx+F+ST+BFbRhig+EBUkUAhO9nrg6qfW3+tJs/b6NF3rcZR9RRKYyVyfOQv0N3gilxZV 16jYWpFn/hhj6x7mf90Tnkc+ObohCGnjPGEFxQTmULKto3BcLQnVRNvE6T6J4ZRLl/n50kyj0tg Deh/qroZqt3bZzfwL0PkCZOL22Zl4UEAHZTE30Mu3cD1+HHn94HrPv0dhiq7W6jNScBKo8gbtte 12O7YVvATucw1mUea1htuNejCOwXVTrRLEArk3S3MXhsA== X-Received: by 127.0.0.2 with SMTP id 13guYY7687511xzFcaNl4Xe1; Tue, 26 Nov 2024 02:40:52 -0800 X-Received: from frasgout.his.huawei.com (frasgout.his.huawei.com [185.176.79.56]) by mx.groups.io with SMTP id smtpd.web10.43070.1732617650964771797 for ; Tue, 26 Nov 2024 02:40:51 -0800 X-Received: from mail.maildlp.com (unknown [172.18.186.31]) by frasgout.his.huawei.com (SkyGuard) with ESMTP id 4XyJxY1PCtz6LD8H; Tue, 26 Nov 2024 18:40:17 +0800 (CST) X-Received: from frapeml500008.china.huawei.com (unknown [7.182.85.71]) by mail.maildlp.com (Postfix) with ESMTPS id AFAC91400CD; Tue, 26 Nov 2024 18:40:48 +0800 (CST) X-Received: from localhost (10.203.177.66) by frapeml500008.china.huawei.com (7.182.85.71) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.39; Tue, 26 Nov 2024 11:40:48 +0100 Date: Tue, 26 Nov 2024 10:40:46 +0000 From: "Jonathan Cameron via groups.io" To: Yuquan Wang CC: , , , , , , , Subject: Re: [edk2-devel] [RFC EDK2 PATCH v4 1/1] MdePkg/IndustryStandard: add definitions for CXL CEDT Message-ID: <20241126104046.0000427b@huawei.com> In-Reply-To: <20241126030159.72111-2-wangyuquan1236@phytium.com.cn> References: <20241126030159.72111-1-wangyuquan1236@phytium.com.cn> <20241126030159.72111-2-wangyuquan1236@phytium.com.cn> MIME-Version: 1.0 X-Originating-IP: [10.203.177.66] X-ClientProxiedBy: lhrpeml500011.china.huawei.com (7.191.174.215) To frapeml500008.china.huawei.com (7.182.85.71) Precedence: Bulk List-Subscribe: List-Help: Sender: devel@edk2.groups.io List-Id: Mailing-List: list devel@edk2.groups.io; contact devel+owner@edk2.groups.io Resent-Date: Tue, 26 Nov 2024 02:40:51 -0800 Resent-From: jonathan.cameron@huawei.com Reply-To: devel@edk2.groups.io,jonathan.cameron@huawei.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: QsEDXX8YPcaC3tOv3fEM0LP2x7686176AA= Content-Type: text/plain; charset="US-ASCII" Content-Transfer-Encoding: quoted-printable X-GND-Status: LEGIT Authentication-Results: spool.mail.gandi.net; dkim=pass header.d=groups.io header.s=20240830 header.b=DoDfzvUJ; dmarc=pass (policy=none) header.from=groups.io; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 45.79.224.7 as permitted sender) smtp.mailfrom=bounce@groups.io On Tue, 26 Nov 2024 11:01:59 +0800 Yuquan Wang wrote: > This adds #defines and struct typedefs for the various structure > types in the CXL Early Discovery Table (CEDT). >=20 > Signed-off-by: Yuquan Wang Hi. One errata applies. See below. Otherwise, I've checked these against the r3.2 specification and they look correct. Some suggestions on places where comments might make that easier to establish when it comes to maximum sizing. Otherwise, with the errata fixed. Reviewed-by: Jonathan Cameron > diff --git a/MdePkg/Include/IndustryStandard/Cxl30.h b/MdePkg/Include/Ind= ustryStandard/Cxl30.h > index 7a9a6d69405d..63e56aea8254 100644 > --- a/MdePkg/Include/IndustryStandard/Cxl30.h > +++ b/MdePkg/Include/IndustryStandard/Cxl30.h > @@ -45,6 +45,13 @@ > #define CXL_HDM_6_WAY_INTERLEAVING 0x9 > #define CXL_HDM_12_WAY_INTERLEAVING 0xA > =20 > +/// > +/// "CEDT" CXL Early Discovery Table > +/// > +#define CEDT_TYPE_CFMWS 0x1 > +#define CEDT_TYPE_CXIMS 0x2 > +#define CEDT_TYPE_RDPAS 0x3 > + > // > // Ensure proper structure formats > // > @@ -311,6 +318,45 @@ typedef struct { > CXL_3_0_CXL_TIMEOUT_AND_ISOLATION_STATUS TimeoutAndIsolationSta= tus; > } CXL_3_0_CXL_TIMEOUT_AND_ISOLATION_CAPABILITY_STRUCTURE; > =20 > +/// > +/// Definition for CXL Fixed Memory Window Structure (CFMWS) > +/// > +typedef struct { > + CEDT_STRUCTURE Header; > + UINT32 Reserved; > + UINT64 BaseHpa; > + UINT64 WindowSize; > + UINT8 InterleaveMembers; Spec naming now at least is Encode Number of Interleave Ways. This name looses quite a bit of that. I'd use a longer name, perhaps EncodedInterleaveWays > + UINT8 InterleaveArithmetic; > + UINT16 Reserved1; > + UINT32 Granularity; > + UINT16 Restrictions; > + UINT16 QtgId; > + UINT32 TargetList[16]; Perhaps a comment on why 16 given it depends on decoded version of EncodedInterleaveWays. 16 is the current maximum. > +} CXL_FIXED_MEMORY_WINDOW_STRUCTURE; > + > +/// > +/// Definition for CXL XOR Interleave Math Structure (CXIMS) > +/// > +typedef struct { > + CEDT_STRUCTURE Header; > + UINT16 Reserved; > + UINT8 HBIG; > + UINT8 NIB; > + UINT64 XORMAPLIST[4]; Why 4? Number of entries depends on NIB. Add a comment if this is the effective maximum to refer to specific part of spec that says that. > +} CXL_XOR_INTERLEAVE_MATH_STRUCTURE; > + > +/// > +/// Definition for RCEC Downstream Port Association Structure (RDPAS) > +/// > +typedef struct { > + CEDT_STRUCTURE Header; > + UINT16 SegmentNumber; > + UINT16 Bdf; > + UINT8 ProtocolType; > + UINT64 BaseAddress; Always check the latest spec, which as of last week is 3.2 or any errata released in the meantime. There is an errata on this. Key is that in the 3.1 and before the fields don't fit. Offset of RCEC BDF is 06h, length 2 bytes, yet protocol type is in 07h so overlaps. Fix was to move protocol type later. > +} RCEC_DOWNSTREAM_PORT_ASSOCIATION_STRUCTURE; > + > #pragma pack() > =20 > #endif -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D- Groups.io Links: You receive all messages sent to this group. View/Reply Online (#120845): https://edk2.groups.io/g/devel/message/120845 Mute This Topic: https://groups.io/mt/109784487/7686176 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [rebecca@openfw.io] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-