OvmfPkg/Microvm/pcie: mPhysMemAddressWidth tweak

microvm places the 64bit mmio space at the end of the physical address
space.  So mPhysMemAddressWidth must be correct, otherwise the pci host
bridge setup throws an error because it thinks the 64bit mmio window is
not addressable.

On microvm we can simply use standard cpuid to figure the address width
because the host-phys-bits option (-cpu ${name},host-phys-bits=on) is
forced to be enabled.  Side note: For 'pc' and 'q35' this is not the
case for backward compatibility reasons.

Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
This commit is contained in:
Gerd Hoffmann
2022-06-02 10:42:15 +02:00
committed by mergify[bot]
parent ad3bafa7d5
commit bd10d4e201
2 changed files with 42 additions and 1 deletions

View File

@@ -357,12 +357,12 @@ InitializePlatform (
S3Verification ();
BootModeInitialization (&mPlatformInfoHob);
AddressWidthInitialization (&mPlatformInfoHob);
//
// Query Host Bridge DID
//
mPlatformInfoHob.HostBridgeDevId = PciRead16 (OVMF_HOSTBRIDGE_DID);
AddressWidthInitialization (&mPlatformInfoHob);
MaxCpuCountInitialization (&mPlatformInfoHob);