From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web08.6665.1638929201393006800 for ; Tue, 07 Dec 2021 18:06:41 -0800 Authentication-Results: mx.groups.io; dkim=pass header.i=@intel.onmicrosoft.com header.s=selector2-intel-onmicrosoft-com header.b=euDTo8GS; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: nathaniel.l.desimone@intel.com) X-IronPort-AV: E=McAfee;i="6200,9189,10191"; a="237545093" X-IronPort-AV: E=Sophos;i="5.87,295,1631602800"; d="scan'208";a="237545093" Received: from fmsmga002.fm.intel.com ([10.253.24.26]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 07 Dec 2021 18:06:25 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.87,295,1631602800"; d="scan'208";a="606059193" Received: from orsmsx605.amr.corp.intel.com ([10.22.229.18]) by fmsmga002.fm.intel.com with ESMTP; 07 Dec 2021 18:06:24 -0800 Received: from orsmsx604.amr.corp.intel.com (10.22.229.17) by ORSMSX605.amr.corp.intel.com (10.22.229.18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20; Tue, 7 Dec 2021 18:06:24 -0800 Received: from ORSEDG601.ED.cps.intel.com (10.7.248.6) by orsmsx604.amr.corp.intel.com (10.22.229.17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.2308.20 via Frontend Transport; Tue, 7 Dec 2021 18:06:24 -0800 Received: from NAM11-CO1-obe.outbound.protection.outlook.com (104.47.56.172) by edgegateway.intel.com (134.134.137.102) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.1.2308.20; Tue, 7 Dec 2021 18:06:22 -0800 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=PgMHhEPZenWMQESFv2Di3aGa1+DL4s/hSrV6VmRC3I4vIAtoBVQTM8rJTvFUvLQTeEFWUgo8IuqWyl5Lv0aty0493yy5RqWYhpZpMJMnfBnPP7L4iLhoiAZ2vvi82sKFxakeC24N0wjMoDqrxi3QYSw4sOl7jnitmrCaMeOmFXhKmuz40HQ4+lCbrd40o/1w7B4VT2gjRl7s4jRrOyEFNmvpsReWyYxMC3QNbX/P8+syI2CdEAFuA5qg4Jpvjx/CqoDv383KA0A0G6irPpse9snRm+Q4gySoRbIPjabUqZsAABFiznH15uoDsEM4bSqQXLd+2flX5C+IpXLXN/f0hw== 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=aqYAzstUsBoLBoA8m7VQZaiCwub6IbMLUp+LskmqZ7s=; b=kXyBjr+hb2YuY6phaOfkBvKhU075Seo8IKP8nADUhwFJhwayQibqnMqtGcObECHJDeIu5Yn7RCubfaK/uDN8J0uFhED8CjVviW9bPIDGVYZzAlILQsOrrA8QWd3L9V1G764cIbGb6Fw7faIhsCJWcdud5Ht++YGUHw6e1VtYyZYHdW6VQPxngomdOG0mYjFFpv7Q+49Z0fA52bkpOWlaor9wxLnlCuyxmGSESMz4hVWQRvu9KXCqX5jvHLNlKNv1YBhwdcHoPdAGQ41/jFnxvVHk0CoEpxvb+hhCximS5vTdvn2zcFf31m/GiOf/TboxepHfwwkDSL9TSVu/7gLzCQ== 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 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=intel.onmicrosoft.com; s=selector2-intel-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aqYAzstUsBoLBoA8m7VQZaiCwub6IbMLUp+LskmqZ7s=; b=euDTo8GSfgZOpHSJnDRHnYdF0pyBP2lE9TQPoHQyvQyjSV4NkfazlvRvqSNUcshdGqsyCg9Qosfre50d5K1XTmkxZouTnRkXsEAlVuVwNFMyQQJDl7N9xAm6HcNIb83/JW0HO4EcWlEcG8iSZJC8Llk2SixVvpNlW0Dyi73OSwc= Received: from MW4PR11MB5821.namprd11.prod.outlook.com (2603:10b6:303:184::5) by CO1PR11MB4929.namprd11.prod.outlook.com (2603:10b6:303:6d::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.4778.11; Wed, 8 Dec 2021 02:06:22 +0000 Received: from MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::6920:39b9:e18c:9dc5]) by MW4PR11MB5821.namprd11.prod.outlook.com ([fe80::6920:39b9:e18c:9dc5%5]) with mapi id 15.20.4755.022; Wed, 8 Dec 2021 02:06:22 +0000 From: "Nate DeSimone" To: "Sravanthi, K KavyaX" , "devel@edk2.groups.io" CC: "Chiu, Chasel" , Liming Gao , "Dong, Eric" , "Oram, Isaac W" , Michael Kubacki Subject: Re: [Patch V2] MinPlatformPkg: Check if Acpi table is already installed. Thread-Topic: [Patch V2] MinPlatformPkg: Check if Acpi table is already installed. Thread-Index: AQHX6mjLiWvORF6lDEKBHjxuERO9Eawn2I3Q Date: Wed, 8 Dec 2021 02:06:21 +0000 Message-ID: References: <20211206061610.3316-1-k.kavyax.sravanthi@intel.com> In-Reply-To: <20211206061610.3316-1-k.kavyax.sravanthi@intel.com> Accept-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: dlp-reaction: no-action dlp-version: 11.6.200.16 dlp-product: dlpe-windows authentication-results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=intel.com; x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: be64f353-8268-4423-97be-08d9b9ef54cd x-ms-traffictypediagnostic: CO1PR11MB4929:EE_ x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:9508; x-ms-exchange-senderadcheck: 1 x-ms-exchange-antispam-relay: 0 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: xhNMA1arTtWSqvhB9D/l2eF19mDyfTzDS3Cf4bMIjJ9mBQMFOp9ZvENK3nafNq119ZV5bbuSbZbGrBPAaOJEZAzAYjfJDuS6EnBTR1EOO+ke23FZ6lZNd0LeXh+sJqr9DtTnMCLrvBioL374zxI48VBXXDiyp7RebGsG8iRHcSFS4vZoyxzzEe2eaCiDznLMQm4YwFoC7U7SdBg36heKdXcXIUGiDLo9iIfSbcYPrJpvk0a/vPMIdLCZ2YvrWOyEyCGQfmhR5kJpvNM3kg/xf40e3fLkeBnu7QQhLs/aFL2B+gDH5qiLH+2Iv4LPGfCwahKrDeEwswL+EvM+Mn9DckJHOsXWI0Ro4QmMkwig4nwGv1EM6tOobNdzg+G92+f1uZHzILCS6z3I/h0BeQCNB3AMQw+TVpplE/22yGlxiG+29Whv+Gz2MZ7tIu7Fm6/roIyceaMRwoxq1ZYlg4dXKb8kLtUCR/UoxtBeQlqfbgpC57sIJZCGhrHKPLWR7rNVL1mMcabECOc61OnTGRV2rfcktAgUxDUgHhqtfWZW6uBqk4FDzA6fjxd1M3KrbAJzITS+HkA7FOSK5/m2fL7b7F0ZhPsVHui1vdj1KlGV7Ll4w416+Yqk3OUiQHhn0CUDux2bS7Siyjrtm6E3pD2EQRonOnIyCg+HSoV5WTpe1BHaobVq8OPhLnlE9wtLcTBwswUnVO2adxxA8S3gXcLP6g== x-forefront-antispam-report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:MW4PR11MB5821.namprd11.prod.outlook.com;PTR:;CAT:NONE;SFS:(366004)(83380400001)(508600001)(5660300002)(53546011)(33656002)(6506007)(64756008)(186003)(82960400001)(9686003)(66446008)(26005)(76116006)(66556008)(66476007)(66946007)(8936002)(8676002)(2906002)(38100700002)(122000001)(52536014)(4326008)(7696005)(55016003)(86362001)(38070700005)(71200400001)(316002)(110136005)(54906003);DIR:OUT;SFP:1102; x-ms-exchange-antispam-messagedata-chunkcount: 1 x-ms-exchange-antispam-messagedata-0: =?us-ascii?Q?GAEOzNArfIjfWKkbvHHuQNZeo+UVjE9ZCEvT+2osU2aIfW+znTugqJn1vSDD?= =?us-ascii?Q?FqeslsN1mF4PY1KEdtdC5Pxo0cUGdv6zmuIlYp8e3ZTftHrq1lE0etKocqBS?= =?us-ascii?Q?BV/WYhy1jHl+tjgsXX5j2FVFGf9RttxK5hPxSGUqjgxoYkUPE4S2pv4quc1M?= =?us-ascii?Q?tFs0yNsI/uR0rnbqhe/W6ZRIJsFiI4ErV/YsbafI3piJUEuxx5yXHmOB1Sze?= =?us-ascii?Q?pgvu/XJsMjlbJJ8o8JsZlN580NcUsQjuL3JVZ8EB8PG4atXYZVAt6gInwuLy?= =?us-ascii?Q?+OJAlFLp9Y/UGNpaZ/DAQqmdk/q+zY4iRjyKfXnbMAoKQx9AM/frPDPKg/ms?= =?us-ascii?Q?PFVkB9mlXyV+xIBSyvMh8mhVWqyrEutOVq5tncyKvfDzQ7i4RNi0Wf6/nyUR?= =?us-ascii?Q?bn/IRA9XtVGex5IFUbIP/JyQyJ4Qt0GRFlM/LkNxh5hIW6unD4/xsJ1h7FVJ?= =?us-ascii?Q?Z4al9/hrSX6ALAffDJ1BjTN7yJ/t27ogy7oHguCQ3CNeojlqCQxnp+BfWShZ?= =?us-ascii?Q?sUXyUFWRnRaEiZpFfMCAiOgFyO4Y7lSxkHfxpCM+RGzanDZpMv7ISZ9XQ4jR?= =?us-ascii?Q?oBIOe/oFoCexVkmNfEjuYnfcD4xLIL5Iz/8AOfHWlt3mB3ZUMuJ2cH35z1iy?= =?us-ascii?Q?oGiTnyuauvdA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ht?= =?us-ascii?Q?ttyx7j18RNpuAflDr5h/MPdQHCXAiOcjaFL1dDM0LA6I21AsW9sdO5gBdPh3?= =?us-ascii?Q?XscV7qPHVToEjDHp7p5Veuy0+rRYRSyvqLlys4Ifcej3wcOIhC9BJPaI18kb?= =?us-ascii?Q?QqMlGg=3D=3D?= MIME-Version: 1.0 X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-AuthSource: MW4PR11MB5821.namprd11.prod.outlook.com X-MS-Exchange-CrossTenant-Network-Message-Id: be64f353-8268-4423-97be-08d9b9ef54cd X-MS-Exchange-CrossTenant-originalarrivaltime: 08 Dec 2021 02:06:21.9299 (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: KXrqceOdGaPZC+fZhGCUmt7332x3++o4K8IbFEyf5Ur/xY/Qpn+WsvOLYb/Adl5OqmHT1TC+wwPifbizxuWPgSAbd5nQyJdw6tUC17wZE20= X-MS-Exchange-Transport-CrossTenantHeadersStamped: CO1PR11MB4929 Return-Path: nathaniel.l.desimone@intel.com X-OriginatorOrg: intel.com Content-Language: en-US Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable This seems like a hack to me. One of the major goals of the Minimum Platfor= m Architecture is consistency. A board override for the MinPlatform provide= d installation of the MCFG table runs counter to that goal. Every field in = the MCFG table produced by MinPlatform's implementation is fully customizab= le by board code via the PciSegmentInfoLib's GetPciSegmentInfo() function. = If a multi-segment MCFG table is needed, then all the board needs to do is = choose a different implementation of PciSegmentInfoLib than the default one= (MinPlatformPkg\Pci\Library\PciSegmentInfoLibSimple\PciSegmentInfoLibSimpl= e.inf) I cannot conceive of any reason why a board override of this functionality = is required. Why do you need this?=20 -----Original Message----- From: Sravanthi, K KavyaX =20 Sent: Sunday, December 5, 2021 10:16 PM To: devel@edk2.groups.io Cc: Sravanthi, K KavyaX ; Chiu, Chasel ; Desimone, Nathaniel L ; = Liming Gao ; Dong, Eric Subject: [Patch V2] MinPlatformPkg: Check if Acpi table is already installe= d. Check if Acpi table is already installed by locating the first ACPI table i= n XSDT/RSDT based on Signature Cc: Chasel Chiu Cc: Nate DeSimone Cc: Liming Gao Cc: Eric Dong Signed-off-by: kavya Reviewed-by: Zhiguang Liu --- Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c | 18 ++++++++= ++++++++++ 1 file changed, 18 insertions(+) diff --git a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c b= /Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c index 785cf4c2f9..dcbb8b7c7f 100644 --- a/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c +++ b/Platform/Intel/MinPlatformPkg/Acpi/AcpiTables/AcpiPlatform.c @@ -1048,12 +1048,21 @@ InstallMcfgFromScratch ( { EFI_STATUS = Status; EFI_ACPI_MEMORY_MAPPED_CONFIGURATION_BASE_ADDRESS_TABLE_HEADER = *McfgTable; + EFI_ACPI_COMMON_HEADER = *Mcfg; EFI_ACPI_MEMORY_MAPPED_ENHANCED_CONFIGURATION_SPACE_BASE_ADDRESS_ALLOCAT= ION_STRUCTURE *Segment; UINTN = Index; UINTN = SegmentCount; PCI_SEGMENT_INFO = *PciSegmentInfo; UINTN = TableHandle; =20 + Mcfg =3D (EFI_ACPI_COMMON_HEADER *) EfiLocateFirstAcpiTable ( + EFI_ACPI_3_0_PCI_EXPRESS_MEMORY_MAPP= ED_CONFIGURATION_SPACE_BASE_ADDRESS_DESCRIPTION_TABLE_SIGNATURE + ); if (Mcfg !=3D NULL) { + DEBUG ((DEBUG_INFO, "MCFG table already installed\n")); + return EFI_SUCCESS; + } + PciSegmentInfo =3D GetPciSegmentInfo (&SegmentCount); =20 McfgTable =3D AllocateZeroPool ( @@ -1365,6 +1374,7 @@ UpdateLocalTable ( { EFI_STATUS Status; EFI_ACPI_COMMON_HEADER *CurrentTable; + EFI_ACPI_COMMON_HEADER *Table; EFI_ACPI_TABLE_VERSION Version; UINTN TableHandle; UINTN Index; @@ -1372,6 +1382,14 @@ UpdateLocalTable ( for (Index =3D 0; Index < sizeof(mLocalTable)/sizeof(mLocalTable[0]); In= dex++) { CurrentTable =3D mLocalTable[Index]; =20 + Table =3D (EFI_ACPI_COMMON_HEADER *) EfiLocateFirstAcpiTable (CurrentT= able->Signature); + if (Table !=3D NULL) { + DEBUG ((DEBUG_INFO, "Acpi table with signature=3D%c%c%c%c already in= stalled\n", + ((CHAR8*)&CurrentTable->Signature)[0], ((CHAR8*)&CurrentTable-= >Signature)[1], + ((CHAR8*)&CurrentTable->Signature)[2], ((CHAR8*)&CurrentTable-= >Signature)[3])); + continue; + } + PlatformUpdateTables (CurrentTable, &Version); =20 TableHandle =3D 0; -- 2.16.2.windows.1