diff mbox series

[v4,28/35] OvmfPkg/PlatformBootManagerLib: Handle the absence of PCI bus on Xen PVH

Message ID 20190729153944.24239-29-anthony.perard@citrix.com (mailing list archive)
State Superseded
Headers show
Series Specific platform to run OVMF in Xen PVH and HVM guests | expand

Commit Message

Anthony PERARD July 29, 2019, 3:39 p.m. UTC
When running in a Xen PVH guest, there's nothing to do in
PciAcpiInitialization() because there isn't any PCI bus. When the Host
Bridge DID isn't recognised, simply continue. (The value of
PcdOvmfHostBridgePciDevId would be 0 because it isn't set.)

Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689
Signed-off-by: Anthony PERARD <anthony.perard@citrix.com>
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
---

Notes:
    v3:
    - Instead of checking for a false value,
      XEN_PVH_PCI_HOST_BRIDGE_DEVICE_ID, simply check if we are running xen
      when the HostBridge device ID isn't recognised.

 OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c | 6 ++++++
 1 file changed, 6 insertions(+)

Comments

Roger Pau Monné Aug. 7, 2019, 3:50 p.m. UTC | #1
On Mon, Jul 29, 2019 at 04:39:37PM +0100, Anthony PERARD wrote:
> When running in a Xen PVH guest, there's nothing to do in
> PciAcpiInitialization() because there isn't any PCI bus. When the Host
> Bridge DID isn't recognised, simply continue. (The value of
> PcdOvmfHostBridgePciDevId would be 0 because it isn't set.)

I guess we will need to figure out how to make OVMF happy when
passthrough support is added to PVH. Having to fake a bridge is quite
cumbersome, but I assume OVMF only pokes at some specific bridge
registers which we might be able to emulate without much fuss.

Thanks, Roger.
diff mbox series

Patch

diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index d5d5d20fd8..1eba304f09 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -1208,6 +1208,12 @@  PciAcpiInitialization (
       PciWrite8 (PCI_LIB_ADDRESS (0, 0x1f, 0, 0x6b), 0x0b); // H
       break;
     default:
+      if (XenDetected ()) {
+        //
+        // There is no PCI bus in this case.
+        //
+        return;
+      }
       DEBUG ((EFI_D_ERROR, "%a: Unknown Host Bridge Device ID: 0x%04x\n",
         __FUNCTION__, mHostBridgeDevId));
       ASSERT (FALSE);