[edk2-devel] [PATCH v3 29/35] OvmfPkg/PlatformBootManagerLib: Handle the absence of PCI bus on Xen PVH

Anthony PERARD posted 35 patches 5 years, 4 months ago
There is a newer version of this series
[edk2-devel] [PATCH v3 29/35] OvmfPkg/PlatformBootManagerLib: Handle the absence of PCI bus on Xen PVH
Posted by Anthony PERARD 5 years, 4 months ago
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>
---

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(+)

diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
index e32969e63e..9ae590293a 100644
--- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
+++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
@@ -1209,6 +1209,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);

-- 
Anthony PERARD


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43311): https://edk2.groups.io/g/devel/message/43311
Mute This Topic: https://groups.io/mt/32308735/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [PATCH v3 29/35] OvmfPkg/PlatformBootManagerLib: Handle the absence of PCI bus on Xen PVH
Posted by Laszlo Ersek 5 years, 4 months ago
On 07/04/19 16:42, 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.)
> 
> Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=1689
> Signed-off-by: Anthony PERARD <anthony.perard@citrix.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(+)
> 
> diff --git a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
> index e32969e63e..9ae590293a 100644
> --- a/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
> +++ b/OvmfPkg/Library/PlatformBootManagerLib/BdsPlatform.c
> @@ -1209,6 +1209,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);
> 

Reviewed-by: Laszlo Ersek <lersek@redhat.com>

-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#43472): https://edk2.groups.io/g/devel/message/43472
Mute This Topic: https://groups.io/mt/32308735/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-