From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: citrix.com, ip: 162.221.156.55, mailfrom: prvs=99536ed25=anthony.perard@citrix.com) Received: from SMTP03.CITRIX.COM (SMTP03.CITRIX.COM [162.221.156.55]) by groups.io with SMTP; Tue, 09 Apr 2019 04:27:37 -0700 X-IronPort-AV: E=Sophos;i="5.60,329,1549929600"; d="scan'208";a="83096397" From: "Anthony PERARD" To: CC: Jordan Justen , Laszlo Ersek , Ard Biesheuvel , Julien Grall , , Anthony PERARD Subject: [PATCH v2 24/31] OvmfPkg/XenPlatformPei: Ignore missing PCI Host Bridge on Xen PVH Date: Tue, 9 Apr 2019 12:08:37 +0100 Message-ID: <20190409110844.14746-25-anthony.perard@citrix.com> X-Mailer: git-send-email 2.21.0 In-Reply-To: <20190409110844.14746-1-anthony.perard@citrix.com> References: <20190409110844.14746-1-anthony.perard@citrix.com> MIME-Version: 1.0 Return-Path: anthony.perard@citrix.com Content-Transfer-Encoding: 8bit Content-Type: text/plain When the device ID of the host bridge is unknown, check if we are running as a PVH guest as there is no PCI bus in that case. Contributed-under: TianoCore Contribution Agreement 1.1 Signed-off-by: Anthony PERARD --- Notes: v2: - Use new XEN_PVH_PCI_HOST_BRIDGE_DEVICE_ID macro OvmfPkg/Include/OvmfPlatforms.h | 6 ++++++ OvmfPkg/XenPlatformPei/Platform.c | 7 +++++++ 2 files changed, 13 insertions(+) diff --git a/OvmfPkg/Include/OvmfPlatforms.h b/OvmfPkg/Include/OvmfPlatforms.h index cc67f40a88..1ce71e18ec 100644 --- a/OvmfPkg/Include/OvmfPlatforms.h +++ b/OvmfPkg/Include/OvmfPlatforms.h @@ -43,4 +43,10 @@ // #define ACPI_TIMER_OFFSET 0x8 +// +// When running OVMF on a Xen PVH guest there is no PCI, +// so -1 is return for the Host Bridge Device ID. +// +#define XEN_PVH_PCI_HOST_BRIDGE_DEVICE_ID 0xFFFF + #endif diff --git a/OvmfPkg/XenPlatformPei/Platform.c b/OvmfPkg/XenPlatformPei/Platform.c index 5e6d553ad5..d91cd98bf4 100644 --- a/OvmfPkg/XenPlatformPei/Platform.c +++ b/OvmfPkg/XenPlatformPei/Platform.c @@ -278,6 +278,13 @@ MiscInitialization ( AcpiEnBit = ICH9_ACPI_CNTL_ACPI_EN; break; default: + if (XenPvhDetected ()) { + // + // There is no PCI bus in this case + // + PcdSet16S (PcdOvmfHostBridgePciDevId, XEN_PVH_PCI_HOST_BRIDGE_DEVICE_ID); + return; + } DEBUG ((EFI_D_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n", __FUNCTION__, mHostBridgeDevId)); ASSERT (FALSE); -- Anthony PERARD