From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by spool.mail.gandi.net (Postfix) with ESMTPS id A7E4674003A for ; Wed, 8 Nov 2023 05:26:33 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=B4vPMTpsyLDXeT53LaGmRkKaVZpdwge7fy+E1zki9TI=; c=relaxed/simple; d=groups.io; h=ARC-Seal:ARC-Message-Signature:ARC-Authentication-Results:From:To:CC:Subject:Thread-Topic:Thread-Index:Date:Message-ID:References:In-Reply-To:Accept-Language:MIME-Version:Precedence:List-Subscribe:List-Help:Sender:List-Id:Mailing-List:Delivered-To:Reply-To:List-Unsubscribe-Post:List-Unsubscribe:Content-Language:Content-Type:Content-Transfer-Encoding; s=20140610; t=1699421192; v=1; b=O39zFYwcpqe7bb6tNDWwIaHNi/AySdjPUZMl0GgyJGyBOcMx2TxZx5cbowjuQtISEfu6gQGH GqATfpjzuPyBeXhXycm5RpOaYZByegsaCD45uquR/SRxlgcgmlWyrE3IH5dzfKEf1wmF0G+eNiW NEvMnSlcp9xnjSo9ZjgtSFq0= X-Received: by 127.0.0.2 with SMTP id 3xVRYY7687511xfz5kTXOtVh; Tue, 07 Nov 2023 21:26:32 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.7856.1699421191565881728 for ; Tue, 07 Nov 2023 21:26:31 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10887"; a="392561436" X-IronPort-AV: E=Sophos;i="6.03,285,1694761200"; d="scan'208";a="392561436" X-Received: from orsmga008.jf.intel.com ([10.7.209.65]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Nov 2023 21:26:13 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10887"; a="792077128" X-IronPort-AV: E=Sophos;i="6.03,285,1694761200"; d="scan'208";a="792077128" X-Received: from orsmsx603.amr.corp.intel.com ([10.22.229.16]) by orsmga008.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 07 Nov 2023 21:26:13 -0800 X-Received: from orsmsx603.amr.corp.intel.com (10.22.229.16) by ORSMSX603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Tue, 7 Nov 2023 21:26:12 -0800 X-Received: from ORSEDG602.ED.cps.intel.com (10.7.248.7) by orsmsx603.amr.corp.intel.com (10.22.229.16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Tue, 7 Nov 2023 21:26:12 -0800 X-Received: from NAM12-MW2-obe.outbound.protection.outlook.com (104.47.66.41) by edgegateway.intel.com (134.134.137.103) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Tue, 7 Nov 2023 21:26:12 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=oA/isdxXXh27i1wYHtpvC6SNaSVSQh4OnhQcYXYi2rXVQMCzGsx4KZErf+oSYmFHo2Cnr1FOuyr7teMqDAGvcHZnZVXl8h0F7Blu6sIGQ9O1UU+2F1AlVNdU1bl1Q9ji3+NNZj/nJWHq7yLHps/CrT4VT0j7M+C9T376Py4rTQW8AjZpZxSFNA40FKLr2/94Wo5+BLSAeKjiI7+yDl0FUpacwa9gc8UPR3pqJXH6cdY66bbtUAQz21hQWVrfwVTIcuE86WLRkpwSdvb1vPWzjaTLL/RW6JNGUFDcWSkqOuNt90naSHdb246yhbpyR6OqNfm2yPh/g5zFkqE+sRhwlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=QyQdWq7+m3dXW83XwEfgh7e27U8sGpl5jS8GJRnq1as=; b=GGCkim5PQNPzQh53bJ6ncjggHPTSTcS2HKV1JPzV8+a0O15KEoOvYX7xbf4y9h7D7zHGo9Sf3XKUs853CqF8jLLXZpzs2/0QszzUpN2bB7nSGW9PYNNg6Hgny/n6U7u6TppWX++ouagRZfOIXe9NLtK+XVwU1JixONQD8LwzaBRjthaubj8Y2AodTV9ZZxUM1ewvOZHphbTmW0a+FWxuoPN65407YjzgjkiDSCjTWRsA5etgMYs1vxD74Y3IprTWdC3XHybEkWZin2u7YJmZsj3xSN2x+woZ5XOob8uWZGYXDN5zBd0c5bJ90b7SAQLtxFg7x41vm9zuDaZ/vBxpnQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=intel.com; dmarc=pass action=none header.from=intel.com; dkim=pass header.d=intel.com; arc=none X-Received: from MN6PR11MB8242.namprd11.prod.outlook.com (2603:10b6:208:474::11) by SN7PR11MB7489.namprd11.prod.outlook.com (2603:10b6:806:342::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.6954.28; Wed, 8 Nov 2023 05:26:04 +0000 X-Received: from MN6PR11MB8242.namprd11.prod.outlook.com ([fe80::c928:56d3:c400:ba51]) by MN6PR11MB8242.namprd11.prod.outlook.com ([fe80::c928:56d3:c400:ba51%7]) with mapi id 15.20.6954.029; Wed, 8 Nov 2023 05:26:03 +0000 From: "Dandan Bi" To: Dhaval , "devel@edk2.groups.io" CC: "Wang, Jian J" , "Gao, Liming" , "Liu, Zhiguang" , "Bi, Dandan" Subject: Re: [edk2-devel] [PATCH v1 1/1] MdeModulePkg: Fix issue with ACPI table creation Thread-Topic: [PATCH v1 1/1] MdeModulePkg: Fix issue with ACPI table creation Thread-Index: AQHZ8ddrDkeeDrl1yUqf9E3h/duxFrBwIeeg Date: Wed, 8 Nov 2023 05:26:02 +0000 Message-ID: References: <20230928064516.120236-1-dhaval@rivosinc.com> <20230928064516.120236-2-dhaval@rivosinc.com> In-Reply-To: <20230928064516.120236-2-dhaval@rivosinc.com> Accept-Language: zh-CN, en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: MN6PR11MB8242:EE_|SN7PR11MB7489:EE_ x-ms-office365-filtering-correlation-id: b8c0270f-1734-488e-1904-08dbe01b332a x-ld-processed: 46c98d88-e344-4ed4-8496-4ed7712e255d,ExtAddr x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam-message-info: yWAg+DoH3qNU15nOEcixWfk30FOcBfYDk+qQkMXk5zuvWspSIiibDLAO0Jx/2NXMGWvtPjj7m8MtA5crCFqibCgoEO2zHoX5GHUKofJb1cE6Mt4VcucIy8srAR+OYyVp4yCNiisA/5wja3ffMYdwrkE4JiC3dHmVS8YSjf1riYHDOeCEiTwvjn5NO8eEmb5pppzPX3UC9qcwac1xu3J9hPtjnP+g5WQXSfKQ3ruAv0QbR4Nf/qlkepQs5vow3cO1zJ8/PuogYdYBva8FRS5JS8TrhY74K9U1D0Gj9JoeAJTQK5iQZMpFnPYYojdIG2wi53y63e6Ar2djDIiDQx17pHPMXsZtn8xUU8vad5yOLdLCpT5BXK47qi5QyAkZx9SN8UNa9rn966yD6S7y6NyBtN+/3mviYlRtXGw53GNHcRryxr6tOVTBvDbhZX01tZTuzLOM7zm0Or4NV6lh2c+xnpd7g5EkaOeCvKvKb3JL3bt5F/LmU+FhaC+ZaSphE/gzFhOLAB6uKJJF3pwFEDALc0zxJGy243cY6dFy01qI4oi4tquGgNQEFmXOgj2nRDEqwqEOS/qZwC5d6I1vS2AvoBEbegpb6BMukNLLxEsuX5PpeKqPaFqCyNh1JO7mdojY x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messaged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ezRoL3L/DDhmNmlj6GO66BnXgiTEtIN+QW2dQ7?= =?us-ascii?Q?Endjn7UBZZZbSuwOAe8eF6NYnxUSapiaZPxn+buwPwY/ZboliEa37mSTDeSD?= =?us-ascii?Q?3y4YN0Pp2YOBdyBLtnxWBBwq/U1CTcLP1XYRN/l/Nt9NkvbmuGFLzu5C4GRl?= =?us-ascii?Q?H/30bU1xRSFi2nEGP0D//S94hd/Or2s3GKAFgCecMD1ZGewnkaROrxd4A96I?= =?us-ascii?Q?DVuV4zKRw+kl4rUPUq2otctbNy7kt4DtS76Ikkom+cm8qkSF1L9VKme4F23R?= =?us-ascii?Q?lSVhLVHhAV5STXkmdX+vZ9LAxyX2aNhNiUIo5ntsTiyOmsW32cZCdUKFN9kg?= =?us-ascii?Q?M+1zUWczi1XcyE56k1/luYcQi54lLweb9SLaFyV8GOh8LDq4ACxmlPxdlcbN?= =?us-ascii?Q?UMPecoIa38ChniYNPSAKPHVAGJdAO77CWIC6iNQcnDEu8r/9m0avK7bfrFy/?= =?us-ascii?Q?sJO1BAJPusJDlD9TFU+fBwQEO81NQch59WNTZajIHYAoqZORMJmeeFcWWYd3?= =?us-ascii?Q?6YZhr0SsVsgCN8b0v2ye3pWYXhblvIVL7dQTzu85BISHWoQYi3xI/TEbnqfg?= =?us-ascii?Q?0V1DOhZSUgQncoxXB/Du/dl7A2qzsOuAvdNta2HIzF/mGyAKcaSUNVSVAc0x?= =?us-ascii?Q?Pq6WxJxc+1uZ2uRyURfNN7hdZQICSirzLsgnPA4WxYjHuTAxY8XW6HfmqrYS?= =?us-ascii?Q?kZXYFLtSle6eYwC+oMzyu/nNGB8UDhxqom8JJWW0?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MN6PR11MB8242.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: b8c0270f-1734-488e-1904-08dbe01b332a X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Nov 2023 05:26:02.9717 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 46c98d88-e344-4ed4-8496-4ed7712e255d X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: +MJuV8alJjWmM6uiqPIfWsJ1vk8oG/vADbaLPWpRQciXTbHo/rkdyISJ5aTFWRI35V8u8cUeUVdInJhZ4DjHSg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SN7PR11MB7489 X-OriginatorOrg: intel.com 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 Reply-To: devel@edk2.groups.io,dandan.bi@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: s6lJFMx79TfkgJIf5JB6fkiax7686176AA= Content-Language: en-US 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=20140610 header.b=O39zFYwc; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") The changes looks good to me. One minor comment about the coding style: Could we make the "else if" at the same line with brace "}", which is align= ed with current edk2 coding style, rather than in a new line ? Thanks. Like: } else if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)->Dsdt = !=3D 0) { Rather than: } else if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)->Dsdt != =3D 0) Thanks, Dandan -----Original Message----- From: Dhaval =20 Sent: Thursday, September 28, 2023 2:45 PM To: devel@edk2.groups.io Cc: Wang, Jian J ; Gao, Liming ; Liu, Zhiguang ; Bi, Dandan Subject: [PATCH v1 1/1] MdeModulePkg: Fix issue with ACPI table creation As per spec if xDSDT is avaialble, it should be used first. Handle required flow when xDSDT is abscent or present. Test: Tested on RISCV64 Qemu platform with xDSDT and booted to linux kernel= . Cc: Jian J Wang Cc: Liming Gao Cc: Zhiguang Liu Cc: Dandan Bi Signed-off-by: Dhaval Sharma --- MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 15 ++++++++= ++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c b= /MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c index e09bc9b704f5..d153c96a6bdb 100644 --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c @@ -1892,7 +1892,20 @@ InstallAcpiTableFromHob ( } } - if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_T= ABLE *)ChildTable)->Dsdt !=3D 0) {+ //+ // First check if xDS= DT is available that is preferred+ //+ if (((EFI_ACPI_3_0_FIX= ED_ACPI_DESCRIPTION_TABLE *)ChildTable)->XDsdt !=3D 0) {+ TableToI= nstall =3D (VOID *)(UINTN)((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)Chi= ldTable)->XDsdt;+ Status =3D AddTableToList (AcpiTableInst= ance, TableToInstall, TRUE, Version, TRUE, &TableKey);+ if (EFI_ER= ROR (Status)) {+ DEBUG ((DEBUG_ERROR, "InstallAcpiTableFromHob: = Fail to add ACPI table xDSDT\n"));+ ASSERT_EFI_ERROR (Status);+ = break;+ }+ }++ else if (((EFI_ACPI_3_0_FI= XED_ACPI_DESCRIPTION_TABLE *)ChildTable)->Dsdt !=3D 0) { TableToI= nstall =3D (VOID *)(UINTN)((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)Chi= ldTable)->Dsdt; Status =3D AddTableToList (AcpiTableInsta= nce, TableToInstall, TRUE, Version, TRUE, &TableKey); if (EFI_ERR= OR (Status)) {--=20 2.39.2 -=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 (#110899): https://edk2.groups.io/g/devel/message/110899 Mute This Topic: https://groups.io/mt/101633356/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-