From nobody Wed May 8 19:58:04 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+84639+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+84639+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1639147339; cv=none; d=zohomail.com; s=zohoarc; b=GAwJw2a98MnsvWnRUVd+N6YE28o2f6+zQ7h5uX/DpyfHxBoHL5+WZCWOCHu/Gqp1VWUHogRzuzHzt6WLr8YWuVedVB7se6HTq6pmhtSWCwf/h+vb0hXbCN5wMM3Yo32VSVdKp/qOnHk/zj0hFRbNiuklD1ma4GNJS8ojzMoSWJs= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639147339; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=3pBHrqe0usI+3Ftxp3Rjk4wTku+4JgBBPGK2AFLDCG0=; b=TJqDdbvmBEa43ZckU5vLlMXjYTRNaf6jD25kG5EzdOrdhOgy/Ee9cOkpWoXA/D6wKMwCJfFHcicj7dxruUYjBV8B4k1fenFUbdJ5DdqvbU4JnXd92uDbcJZBue9kTV15FSBx0xhWK9V1r/zRRxwQCkD9pwlxZ70GXRhbts6udOQ= 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+84639+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 1639147339945691.0483877114527; Fri, 10 Dec 2021 06:42:19 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id tGO7YY1788612x4McZLKnPCF; Fri, 10 Dec 2021 06:42:19 -0800 X-Received: from mga17.intel.com (mga17.intel.com [192.55.52.151]) by mx.groups.io with SMTP id smtpd.web12.7950.1639147338712600394 for ; Fri, 10 Dec 2021 06:42:19 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10193"; a="219043823" X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="219043823" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga107.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 06:42:18 -0800 X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="503951504" X-Received: from gmarti2-mobl1.amr.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.20.4]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 06:42:16 -0800 From: "Boeuf, Sebastien" To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [edk2-devel] [PATCH v7 1/5] OvmfPkg: Handle Cloud Hypervisor host bridge Date: Fri, 10 Dec 2021 15:41:54 +0100 Message-Id: In-Reply-To: References: 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,sebastien.boeuf@intel.com X-Gm-Message-State: e70xOWqaPRfJor8uSczhimmZx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639147339; bh=2OMlfN3n1yzmGKSVY2fTIwBAjCTFf3NRiOGnCHvV6A4=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=HUChi2sO0nkAuMOPNNBTB7KrQfY1T3rvuDERfUuZOWBNH0nzLnKvvn3fEbe8VdYpuBV aMU2qMyejFZQ5uO1tkOTddNA2C25Xd/0Nvo6SiytC1GW2YedpCRAHV2Ifvl3P1Tmp3M5d UNIhY58VFvh6EsXiNIswChbSRhVir0IqLN4= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639147342049100002 Content-Type: text/plain; charset="utf-8" From: Sebastien Boeuf Handle things differently when the detected host bridge matches the Cloud Hypervisor PCI host bridge identifier. Reviewed-by: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Rob Bradford Signed-off-by: Sebastien Boeuf --- OvmfPkg/Include/IndustryStandard/CloudHv.h | 36 +++++++++++++++++++ OvmfPkg/Include/OvmfPlatforms.h | 1 + .../Library/AcpiTimerLib/BaseAcpiTimerLib.c | 3 ++ .../AcpiTimerLib/BaseRomAcpiTimerLib.c | 4 +++ .../Library/AcpiTimerLib/DxeAcpiTimerLib.c | 3 ++ .../PlatformBootManagerLib/BdsPlatform.c | 1 + .../ResetSystemLib/BaseResetShutdown.c | 3 ++ .../Library/ResetSystemLib/DxeResetShutdown.c | 13 +++++-- OvmfPkg/PlatformPei/MemDetect.c | 9 ++++- OvmfPkg/PlatformPei/Platform.c | 8 +++++ 10 files changed, 78 insertions(+), 3 deletions(-) create mode 100644 OvmfPkg/Include/IndustryStandard/CloudHv.h diff --git a/OvmfPkg/Include/IndustryStandard/CloudHv.h b/OvmfPkg/Include/I= ndustryStandard/CloudHv.h new file mode 100644 index 0000000000..1155335690 --- /dev/null +++ b/OvmfPkg/Include/IndustryStandard/CloudHv.h @@ -0,0 +1,36 @@ +/** @file + Various defines related to Cloud Hypervisor + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#ifndef __CLOUDHV_H__ +#define __CLOUDHV_H__ + +// +// Host Bridge Device ID +// +#define CLOUDHV_DEVICE_ID 0x0d57 + +// +// ACPI timer address +// +#define CLOUDHV_ACPI_TIMER_IO_ADDRESS 0xb008 + +// +// ACPI shutdown device address +// +#define CLOUDHV_ACPI_SHUTDOWN_IO_ADDRESS 0x03c0 + +// +// 32-bit MMIO memory hole base address +// +#define CLOUDHV_MMIO_HOLE_ADDRESS 0xc0000000 + +// +// 32-bit MMIO memory hole size +// +#define CLOUDHV_MMIO_HOLE_SIZE 0x38000000 + +#endif // __CLOUDHV_H__ diff --git a/OvmfPkg/Include/OvmfPlatforms.h b/OvmfPkg/Include/OvmfPlatform= s.h index de5d7663b4..f613dd7e2d 100644 --- a/OvmfPkg/Include/OvmfPlatforms.h +++ b/OvmfPkg/Include/OvmfPlatforms.h @@ -16,6 +16,7 @@ #include #include #include +#include =20 // // OVMF Host Bridge DID Address diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c b/OvmfPkg/Libr= ary/AcpiTimerLib/BaseAcpiTimerLib.c index 1d33c86313..6d1e1cb05e 100644 --- a/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c +++ b/OvmfPkg/Library/AcpiTimerLib/BaseAcpiTimerLib.c @@ -55,6 +55,9 @@ AcpiTimerLibConstructor ( AcpiCtlReg =3D POWER_MGMT_REGISTER_Q35 (ICH9_ACPI_CNTL); AcpiEnBit =3D ICH9_ACPI_CNTL_ACPI_EN; break; + case CLOUDHV_DEVICE_ID: + mAcpiTimerIoAddr =3D CLOUDHV_ACPI_TIMER_IO_ADDRESS; + return RETURN_SUCCESS; default: DEBUG (( DEBUG_ERROR, diff --git a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c b/OvmfPkg/L= ibrary/AcpiTimerLib/BaseRomAcpiTimerLib.c index 54a288d52f..c771997a2a 100644 --- a/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c +++ b/OvmfPkg/Library/AcpiTimerLib/BaseRomAcpiTimerLib.c @@ -53,6 +53,8 @@ AcpiTimerLibConstructor ( AcpiCtlReg =3D POWER_MGMT_REGISTER_Q35 (ICH9_ACPI_CNTL); AcpiEnBit =3D ICH9_ACPI_CNTL_ACPI_EN; break; + case CLOUDHV_DEVICE_ID: + return RETURN_SUCCESS; default: DEBUG (( DEBUG_ERROR, @@ -111,6 +113,8 @@ InternalAcpiGetTimerTick ( case INTEL_Q35_MCH_DEVICE_ID: Pmba =3D POWER_MGMT_REGISTER_Q35 (ICH9_PMBASE); break; + case CLOUDHV_DEVICE_ID: + return IoRead32 (CLOUDHV_ACPI_TIMER_IO_ADDRESS); default: DEBUG (( DEBUG_ERROR, diff --git a/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c b/OvmfPkg/Libra= ry/AcpiTimerLib/DxeAcpiTimerLib.c index 01f28b2916..1158461874 100644 --- a/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c +++ b/OvmfPkg/Library/AcpiTimerLib/DxeAcpiTimerLib.c @@ -50,6 +50,9 @@ AcpiTimerLibConstructor ( case INTEL_Q35_MCH_DEVICE_ID: Pmba =3D POWER_MGMT_REGISTER_Q35 (ICH9_PMBASE); break; + case CLOUDHV_DEVICE_ID: + mAcpiTimerIoAddr =3D CLOUDHV_ACPI_TIMER_IO_ADDRESS; + return RETURN_SUCCESS; default: DEBUG (( DEBUG_ERROR, diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg= /Library/PlatformBootManagerLib/BdsPlatform.c index f73c59dfff..5feadc51d7 100644 --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c @@ -1390,6 +1390,7 @@ PciAcpiInitialization ( PciWrite8 (PCI_LIB_ADDRESS (0, 0x1f, 0, 0x6b), PciHostIrqs[3]); // H break; case MICROVM_PSEUDO_DEVICE_ID: + case CLOUDHV_DEVICE_ID: return; default: if (XenDetected ()) { diff --git a/OvmfPkg/Library/ResetSystemLib/BaseResetShutdown.c b/OvmfPkg/L= ibrary/ResetSystemLib/BaseResetShutdown.c index 29abd57fa7..c21d3c89cf 100644 --- a/OvmfPkg/Library/ResetSystemLib/BaseResetShutdown.c +++ b/OvmfPkg/Library/ResetSystemLib/BaseResetShutdown.c @@ -40,6 +40,9 @@ ResetShutdown ( case INTEL_Q35_MCH_DEVICE_ID: AcpiPmBaseAddress =3D ICH9_PMBASE_VALUE; break; + case CLOUDHV_DEVICE_ID: + IoWrite8 (CLOUDHV_ACPI_SHUTDOWN_IO_ADDRESS, 5 << 2 | 1 << 5); + CpuDeadLoop (); default: ASSERT (FALSE); CpuDeadLoop (); diff --git a/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c b/OvmfPkg/Li= brary/ResetSystemLib/DxeResetShutdown.c index a0db8b50bf..31f01b82e4 100644 --- a/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c +++ b/OvmfPkg/Library/ResetSystemLib/DxeResetShutdown.c @@ -16,6 +16,7 @@ #include // PIIX4_PMBA_VALUE =20 STATIC UINT16 mAcpiPmBaseAddress; +STATIC UINT16 mAcpiHwReducedSleepCtl; =20 EFI_STATUS EFIAPI @@ -34,6 +35,9 @@ DxeResetInit ( case INTEL_Q35_MCH_DEVICE_ID: mAcpiPmBaseAddress =3D ICH9_PMBASE_VALUE; break; + case CLOUDHV_DEVICE_ID: + mAcpiHwReducedSleepCtl =3D CLOUDHV_ACPI_SHUTDOWN_IO_ADDRESS; + break; default: ASSERT (FALSE); CpuDeadLoop (); @@ -56,7 +60,12 @@ ResetShutdown ( VOID ) { - IoBitFieldWrite16 (mAcpiPmBaseAddress + 4, 10, 13, 0); - IoOr16 (mAcpiPmBaseAddress + 4, BIT13); + if (mAcpiHwReducedSleepCtl) { + IoWrite8 (mAcpiHwReducedSleepCtl, 5 << 2 | 1 << 5); + } else { + IoBitFieldWrite16 (mAcpiPmBaseAddress + 4, 10, 13, 0); + IoOr16 (mAcpiPmBaseAddress + 4, BIT13); + } + CpuDeadLoop (); } diff --git a/OvmfPkg/PlatformPei/MemDetect.c b/OvmfPkg/PlatformPei/MemDetec= t.c index 738ed0c208..934d5c1965 100644 --- a/OvmfPkg/PlatformPei/MemDetect.c +++ b/OvmfPkg/PlatformPei/MemDetect.c @@ -16,6 +16,7 @@ Module Name: #include #include #include +#include #include #include =20 @@ -159,6 +160,12 @@ QemuUc32BaseInitialization ( return; } =20 + if (mHostBridgeDevId =3D=3D CLOUDHV_DEVICE_ID) { + Uc32Size =3D CLOUDHV_MMIO_HOLE_SIZE; + mQemuUc32Base =3D CLOUDHV_MMIO_HOLE_ADDRESS; + return; + } + ASSERT (mHostBridgeDevId =3D=3D INTEL_82441_DEVICE_ID); // // On i440fx, start with the [LowerMemorySize, 4GB) range. Make sure one @@ -819,7 +826,7 @@ QemuInitializeRam ( // practically any alignment, and we may not have enough variable MTRRs = to // cover it exactly. // - if (IsMtrrSupported ()) { + if (IsMtrrSupported () && (mHostBridgeDevId !=3D CLOUDHV_DEVICE_ID)) { MtrrGetAllMtrrs (&MtrrSettings); =20 // diff --git a/OvmfPkg/PlatformPei/Platform.c b/OvmfPkg/PlatformPei/Platform.c index 3000176efd..906f64615d 100644 --- a/OvmfPkg/PlatformPei/Platform.c +++ b/OvmfPkg/PlatformPei/Platform.c @@ -374,6 +374,14 @@ MiscInitialization ( ); ASSERT_RETURN_ERROR (PcdStatus); return; + case CLOUDHV_DEVICE_ID: + DEBUG ((DEBUG_INFO, "%a: Cloud Hypervisor host bridge\n", __FUNCTION= __)); + PcdStatus =3D PcdSet16S ( + PcdOvmfHostBridgePciDevId, + CLOUDHV_DEVICE_ID + ); + ASSERT_RETURN_ERROR (PcdStatus); + return; default: DEBUG (( DEBUG_ERROR, --=20 2.30.2 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris,=20 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=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 (#84639): https://edk2.groups.io/g/devel/message/84639 Mute This Topic: https://groups.io/mt/87637057/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- From nobody Wed May 8 19:58:04 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+84640+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+84640+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1639147347; cv=none; d=zohomail.com; s=zohoarc; b=hdw04VaGL4RoXLAH+pWYKkTVbxmQM91gkBLCyxFktE+E+V+pkyn7u32kCbMiaqYa0mNLJ2c+Ps5Eq3u2xCu5oXpNBeQl6PDfSKvOcbXb66cWBcRFELLs9xLB54zWi8DsooIOMVGj6fhYuhYNrQ0hME+AqJ9rGMS0caC6uMtBK1M= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639147347; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=bY5wLIYRxUZO/3CU25YkD2kReABxtzx/DwcMXWaUxD0=; b=MKIT1yYRBsE+lpaDFjGbdz67c2o53EfZ87STFS8DHlGqEOhHp3xaeJ0tgjI94QyXl+YVujvmu3Y5uU/079fvltd180wGMElepOpx0fC0oUY551ma3CzMT4cLH0hlh+mOkMueBzikQQPzNgUMEWaMu7U32o8cXBV3+ZvHi4vIEnA= 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+84640+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 1639147347066343.6507294663801; Fri, 10 Dec 2021 06:42:27 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id gqqjYY1788612xSNBODyxgqt; Fri, 10 Dec 2021 06:42:26 -0800 X-Received: from mga02.intel.com (mga02.intel.com [134.134.136.20]) by mx.groups.io with SMTP id smtpd.web12.7951.1639147345821169449 for ; Fri, 10 Dec 2021 06:42:26 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10193"; a="225628428" X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="225628428" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga101.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 06:42:25 -0800 X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="503951526" X-Received: from gmarti2-mobl1.amr.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.20.4]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 06:42:23 -0800 From: "Boeuf, Sebastien" To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [edk2-devel] [PATCH v7 2/5] OvmfPkg: Create global entry point for SMBIOS parsing Date: Fri, 10 Dec 2021 15:41:55 +0100 Message-Id: <663af1ea255a216bc06b66923fc4c99177a75d2a.1639147041.git.sebastien.boeuf@intel.com> In-Reply-To: References: 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,sebastien.boeuf@intel.com X-Gm-Message-State: S06phc8WTJqDdEkpbGnaZF4ax1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639147346; bh=xI00CoV7wHUEfHknwLwsI9zvKHS4z4WDiewKQNaYgSc=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=XX5Q1xO2rem/zsKIe4xpJ/seA6Eoc1gmHRVbtWjaQKlGJQjb5Ik0tq7gsII57vy01HE 7HQpL1T2BSiW9GcYeumbNVN+pUQi2OkvMKFoAklJ+qkFYC8QiUa98y4ixu8nkYRSzjruL 1mPw2LeDovOWEDevP/kFaFfoZ4yhy9bHy7o= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639147347848100002 Content-Type: text/plain; charset="utf-8" From: Sebastien Boeuf Move the generic entry point part out of Qemu.c to anticipate the addition of new ways of retrieving the SMBIOS table. Reviewed-by: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Sebastien Boeuf --- OvmfPkg/SmbiosPlatformDxe/EntryPoint.c | 42 +++++++++++++++++++ OvmfPkg/SmbiosPlatformDxe/Qemu.c | 35 ---------------- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 11 +++++ .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 1 + 4 files changed, 54 insertions(+), 35 deletions(-) create mode 100644 OvmfPkg/SmbiosPlatformDxe/EntryPoint.c diff --git a/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c b/OvmfPkg/SmbiosPlatfor= mDxe/EntryPoint.c new file mode 100644 index 0000000000..f53af2b2e6 --- /dev/null +++ b/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c @@ -0,0 +1,42 @@ +/** @file + Find and extract SMBIOS data. + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include // FreePool() + +#include "SmbiosPlatformDxe.h" + +/** + Installs SMBIOS information for OVMF + + @param ImageHandle Module's image handle + @param SystemTable Pointer of EFI_SYSTEM_TABLE + + @retval EFI_SUCCESS Smbios data successfully installed + @retval Other Smbios data was not installed + +**/ +EFI_STATUS +EFIAPI +SmbiosTablePublishEntry ( + IN EFI_HANDLE ImageHandle, + IN EFI_SYSTEM_TABLE *SystemTable + ) +{ + EFI_STATUS Status; + UINT8 *SmbiosTables; + + Status =3D EFI_NOT_FOUND; + // + // Add QEMU SMBIOS data if found + // + SmbiosTables =3D GetQemuSmbiosTables (); + if (SmbiosTables !=3D NULL) { + Status =3D InstallAllStructures (SmbiosTables); + FreePool (SmbiosTables); + } + + return Status; +} diff --git a/OvmfPkg/SmbiosPlatformDxe/Qemu.c b/OvmfPkg/SmbiosPlatformDxe/Q= emu.c index 4dae4b0b98..9613c090c5 100644 --- a/OvmfPkg/SmbiosPlatformDxe/Qemu.c +++ b/OvmfPkg/SmbiosPlatformDxe/Qemu.c @@ -11,8 +11,6 @@ #include // PcdGetBool() #include // QemuFwCfgFindFile() =20 -#include "SmbiosPlatformDxe.h" - /** Locates and extracts the QEMU SMBIOS data if present in fw_cfg =20 @@ -51,36 +49,3 @@ GetQemuSmbiosTables ( =20 return QemuTables; } - -/** - Installs SMBIOS information for OVMF - - @param ImageHandle Module's image handle - @param SystemTable Pointer of EFI_SYSTEM_TABLE - - @retval EFI_SUCCESS Smbios data successfully installed - @retval Other Smbios data was not installed - -**/ -EFI_STATUS -EFIAPI -SmbiosTablePublishEntry ( - IN EFI_HANDLE ImageHandle, - IN EFI_SYSTEM_TABLE *SystemTable - ) -{ - EFI_STATUS Status; - UINT8 *SmbiosTables; - - Status =3D EFI_NOT_FOUND; - // - // Add QEMU SMBIOS data if found - // - SmbiosTables =3D GetQemuSmbiosTables (); - if (SmbiosTables !=3D NULL) { - Status =3D InstallAllStructures (SmbiosTables); - FreePool (SmbiosTables); - } - - return Status; -} diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.h index 74e314a895..b7bf004be9 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -22,4 +22,15 @@ InstallAllStructures ( IN UINT8 *TableAddress ); =20 +/** + Locates and extracts the QEMU SMBIOS data if present in fw_cfg + + @return Address of extracted QEMU SMBIOS data + +**/ +UINT8 * +GetQemuSmbiosTables ( + VOID + ); + #endif diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/Smbi= osPlatformDxe/SmbiosPlatformDxe.inf index eaee73110d..e239a631f2 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -24,6 +24,7 @@ # =20 [Sources] + EntryPoint.c Qemu.c SmbiosPlatformDxe.c SmbiosPlatformDxe.h --=20 2.30.2 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris,=20 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=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 (#84640): https://edk2.groups.io/g/devel/message/84640 Mute This Topic: https://groups.io/mt/87637058/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- From nobody Wed May 8 19:58:04 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+84641+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+84641+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1639147376; cv=none; d=zohomail.com; s=zohoarc; b=iHHjBpp4xfDSUR7lGsia1co+k3D8UBb81fEEW+TewKSe7Fm9rgZbU1rDKWU9QNQsFDPBeZL2J+eKIJucw4gp4qSS8n0sg/o2aGP0wHxCKYgz4A9p199mYdgzeNAEsHsfBe/FwAZMXI7jixJstZLWSHVooBcJUoiseUPevThRZLw= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639147376; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=gW1F3aSRiX8gAIU0ciQuP2JJZkzrR0vOD4DkAF17Gew=; b=n1Xt3H9PJeqRewGGbBFwMS/BY0oAZvUsacaNM1v/90tI5SN/BhvQ1rnsXDaYWIELVCcvZKF4QZw768Lmzcl7vywyfvMuzBLlbLHwgHZm5jflQzYuoOd3cURzUhVPCbrw+DhQTHj1OW98GuXiT5xwtJJzUBhK7UpIcFXKriqrYsM= 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+84641+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 16391473769241013.6857788441306; Fri, 10 Dec 2021 06:42:56 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id pnS4YY1788612xyiWsgak1Pg; Fri, 10 Dec 2021 06:42:56 -0800 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.7955.1639147375808804215 for ; Fri, 10 Dec 2021 06:42:56 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10193"; a="238299502" X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="238299502" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 06:42:32 -0800 X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="503951560" X-Received: from gmarti2-mobl1.amr.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.20.4]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 06:42:31 -0800 From: "Boeuf, Sebastien" To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [edk2-devel] [PATCH v7 3/5] OvmfPkg: Retrieve SMBIOS from Cloud Hypervisor Date: Fri, 10 Dec 2021 15:41:56 +0100 Message-Id: <293a4baf8b9fd4e81d3e4f9da257a8b52ddb4ea7.1639147041.git.sebastien.boeuf@intel.com> In-Reply-To: References: 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,sebastien.boeuf@intel.com X-Gm-Message-State: 0qccpYL3M6Eu5OvncF5GfaUEx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639147376; bh=eBU4bSeiKXIj7m9IQLnnCbF8WaNW3IKcV3DbFN9cqNQ=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=P0SPyZyi8s1ZIL9xBYOWcEgqgm4GzyfGUvrIwj0kuGvnCR6XRQr9uHliXqCkqTQcB2x Ce7J01DItf3Rhzg6PAjYceNE9YQ26kKNfX0Xuuek0MxDopa2XwnJ6ZuFbU/uFXYngNrF+ SgHq67cSMbtJc3nztcz/dixHWk1VBorobhg= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639147378313100001 Content-Type: text/plain; charset="utf-8" From: Sebastien Boeuf Add a fallback on the SMBIOS code to find the SMBIOS table for Cloud Hypervisor if it couldn't be found for Qemu through fw_cfg. Reviewed-by: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Rob Bradford Signed-off-by: Sebastien Boeuf --- OvmfPkg/Include/IndustryStandard/CloudHv.h | 5 +++ OvmfPkg/SmbiosPlatformDxe/CloudHv.c | 33 +++++++++++++++++++ OvmfPkg/SmbiosPlatformDxe/EntryPoint.c | 20 ++++++++--- OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h | 11 +++++++ .../SmbiosPlatformDxe/SmbiosPlatformDxe.inf | 2 ++ 5 files changed, 66 insertions(+), 5 deletions(-) create mode 100644 OvmfPkg/SmbiosPlatformDxe/CloudHv.c diff --git a/OvmfPkg/Include/IndustryStandard/CloudHv.h b/OvmfPkg/Include/I= ndustryStandard/CloudHv.h index 1155335690..d31ecc9eec 100644 --- a/OvmfPkg/Include/IndustryStandard/CloudHv.h +++ b/OvmfPkg/Include/IndustryStandard/CloudHv.h @@ -33,4 +33,9 @@ // #define CLOUDHV_MMIO_HOLE_SIZE 0x38000000 =20 +// +// SMBIOS address +// +#define CLOUDHV_SMBIOS_ADDRESS 0xf0000 + #endif // __CLOUDHV_H__ diff --git a/OvmfPkg/SmbiosPlatformDxe/CloudHv.c b/OvmfPkg/SmbiosPlatformDx= e/CloudHv.c new file mode 100644 index 0000000000..792e4ae981 --- /dev/null +++ b/OvmfPkg/SmbiosPlatformDxe/CloudHv.c @@ -0,0 +1,33 @@ +/** @file + Find Cloud Hypervisor SMBIOS data. + + SPDX-License-Identifier: BSD-2-Clause-Patent +**/ + +#include // CLOUDHV_SMBIOS_ADDRESS +#include // SMBIOS_TABLE_3_0_ENTRY_POINT + +/** + Locates and extracts Cloud Hypervisor SMBIOS data + + @return Address of extracted Cloud Hypervisor SMBIOS data + +**/ +UINT8 * +GetCloudHvSmbiosTables ( + VOID + ) +{ + SMBIOS_TABLE_3_0_ENTRY_POINT *CloudHvTables =3D (VOID *)CLOUDHV_SMBIOS_= ADDRESS; + + if ((CloudHvTables->AnchorString[0] =3D=3D '_') && + (CloudHvTables->AnchorString[1] =3D=3D 'S') && + (CloudHvTables->AnchorString[2] =3D=3D 'M') && + (CloudHvTables->AnchorString[3] =3D=3D '3') && + (CloudHvTables->AnchorString[4] =3D=3D '_')) + { + return (UINT8 *)(UINTN)CloudHvTables->TableAddress; + } + + return NULL; +} diff --git a/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c b/OvmfPkg/SmbiosPlatfor= mDxe/EntryPoint.c index f53af2b2e6..e55d135504 100644 --- a/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c +++ b/OvmfPkg/SmbiosPlatformDxe/EntryPoint.c @@ -5,6 +5,7 @@ **/ =20 #include // FreePool() +#include // CLOUDHV_DEVICE_ID =20 #include "SmbiosPlatformDxe.h" =20 @@ -27,15 +28,24 @@ SmbiosTablePublishEntry ( { EFI_STATUS Status; UINT8 *SmbiosTables; + UINT16 HostBridgeDevId; =20 Status =3D EFI_NOT_FOUND; // - // Add QEMU SMBIOS data if found + // Add SMBIOS data if found // - SmbiosTables =3D GetQemuSmbiosTables (); - if (SmbiosTables !=3D NULL) { - Status =3D InstallAllStructures (SmbiosTables); - FreePool (SmbiosTables); + HostBridgeDevId =3D PcdGet16 (PcdOvmfHostBridgePciDevId); + if (HostBridgeDevId =3D=3D CLOUDHV_DEVICE_ID) { + SmbiosTables =3D GetCloudHvSmbiosTables (); + if (SmbiosTables !=3D NULL) { + Status =3D InstallAllStructures (SmbiosTables); + } + } else { + SmbiosTables =3D GetQemuSmbiosTables (); + if (SmbiosTables !=3D NULL) { + Status =3D InstallAllStructures (SmbiosTables); + FreePool (SmbiosTables); + } } =20 return Status; diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h b/OvmfPkg/Smbios= PlatformDxe/SmbiosPlatformDxe.h index b7bf004be9..709e096e7b 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.h @@ -33,4 +33,15 @@ GetQemuSmbiosTables ( VOID ); =20 +/** + Locates and extracts Cloud Hypervisor SMBIOS data + + @return Address of extracted Cloud Hypervisor SMBIOS data + +**/ +UINT8 * +GetCloudHvSmbiosTables ( + VOID + ); + #endif diff --git a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf b/OvmfPkg/Smbi= osPlatformDxe/SmbiosPlatformDxe.inf index e239a631f2..0066bbc922 100644 --- a/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf +++ b/OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf @@ -24,6 +24,7 @@ # =20 [Sources] + CloudHv.c EntryPoint.c Qemu.c SmbiosPlatformDxe.c @@ -42,6 +43,7 @@ UefiDriverEntryPoint =20 [Pcd] + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId gUefiOvmfPkgTokenSpaceGuid.PcdQemuSmbiosValidated =20 [Protocols] --=20 2.30.2 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris,=20 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=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 (#84641): https://edk2.groups.io/g/devel/message/84641 Mute This Topic: https://groups.io/mt/87637066/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- From nobody Wed May 8 19:58:04 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+84642+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+84642+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1639147377; cv=none; d=zohomail.com; s=zohoarc; b=T1SsE5m5D34vIV8C8J88bvRQvhSpyIENPo91vqH2ybi8Yky9qhUmS0UY/8NxoA/n36B73tLnjxRW+Cv4ykU3Z2aBSZAkA6yHozPrDc8szWh45ND5/hZIcf5CtmiVnflpJ8xQMo2WFGbqWzOAn4NfoscJbsguE1FJWFaDZ1IzIls= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639147377; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=4iwoK0W8Mg2tE1dYZBjFnP7R3t0m7/LpCegESwaCi3o=; b=Yq7JBn6NN3VjR9+kaXqLRVxPTQz5fKhRiZgAjbeXoVpLM0n79G/2vrOaq+xFPfa8GAXy26Qp5xo6A2EJcVyLnbfFlo4dFzpbwqpY2CMGxDHEJU9RMFhpxLG9CcpPgf9Enp0YRkyEBvN08lDtkk2942fRYzv2nQRts6SyMcur1QI= 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+84642+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 1639147377542425.3539185067352; Fri, 10 Dec 2021 06:42:57 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id 3VQKYY1788612xlBYrL8M0IS; Fri, 10 Dec 2021 06:42:57 -0800 X-Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) by mx.groups.io with SMTP id smtpd.web12.7955.1639147375808804215 for ; Fri, 10 Dec 2021 06:42:56 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10193"; a="238299520" X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="238299520" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 06:42:39 -0800 X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="503951589" X-Received: from gmarti2-mobl1.amr.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.20.4]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 06:42:37 -0800 From: "Boeuf, Sebastien" To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [edk2-devel] [PATCH v7 4/5] OvmfPkg: Generalize AcpiPlatformDxe Date: Fri, 10 Dec 2021 15:41:57 +0100 Message-Id: <5f0a9ba5a598bd979fc8e6d7ebbaf4d00eebb452.1639147041.git.sebastien.boeuf@intel.com> In-Reply-To: References: 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,sebastien.boeuf@intel.com X-Gm-Message-State: AMNcZVPpWVLAHWMZqELOX6H6x1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639147377; bh=TagHgJCLD/XJUVYtiQih+ujS2ko1Pv3GPDwpTF18lf0=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=uH0T7j/r6OR6QnwLouUadMnrJNokh+tMsk7+BI+wSj2MgT3ITK6SqC/IiDZ+dBwehfI Wg7+bYkrriq+sjGZjPkWuCc8X15DbdcQnxHaPG7eaQLpi/b4jQLtGttw6TRORGRVn8DzV gCbRBPlqDYnfUQ/t2m4B4DI9TLiT8vyIjLY= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639147378453100003 Content-Type: text/plain; charset="utf-8" From: Sebastien Boeuf Don't make the package Qemu centric so that we can introduce some alternative support for other VMMs not using the fw_cfg mechanism. This patch is purely about renaming existing files with no functional change. Reviewed-by: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Sebastien Boeuf --- ArmVirtPkg/ArmVirtQemu.dsc | 2 +- ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc | 2 +- ArmVirtPkg/ArmVirtQemuKernel.dsc | 2 +- .../{QemuFwCfgAcpiPlatform.c =3D> AcpiPlatform.c} | 4 ++-- .../{QemuFwCfgAcpiPlatformDxe.inf =3D> AcpiPlatformDxe.inf} | 4 ++-- OvmfPkg/AmdSev/AmdSevX64.dsc | 2 +- OvmfPkg/AmdSev/AmdSevX64.fdf | 2 +- OvmfPkg/Microvm/MicrovmX64.dsc | 2 +- OvmfPkg/Microvm/MicrovmX64.fdf | 2 +- OvmfPkg/OvmfPkgIa32.dsc | 2 +- OvmfPkg/OvmfPkgIa32.fdf | 2 +- OvmfPkg/OvmfPkgIa32X64.dsc | 2 +- OvmfPkg/OvmfPkgIa32X64.fdf | 2 +- OvmfPkg/OvmfPkgX64.dsc | 2 +- OvmfPkg/OvmfPkgX64.fdf | 2 +- 15 files changed, 17 insertions(+), 17 deletions(-) rename OvmfPkg/AcpiPlatformDxe/{QemuFwCfgAcpiPlatform.c =3D> AcpiPlatform.= c} (77%) rename OvmfPkg/AcpiPlatformDxe/{QemuFwCfgAcpiPlatformDxe.inf =3D> AcpiPlat= formDxe.inf} (90%) diff --git a/ArmVirtPkg/ArmVirtQemu.dsc b/ArmVirtPkg/ArmVirtQemu.dsc index 891e065311..84c28b0c1d 100644 --- a/ArmVirtPkg/ArmVirtQemu.dsc +++ b/ArmVirtPkg/ArmVirtQemu.dsc @@ -543,7 +543,7 @@ ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf [Components.AARCH64] MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf { + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf { NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf } diff --git a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc b/ArmVirtPkg/ArmVirtQemuF= vMain.fdf.inc index f6a538df72..d4df6dede0 100644 --- a/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc +++ b/ArmVirtPkg/ArmVirtQemuFvMain.fdf.inc @@ -145,7 +145,7 @@ READ_LOCK_STATUS =3D TRUE !if $(ARCH) =3D=3D AARCH64 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphic= sResourceTableDxe.inf - INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf + INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf =20 # # EBC support diff --git a/ArmVirtPkg/ArmVirtQemuKernel.dsc b/ArmVirtPkg/ArmVirtQemuKerne= l.dsc index a8bb83b288..8e82c5050f 100644 --- a/ArmVirtPkg/ArmVirtQemuKernel.dsc +++ b/ArmVirtPkg/ArmVirtQemuKernel.dsc @@ -458,7 +458,7 @@ ArmVirtPkg/PlatformHasAcpiDtDxe/PlatformHasAcpiDtDxe.inf [Components.AARCH64] MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf { + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf { NULL|OvmfPkg/Fdt/FdtPciPcdProducerLib/FdtPciPcdProducerLib.inf } diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatform.c b/OvmfPkg/Acpi= PlatformDxe/AcpiPlatform.c similarity index 77% rename from OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatform.c rename to OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c index aff1ad0c97..274db28685 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatform.c +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c @@ -1,5 +1,5 @@ /** @file - OVMF ACPI Platform Driver using QEMU's fw-cfg interface + OVMF ACPI Platform Driver =20 Copyright (C) 2015, Red Hat, Inc. Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
@@ -10,7 +10,7 @@ #include "AcpiPlatform.h" =20 /** - Effective entrypoint of QEMU fw-cfg Acpi Platform driver. + Effective entrypoint of Acpi Platform driver. =20 @param ImageHandle @param SystemTable diff --git a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf b/OvmfPkg= /AcpiPlatformDxe/AcpiPlatformDxe.inf similarity index 90% rename from OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf rename to OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf index dac25d1505..eedd3b5af3 100644 --- a/OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -1,5 +1,5 @@ ## @file -# OVMF ACPI Platform Driver using QEMU's fw-cfg interface +# OVMF ACPI Platform Driver # # Copyright (c) 2008 - 2014, Intel Corporation. All rights reserved.
# SPDX-License-Identifier: BSD-2-Clause-Patent @@ -21,12 +21,12 @@ # =20 [Sources] + AcpiPlatform.c AcpiPlatform.h BootScript.c EntryPoint.c PciDecoding.c QemuFwCfgAcpi.c - QemuFwCfgAcpiPlatform.c =20 [Packages] MdeModulePkg/MdeModulePkg.dec diff --git a/OvmfPkg/AmdSev/AmdSevX64.dsc b/OvmfPkg/AmdSev/AmdSevX64.dsc index 96c98983d9..7e7139af69 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.dsc +++ b/OvmfPkg/AmdSev/AmdSevX64.dsc @@ -775,7 +775,7 @@ # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf =20 # diff --git a/OvmfPkg/AmdSev/AmdSevX64.fdf b/OvmfPkg/AmdSev/AmdSevX64.fdf index 5a84393b00..b25035c164 100644 --- a/OvmfPkg/AmdSev/AmdSevX64.fdf +++ b/OvmfPkg/AmdSev/AmdSevX64.fdf @@ -270,7 +270,7 @@ INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf -INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf =20 INF FatPkg/EnhancedFatDxe/Fat.inf diff --git a/OvmfPkg/Microvm/MicrovmX64.dsc b/OvmfPkg/Microvm/MicrovmX64.dsc index a8c975a6bd..717ad52733 100644 --- a/OvmfPkg/Microvm/MicrovmX64.dsc +++ b/OvmfPkg/Microvm/MicrovmX64.dsc @@ -750,7 +750,7 @@ # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf diff --git a/OvmfPkg/Microvm/MicrovmX64.fdf b/OvmfPkg/Microvm/MicrovmX64.fdf index b6f0807688..4570bc866c 100644 --- a/OvmfPkg/Microvm/MicrovmX64.fdf +++ b/OvmfPkg/Microvm/MicrovmX64.fdf @@ -267,7 +267,7 @@ INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf -INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf diff --git a/OvmfPkg/OvmfPkgIa32.dsc b/OvmfPkg/OvmfPkgIa32.dsc index 494e03a7d1..40fc695714 100644 --- a/OvmfPkg/OvmfPkgIa32.dsc +++ b/OvmfPkg/OvmfPkgIa32.dsc @@ -873,7 +873,7 @@ # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf diff --git a/OvmfPkg/OvmfPkgIa32.fdf b/OvmfPkg/OvmfPkgIa32.fdf index c30e528187..cc73180729 100644 --- a/OvmfPkg/OvmfPkgIa32.fdf +++ b/OvmfPkg/OvmfPkgIa32.fdf @@ -280,7 +280,7 @@ INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf -INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.dsc b/OvmfPkg/OvmfPkgIa32X64.dsc index e8f944a710..fd5153ff48 100644 --- a/OvmfPkg/OvmfPkgIa32X64.dsc +++ b/OvmfPkg/OvmfPkgIa32X64.dsc @@ -887,7 +887,7 @@ # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf diff --git a/OvmfPkg/OvmfPkgIa32X64.fdf b/OvmfPkg/OvmfPkgIa32X64.fdf index 78a01b6663..ad4b1590fa 100644 --- a/OvmfPkg/OvmfPkgIa32X64.fdf +++ b/OvmfPkg/OvmfPkgIa32X64.fdf @@ -284,7 +284,7 @@ INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf -INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf diff --git a/OvmfPkg/OvmfPkgX64.dsc b/OvmfPkg/OvmfPkgX64.dsc index 8dcb82d931..ab4b3f66a3 100644 --- a/OvmfPkg/OvmfPkgX64.dsc +++ b/OvmfPkg/OvmfPkgX64.dsc @@ -884,7 +884,7 @@ # ACPI Support # MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf - OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorDxe.= inf MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphicsRes= ourceTableDxe.inf diff --git a/OvmfPkg/OvmfPkgX64.fdf b/OvmfPkg/OvmfPkgX64.fdf index a4accaaff4..1420ae8802 100644 --- a/OvmfPkg/OvmfPkgX64.fdf +++ b/OvmfPkg/OvmfPkgX64.fdf @@ -306,7 +306,7 @@ INF MdeModulePkg/Universal/SmbiosDxe/SmbiosDxe.inf INF OvmfPkg/SmbiosPlatformDxe/SmbiosPlatformDxe.inf =20 INF MdeModulePkg/Universal/Acpi/AcpiTableDxe/AcpiTableDxe.inf -INF OvmfPkg/AcpiPlatformDxe/QemuFwCfgAcpiPlatformDxe.inf +INF OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf INF MdeModulePkg/Universal/Acpi/S3SaveStateDxe/S3SaveStateDxe.inf INF MdeModulePkg/Universal/Acpi/BootScriptExecutorDxe/BootScriptExecutorD= xe.inf INF MdeModulePkg/Universal/Acpi/BootGraphicsResourceTableDxe/BootGraphics= ResourceTableDxe.inf --=20 2.30.2 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris,=20 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=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 (#84642): https://edk2.groups.io/g/devel/message/84642 Mute This Topic: https://groups.io/mt/87637067/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- From nobody Wed May 8 19:58:04 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+84643+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+84643+1787277+3901457@groups.io; dmarc=fail(p=none dis=none) header.from=intel.com ARC-Seal: i=1; a=rsa-sha256; t=1639147380; cv=none; d=zohomail.com; s=zohoarc; b=hSHJGgMad0xLCHJ79DTauQIgn3rvrVVpDHnaYg/EjPY1zUxt0t3B1g5URqquvv5PkCUaASgmwxq5WXPPWedtpPhUhmOz4qPIoH4diqo/+8LJxhPVxXiLIAiSaX1arjJUb3oTvUuiau5+dHFfad50xBMp+H/szFuEsdpURQk+q7s= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1639147380; h=Content-Type:Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Id:List-Help:List-Unsubscribe:MIME-Version:Message-ID:Reply-To:References:Sender:Subject:To; bh=zBB519encxQzGUqnvNQIrwSGQghbt85ir8voV14OPF4=; b=CoNfyl2U9u1wP+Nu/dDfvM0yTiEV54/bdIMGzFbf6jkurZeJ2YJL4wzwW4YdC/6y1KHC63fZpAqr+5YJQtcthN7zW0UcMqfTBe/ydJ8aHWDSOIg+5dppmv/Y47EIkbx0+GuaT5pC93/R4IWNptsncXMJRs4DYks9d8DpzCJGRBs= 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+84643+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 1639147380354885.7009691721173; Fri, 10 Dec 2021 06:43:00 -0800 (PST) Return-Path: X-Received: by 127.0.0.2 with SMTP id f4zIYY1788612xX4JzJHxDGN; Fri, 10 Dec 2021 06:43:00 -0800 X-Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by mx.groups.io with SMTP id smtpd.web10.8091.1639147379401615767 for ; Fri, 10 Dec 2021 06:42:59 -0800 X-IronPort-AV: E=McAfee;i="6200,9189,10193"; a="262466384" X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="262466384" X-Received: from orsmga007.jf.intel.com ([10.7.209.58]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 06:42:47 -0800 X-IronPort-AV: E=Sophos;i="5.88,195,1635231600"; d="scan'208";a="503951643" X-Received: from gmarti2-mobl1.amr.corp.intel.com (HELO sboeuf-mobl.home) ([10.252.20.4]) by orsmga007-auth.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 10 Dec 2021 06:42:45 -0800 From: "Boeuf, Sebastien" To: devel@edk2.groups.io Cc: jiewen.yao@intel.com, jordan.l.justen@intel.com, kraxel@redhat.com, sebastien.boeuf@intel.com Subject: [edk2-devel] [PATCH v7 5/5] OvmfPkg: Install ACPI tables for Cloud Hypervisor Date: Fri, 10 Dec 2021 15:41:58 +0100 Message-Id: In-Reply-To: References: 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,sebastien.boeuf@intel.com X-Gm-Message-State: 2NuYBVUuHcFb9EKrso09LJEOx1787277AA= Content-Transfer-Encoding: quoted-printable DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=groups.io; q=dns/txt; s=20140610; t=1639147380; bh=XZGY4QX/io5mEAc5OJYlPEAyxXp6Rgovpm8gC+EJ1dg=; h=Cc:Content-Type:Date:From:Reply-To:Subject:To; b=qzEPfhVJEY73i7+vgpwhiJKRy763sEuc9V6cLhxdYsdIwef1FCuRMeYHdTS6VXCXC1S FEUDjYhJASRzMiHxw6TeJqHNhdmv0AYw/27XeL2C0W3Syuv2HJxwEMNOYmmsadaGkS56y l0aVXwpSl/T281jx7xp87CnGkZc+xE8Kdf8= X-ZohoMail-DKIM: pass (identity @groups.io) X-ZM-MESSAGEID: 1639147381019100001 Content-Type: text/plain; charset="utf-8" From: Sebastien Boeuf Adding support for retrieving the Cloud Hypervisor ACPI tables as a fallback mechanism if tables are not found through fw_cfg. Reviewed-by: Gerd Hoffmann Reviewed-by: Jiewen Yao Signed-off-by: Rob Bradford Signed-off-by: Sebastien Boeuf --- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c | 11 +- OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h | 6 + OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf | 2 + OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c | 118 ++++++++++++++++++++ OvmfPkg/Include/IndustryStandard/CloudHv.h | 5 + 5 files changed, 141 insertions(+), 1 deletion(-) create mode 100644 OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.c index 274db28685..fcfb9703bd 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.c @@ -7,6 +7,8 @@ SPDX-License-Identifier: BSD-2-Clause-Patent **/ =20 +#include // CLOUDHV_DEVICE_ID + #include "AcpiPlatform.h" =20 /** @@ -27,7 +29,14 @@ InstallAcpiTables ( ) { EFI_STATUS Status; + UINT16 HostBridgeDevId; + + HostBridgeDevId =3D PcdGet16 (PcdOvmfHostBridgePciDevId); + if (HostBridgeDevId =3D=3D CLOUDHV_DEVICE_ID) { + Status =3D InstallCloudHvTables (AcpiTable); + } else { + Status =3D InstallQemuFwCfgTables (AcpiTable); + } =20 - Status =3D InstallQemuFwCfgTables (AcpiTable); return Status; } diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h b/OvmfPkg/AcpiPlatformD= xe/AcpiPlatform.h index 1ccca0a368..342339750d 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatform.h @@ -19,6 +19,12 @@ typedef struct { =20 typedef struct S3_CONTEXT S3_CONTEXT; =20 +EFI_STATUS +EFIAPI +InstallCloudHvTables ( + IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol + ); + EFI_STATUS EFIAPI InstallQemuFwCfgTables ( diff --git a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf b/OvmfPkg/AcpiPlat= formDxe/AcpiPlatformDxe.inf index eedd3b5af3..b36b8413e0 100644 --- a/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf +++ b/OvmfPkg/AcpiPlatformDxe/AcpiPlatformDxe.inf @@ -24,6 +24,7 @@ AcpiPlatform.c AcpiPlatform.h BootScript.c + CloudHvAcpi.c EntryPoint.c PciDecoding.c QemuFwCfgAcpi.c @@ -54,6 +55,7 @@ =20 [Pcd] gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration + gUefiOvmfPkgTokenSpaceGuid.PcdOvmfHostBridgePciDevId =20 [Depex] gEfiAcpiTableProtocolGuid diff --git a/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c b/OvmfPkg/AcpiPlatformDx= e/CloudHvAcpi.c new file mode 100644 index 0000000000..44a6bb70fe --- /dev/null +++ b/OvmfPkg/AcpiPlatformDxe/CloudHvAcpi.c @@ -0,0 +1,118 @@ +/** @file + OVMF ACPI Cloud Hypervisor support + + Copyright (c) 2021, Intel Corporation. All rights reserved. + + SPDX-License-Identifier: BSD-2-Clause-Patent + +**/ + +#include // CLOUDHV_RSDP_ADDRESS +#include // CpuDeadLoop() +#include // DEBUG() + +#include "AcpiPlatform.h" + +// Get the ACPI tables from EBDA start +EFI_STATUS +EFIAPI +InstallCloudHvTables ( + IN EFI_ACPI_TABLE_PROTOCOL *AcpiProtocol + ) +{ + EFI_STATUS Status; + UINTN TableHandle; + + EFI_ACPI_DESCRIPTION_HEADER *Xsdt; + VOID *CurrentTableEntry; + UINTN CurrentTablePointer; + EFI_ACPI_DESCRIPTION_HEADER *CurrentTable; + UINTN Index; + UINTN NumberOfTableEntries; + EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *Fadt2Table; + EFI_ACPI_DESCRIPTION_HEADER *DsdtTable; + + Fadt2Table =3D NULL; + DsdtTable =3D NULL; + TableHandle =3D 0; + NumberOfTableEntries =3D 0; + EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_POINTER *AcpiRsdpStructurePtr =3D = (VOID *)CLOUDHV_RSDP_ADDRESS; + + // If XSDT table is found, just install its tables. + // Otherwise, try to find and install the RSDT tables. + // + if (AcpiRsdpStructurePtr->XsdtAddress) { + // + // Retrieve the addresses of XSDT and + // calculate the number of its table entries. + // + Xsdt =3D (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN) + AcpiRsdpStructurePtr->XsdtAddress; + NumberOfTableEntries =3D (Xsdt->Length - + sizeof (EFI_ACPI_DESCRIPTION_HEADER)) / + sizeof (UINT64); + + // + // Install ACPI tables found in XSDT. + // + for (Index =3D 0; Index < NumberOfTableEntries; Index++) { + // + // Get the table entry from XSDT + // + CurrentTableEntry =3D (VOID *)((UINT8 *)Xsdt + + sizeof (EFI_ACPI_DESCRIPTION_HEADER) + + Index * sizeof (UINT64)); + CurrentTablePointer =3D (UINTN)*(UINT64 *)CurrentTableEntry; + CurrentTable =3D (EFI_ACPI_DESCRIPTION_HEADER *)CurrentTableP= ointer; + + // + // Install the XSDT tables + // + Status =3D AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + CurrentTable, + CurrentTable->Length, + &TableHandle + ); + + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + // + // Get the X-DSDT table address from the table FADT + // + if (!AsciiStrnCmp ((CHAR8 *)&CurrentTable->Signature, "FACP", 4)) { + Fadt2Table =3D (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE *) + (UINTN)CurrentTablePointer; + DsdtTable =3D (EFI_ACPI_DESCRIPTION_HEADER *)(UINTN)Fadt2Table->XD= sdt; + } + } + } else { + return EFI_NOT_FOUND; + } + + // + // Install DSDT table. If we reached this point without finding the DSDT, + // then we're out of sync with the hypervisor, and cannot continue. + // + if (DsdtTable =3D=3D NULL) { + DEBUG ((DEBUG_ERROR, "%a: no DSDT found\n", __FUNCTION__)); + ASSERT (FALSE); + CpuDeadLoop (); + } + + Status =3D AcpiProtocol->InstallAcpiTable ( + AcpiProtocol, + DsdtTable, + DsdtTable->Length, + &TableHandle + ); + if (EFI_ERROR (Status)) { + ASSERT_EFI_ERROR (Status); + return Status; + } + + return EFI_SUCCESS; +} diff --git a/OvmfPkg/Include/IndustryStandard/CloudHv.h b/OvmfPkg/Include/I= ndustryStandard/CloudHv.h index d31ecc9eec..86404cc97e 100644 --- a/OvmfPkg/Include/IndustryStandard/CloudHv.h +++ b/OvmfPkg/Include/IndustryStandard/CloudHv.h @@ -38,4 +38,9 @@ // #define CLOUDHV_SMBIOS_ADDRESS 0xf0000 =20 +// +// RSDP address +// +#define CLOUDHV_RSDP_ADDRESS 0xa0000 + #endif // __CLOUDHV_H__ --=20 2.30.2 --------------------------------------------------------------------- Intel Corporation SAS (French simplified joint stock company) Registered headquarters: "Les Montalets"- 2, rue de Paris,=20 92196 Meudon Cedex, France Registration Number: 302 456 199 R.C.S. NANTERRE Capital: 4,572,000 Euros This e-mail and any attachments may contain confidential material for the sole use of the intended recipient(s). Any review or distribution by others is strictly prohibited. If you are not the intended recipient, please contact the sender and delete all copies. -=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 (#84643): https://edk2.groups.io/g/devel/message/84643 Mute This Topic: https://groups.io/mt/87637068/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-