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 0BCCFD80C7F for ; Fri, 17 Nov 2023 17:50:54 +0000 (UTC) DKIM-Signature: a=rsa-sha256; bh=CfE27yGOMH+2y90tsXDH46ee24Y4E9WUQLh+7cc+Ycg=; 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=1700243453; v=1; b=JavJcB7heCn7sXBYVqjG8GUE8k1DmEarYyFOkWAys6G7BTCuNdZDp3Pv0d4lyO4MyogMp3yf p+o5HQfxkeF4Qk+Hk1oc0nY6SxetlUzyaUzRTqQDk/Rv1ORG80VWKvtmfoa4Gci3w2gW8e0Ofw6 trAUbIMlG4F+BepZrValispY= X-Received: by 127.0.0.2 with SMTP id z4skYY7687511xup3tf3NHU8; Fri, 17 Nov 2023 09:50:53 -0800 X-Received: from mgamail.intel.com (mgamail.intel.com [192.55.52.93]) by mx.groups.io with SMTP id smtpd.web10.1997.1700243453019073291 for ; Fri, 17 Nov 2023 09:50:53 -0800 X-IronPort-AV: E=McAfee;i="6600,9927,10897"; a="388490709" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="388490709" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga102.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Nov 2023 09:50:52 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10897"; a="759230069" X-IronPort-AV: E=Sophos;i="6.04,206,1695711600"; d="scan'208";a="759230069" X-Received: from fmsmsx601.amr.corp.intel.com ([10.18.126.81]) by orsmga007.jf.intel.com with ESMTP/TLS/AES256-GCM-SHA384; 17 Nov 2023 09:50:52 -0800 X-Received: from fmsmsx610.amr.corp.intel.com (10.18.126.90) by fmsmsx601.amr.corp.intel.com (10.18.126.81) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34; Fri, 17 Nov 2023 09:50:51 -0800 X-Received: from FMSEDG603.ED.cps.intel.com (10.1.192.133) by fmsmsx610.amr.corp.intel.com (10.18.126.90) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2507.34 via Frontend Transport; Fri, 17 Nov 2023 09:50:51 -0800 X-Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.168) by edgegateway.intel.com (192.55.55.68) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2507.34; Fri, 17 Nov 2023 09:50:51 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=KRH9LXUMYwzg3UhxQSBepEB4YJGXb1dCEKmRlWv63PqH5S2xr09feBTerELrcS5I4hIimhuZ1jrNCnV34YvyvpPt5KC3tMRHwFSKOIukUeoOseRg8kAcYHr0Me6+O0gyNcoNuV/rF3wWNasm4vnGQuPaxkr1jxo9XEcx4XDeL25OLpXDLzMpkr2fqLEd+Ov2dov8ZgKaIaZs518U2W6etubgGJHgd0JrXweXJ9R9wGWRDChORHn+voYWBi35XRSCXEt2QSi3xbLTJNvWqnHtmd7fOXO8AbErZUx2C8Nid4qisfn90QyKJoKlpfw96mODYUO8WMPlrVo0+U2z+wiHpA== 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=onrEkT9zEe6ah1PArKSgv02ysz3OianxjpDcKAf22gs=; b=OiAPW6paM7yamFPWTxxjrPESZtY1pwiOi0iDT82TWkbu7VKhLryzykJGYfVI9K4a7dn+95W3ODv76/eFSL6FWGEsYVsLikhQho1hu2un0uXvBCMuUYRo55D1rayGJQuCFY49ELUKx3krWp3QtnfRyWMA6p6JRyX0VHK/854WPxhSWJd5w0DnlX3xnjSzq8z6eS9nwR6999EMTf2mlUovAo4MdizjluD2gaeW3sh85WRctKdI0IQmV5A5b+LOYqQwTUwPsKDznxM9f9z2Qcdx2QEgzHX2Xjb3pU7arU4Ck7eqPnfIpu47yXkm4ERS8+jO1m1Hn8LkLjyPRaE0KQsUTg== 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 BN9PR11MB5483.namprd11.prod.outlook.com (2603:10b6:408:104::10) by SJ0PR11MB8296.namprd11.prod.outlook.com (2603:10b6:a03:47a::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7002.20; Fri, 17 Nov 2023 17:50:42 +0000 X-Received: from BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::6da1:a4b7:4771:14e1]) by BN9PR11MB5483.namprd11.prod.outlook.com ([fe80::6da1:a4b7:4771:14e1%4]) with mapi id 15.20.7002.022; Fri, 17 Nov 2023 17:50:42 +0000 From: "Chiu, Chasel" To: "devel@edk2.groups.io" , "dhaval@rivosinc.com" CC: "Gao, Liming" , "Liu, Zhiguang" , "Bi, Dandan" , "Chiu, Chasel" Subject: Re: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: Fix issue with ACPI table creation Thread-Topic: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: Fix issue with ACPI table creation Thread-Index: AQHaGU3zc7UOmgs4IE2Ue8Z5RiO9sbB+yhow Date: Fri, 17 Nov 2023 17:50:42 +0000 Message-ID: References: <20231117113523.44080-1-dhaval@rivosinc.com> <20231117113523.44080-2-dhaval@rivosinc.com> In-Reply-To: <20231117113523.44080-2-dhaval@rivosinc.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-ms-publictraffictype: Email x-ms-traffictypediagnostic: BN9PR11MB5483:EE_|SJ0PR11MB8296:EE_ x-ms-office365-filtering-correlation-id: 01ea8559-622f-44bc-4f6d-08dbe795b827 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: Pr9NW/sBCoia2EVElVtd/fLUFQf0gvNYA89Q4lj6JUm6/KF6Gz6vrnhMItNsSX5mWT3T//aJsDBF+zCSJOBs8dNvrXzPMFhI69EESB2euZaAy858gQWjZHku+3kOgoovqDG1d4Gx4L78heu+zTSLupfPH9ssAtb//Pj8nSlpT6JhzkDeZNVZigKvjV2+A7i61kpBmi7naVfw0fPt2pfCmANU+kBuUeijl2ETMI3jLaPTZuWeZBIDeaM8oNpMEXbIuGp8RdF5iATPKQUMqb2mhhEc0itpRzRXsMI9PskNAkjTksL11kh4mrBWbGKLbrT9uKkIe3GKCnXNOF8UfJ8GabDouBy+GgNl8iHXfnjQ/WJdlXQ0POrmhLXTXvFdTIjw4ygGpHGrE3Tulsh4gvzVGIJeVxJZoSjHOwXuZdO5SeODoRrwWSx5dHkO/rjzAwjgYKX4p6cEybBKxvRd2Hcinf9qyeubM5kxTmgjkGM04SvH8ylnCxOvB4CYMkORU1jC0xyGXpSToJ1gD3d7SNxwt1o9f4PoNe+3J/h0925ERKjTzqns97ufnKAYiGLRXcKzRLWnkNVS3LcyZcs3HnBIp5tZy5z8x+srC25zQYRlqSYlrHElVwwLro7bkK5IyDUYwBGocilKkvm7SEaWxVzo0Q== x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?OFUaaYxoanfL25iBnXRCLVC7ARJlApzl5CfwVoBYk+thUUJXMhiubB7MH9HD?= =?us-ascii?Q?boGNWZJ1GFLjLesVmiXaoRJ5mx7n6khV8Hq8w1B5q1kHx2d0pot6zk5ujJfn?= =?us-ascii?Q?3opPaI2ImB4A9nqlsaBKdFBb8Ghe3omGtz2++cNpnChNNFiz8rMDx9DASTb6?= =?us-ascii?Q?U/c/Muw7OLfu+jj5wDbZlDd6IrSYSbwvddvaZmNbbmaeRJ730YwzoVWJJb1w?= =?us-ascii?Q?B5YEiisjLp4kQye86IQYwusYjEi4N0FEV50+UJA87m9oIz/ql9NdI+y7hU09?= =?us-ascii?Q?KjF5nKagiwf6j1BpmMICJGgCmWgczEfTncyLK2owBUduJuzgerm74DseAc7b?= =?us-ascii?Q?16xeJ729FkNX9XDjueuzXHMuvldrb/1n9vL4B/eCnhvw+JFqnKd+OxPXFwIi?= =?us-ascii?Q?lhPHO1G48WZXQhp9yiEGqPDqZae6aeHV37NCVFa8qiAL2dKoZpuvFXEIfOVg?= =?us-ascii?Q?03pkqS389E4ooz/xN35VpLYgCJqOoP963lYBMdWMZVx4j5y6E+CnIacn5n8+?= =?us-ascii?Q?l9GBzuptpMs7V5i9feEHFDiqy4OjwIn0/clcMJ2oL6A8TWjKo5mOl8C2t3xD?= =?us-ascii?Q?xQO8jaaQxjYv6LxrQ8T4+X9Cct9y1Ft7KTgpA9b1dJDbxc7OOzqd1fSvOM+5?= =?us-ascii?Q?YVpTHjiZmptqLn7TiNve7eqz4FyjpzNmxm0Q6ndPwDLfDpXm//sUzBsKUQfd?= =?us-ascii?Q?dLycS/KmTB1kXRGKdNXGidfazF8DpsuYRiFNx+JlQm++Z0/aon5hSvsz0NRf?= =?us-ascii?Q?GK30OwKvTA8fnUqZea42fWYP5uZ4Pa7vgY+b9sjivzHR06gKVCFetAIsCD4e?= =?us-ascii?Q?lUoTWUPw2yD5i0LPsGfWsrKCdaKoE+iIKWs1bvc2nVCIiTXXIJUYCi6kaHZZ?= =?us-ascii?Q?DttvJoCoNzt2MWWDByCREJ4B9bspCqNx3V3UPNnbX7iYLGxqrSXkhioArynw?= =?us-ascii?Q?/MvwVYDai80bepMEIre2ZjyLq3ohSSZyxUuj0ZB69aOosp5cdzAhVh6/BRvI?= =?us-ascii?Q?pj6MbWhH1kyxoXup7muLM7MfZw9dzceMXBObwMTMd2g4gcIHakUlMF3xdJ7H?= =?us-ascii?Q?KW6GeQlpyxUQRXYZ2OgmLWKkz3pNq6Om7u6BNF93ATOsG6JWypZ8XoE0H/x9?= =?us-ascii?Q?74v5KUatHULZd3cTqAK8Mna/dxvO2S//3EtVwFrbrcsCqYa10n93T40ekN0z?= =?us-ascii?Q?wJk0UVXVcLMMh6HlibOhcKXMo5rnjyRl1EVpBC7mh34PEeWKnOGAJVegSTap?= =?us-ascii?Q?AAk1WHUsMmWhxACbWs5as+O69WxP54rMeXSPJpsU1xoRPM8iunqpAf7+hXPw?= =?us-ascii?Q?p9ec78Wut2UZaVnI/jg2BbNC+jVy3tkqtrcRbhdzhmZUgFolNnWbdt4UJHgI?= =?us-ascii?Q?G1T5A9I8jgijEJnxAQY8vjAMU5EQcsr9ajDIPPw1vLTG43VXWCBWlKQDTCFm?= =?us-ascii?Q?9o1ZtgRI9EHnaVCnt+ILcQZKccAPTRm8Qepr8dP+BgRqx7+nhL02xIJPQpDV?= =?us-ascii?Q?zStDl1rrrC5Fb+btSw4+mXZBWU4fYtvl6sg+rvTZBZm2TA0btNBQyajeRgbb?= =?us-ascii?Q?M663SriLwkWPp7Ms3Z+SbUKWSce978sgY8Am0adZ?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: BN9PR11MB5483.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: 01ea8559-622f-44bc-4f6d-08dbe795b827 X-MS-Exchange-CrossTenant-originalarrivaltime: 17 Nov 2023 17:50:42.8489 (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: R4c7OwI+CGitZPsv5zRvaZHmqJW+4rSk+tI/GzwDBvN39C1aePEtmQ2+YDQhBoA4cWWsWRAGWDEkLAmpzuop0A== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SJ0PR11MB8296 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,chasel.chiu@intel.com List-Unsubscribe-Post: List-Unsubscribe=One-Click List-Unsubscribe: X-Gm-Message-State: iWgHXP9VguLIpUP6AHUqkj3Ox7686176AA= 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=JavJcB7h; spf=pass (spool.mail.gandi.net: domain of bounce@groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce@groups.io; dmarc=fail reason="SPF not aligned (relaxed), DKIM not aligned (relaxed)" header.from=intel.com (policy=none); arc=reject ("signature check failed: fail, {[1] = sig:microsoft.com:reject}") Hi Dhaval, Just a small feedback, the only difference will be TableToInstall between XDsdt and Dsdt, could we= optimize the code flow to reduce duplicate lines? Thanks, Chasel > -----Original Message----- > From: devel@edk2.groups.io On Behalf Of Dhaval > Sharma > Sent: Friday, November 17, 2023 3:35 AM > To: devel@edk2.groups.io > Cc: Gao, Liming ; Liu, Zhiguang > ; Bi, Dandan > Subject: [edk2-devel] [PATCH v2 1/1] MdeModulePkg: Fix issue with ACPI ta= ble > creation >=20 > As per spec if xDSDT is avaialble, it should be used first. > Handle required flow when xDSDT is abscent or present. >=20 > Test: Tested on RISCV64 Qemu platform with xDSDT and booted to linux kern= el. >=20 > Cc: Liming Gao > Cc: Zhiguang Liu > Cc: Dandan Bi > Signed-off-by: Dhaval Sharma > --- >=20 > Notes: > v2: > - Added proper indentation for else if >=20 > MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c | 13 > ++++++++++++- > 1 file changed, 12 insertions(+), 1 deletion(-) >=20 > diff --git a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c > b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c > index e09bc9b704f5..11097ed4c3be 100644 > --- a/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c > +++ b/MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableProtocol.c > @@ -1892,7 +1892,18 @@ InstallAcpiTableFromHob ( > } } - if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION= _TABLE > *)ChildTable)->Dsdt !=3D 0) {+ //+ // First check if xDSDT = is available that is > preferred+ //+ if (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TA= BLE > *)ChildTable)->XDsdt !=3D 0) {+ TableToInstall =3D (VOID > *)(UINTN)((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)- > >XDsdt;+ Status =3D AddTableToList (AcpiTableInstance, T= ableToInstall, > TRUE, Version, TRUE, &TableKey);+ if (EFI_ERROR (Status)) {+ = DEBUG > ((DEBUG_ERROR, "InstallAcpiTableFromHob: Fail to add ACPI table xDSDT\n")= );+ > ASSERT_EFI_ERROR (Status);+ break;+ }+ } else = if > (((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)->Dsdt !=3D 0) > { TableToInstall =3D (VOID > *)(UINTN)((EFI_ACPI_3_0_FIXED_ACPI_DESCRIPTION_TABLE *)ChildTable)- > >Dsdt; Status =3D AddTableToList (AcpiTableInstance, Ta= bleToInstall, > TRUE, Version, TRUE, &TableKey); if (EFI_ERROR (Status)) {-- > 2.39.2 >=20 >=20 >=20 > -=3D-=3D-=3D-=3D-=3D-=3D > Groups.io Links: You receive all messages sent to this group. > View/Reply Online (#111395): https://edk2.groups.io/g/devel/message/11139= 5 > Mute This Topic: https://groups.io/mt/102645488/1777047 > Group Owner: devel+owner@edk2.groups.io > Unsubscribe: https://edk2.groups.io/g/devel/unsub [chasel.chiu@intel.com]= -=3D- > =3D-=3D-=3D-=3D-=3D >=20 -=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 (#111405): https://edk2.groups.io/g/devel/message/111405 Mute This Topic: https://groups.io/mt/102645488/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-