From nobody Thu May 2 12:33:23 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) client-ip=66.175.222.108; envelope-from=bounce+27952+84376+1787277+3901457@groups.io; helo=mail02.groups.io; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84376+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1638771383; cv=none; d=zohomail.com; s=zohoarc; b=ej4Lj8dKfJtDj/EjJwE2ACTOg78miVrDJJRJm2JOHY3alTiEQQ2NLGQ5jZmyU/QYatvMPl9i3CES8o7524BK5HpKY59lf7dfPo2Xjl/rhAB4eXyM5yghvN7dLMAIdMA3V6r0jLJz5x5HVTMUwK0c03gl2ENTgxBIRIc7sZNvW04= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1638771383; h=Content-Transfer-Encoding:Cc:Date:From:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:Sender:Subject:To; bh=8zwxF6flf0oTQkfoeQ+HlmJiT/lN1nxIOPvLuS1/PtU=; b=js4hLTRNNV1kifJkHSp1TlCkorKsOMafR7DHDadhRtrVzOUu82jx7r4P6HJpiWN07HlQgB6UZmN1aaHtllOTiOGrxQcSqvNtPEpBgPCx/Y92OFiZMmMmfkX1EJpULeFbsw+Lhd/FvpFqZu2W9qYC12VgEINiWDDkFkGQ9BfKiNs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of groups.io designates 66.175.222.108 as permitted sender) smtp.mailfrom=bounce+27952+84376+1787277+3901457@groups.io; dmarc=fail header.from= (p=none dis=none) Received: from mail02.groups.io (mail02.groups.io [66.175.222.108]) by mx.zohomail.com with SMTPS id 1638771383941403.19005822588815; Sun, 5 Dec 2021 22:16:23 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id vrk3YY1788612xE0nP7I2Yga; Sun, 05 Dec 2021 22:16:23 -0800 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web08.47933.1638771381922780383 for ; Sun, 05 Dec 2021 22:16:22 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10189"; a="224508192" X-IronPort-AV: E=Sophos;i="5.87,290,1631602800"; d="scan'208";a="224508192" X-Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2021 22:16:21 -0800 X-IronPort-AV: E=Sophos;i="5.87,290,1631602800"; d="scan'208";a="542282705" X-Received: from ksravanx-mobl1.gar.corp.intel.com ([10.215.128.173]) by orsmga001-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 05 Dec 2021 22:16:18 -0800 From: "kavya" To: devel@edk2.groups.io Cc: kavya , Chasel Chiu , Nate DeSimone , Liming Gao , Eric Dong Subject: [edk2-devel] [Patch V2] MinPlatformPkg: Check if Acpi table is already installed. Date: Mon, 6 Dec 2021 11:46:10 +0530 Message-Id: <20211206061610.3316-1-k.kavyax.sravanthi@intel.com> MIME-Version: 1.0 Precedence: Bulk List-Unsubscribe: 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,k.kavyax.sravanthi@intel.com X-Gm-Message-State: 0PEfpGAuLgJoz1T6XOgMGLVex1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1638771383; bh=BbjGFuDHTiqCwDQVQH973LbsPkHG5OhQN2QYNWaws7s=; h=Cc:Date:From:Reply-To:Subject:To; b=ov2pIJWjepi/eiJLkfjnE8tBJ5ZgG/yk3mIBLd75Y9cDyDm32x5WGaJHUYTb9ucMJje yt7tH1FaNagkiWoyR99wvpxrQ1FwY5L3L63RjQuhXDpGVBPFMKoFiHH9c0t0ZA6k0+nOV xqcipCpZ09YmcKhKBISIxs+h+5A5wbGXM1c= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1638771385611100002 Content-Type: text/plain; charset="utf-8" Check if Acpi table is already installed by locating the first ACPI table in 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 Reviewed-by: Eric Dong Reviewed-by: Ray Ni --- 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; --=20 2.16.2.windows.1 -=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 (#84376): https://edk2.groups.io/g/devel/message/84376 Mute This Topic: https://groups.io/mt/87535133/1787277 Group Owner: devel+owner@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [importer@patchew.org] -=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-=3D-