summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2023-06-26 12:38:19 +0200
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2023-06-26 11:08:31 +0000
commit638dfb4135441347f4bb8f242b4003a4e4395456 (patch)
treea0d74a182f47291d651927eef710dc8e2d37e90e
parent5542e528cd2710f521e8bf5dd4efd5adbdf86b71 (diff)
downloadedk2-638dfb4135441347f4bb8f242b4003a4e4395456.tar.gz
edk2-638dfb4135441347f4bb8f242b4003a4e4395456.tar.bz2
edk2-638dfb4135441347f4bb8f242b4003a4e4395456.zip
OvmfPkg/PciHotPlugInitDxe: fix io window size
Smallest IO window size for PCI bridges is 0x1000. Fix default size accordingly. Avoids broken resource assignments like this: [ ... ] PciBus: Resource Map for Root Bridge PciRoot(0x0) Type = Io16; Base = 0x6000; Length = 0x7000; Alignment = 0xFFF [ ... ] Base = 0xC000; Length = 0x200; Alignment = 0xFFF; Owner = PPB [00|02|00:**] Base = 0xC200; Length = 0x40; Alignment = 0x3F; Owner = PCI [00|1F|03:20] Base = 0xC240; Length = 0x20; Alignment = 0x1F; Owner = PCI [00|1F|02:20] [ ... ] ... which the linux kernel fixes up later: [ 0.644657] pci 0000:00:1f.3: BAR 4: assigned [io 0x1000-0x103f] [ 0.646833] pci 0000:00:1f.2: BAR 4: assigned [io 0x1040-0x105f] With the patch applied: { ... ] PciBus: Resource Map for Root Bridge PciRoot(0x0) Type = Io16; Base = 0x6000; Length = 0x8000; Alignment = 0xFFF [ ... ] Base = 0xC000; Length = 0x1000; Alignment = 0xFFF; Owner = PPB [00|02|00:**] Base = 0xD000; Length = 0x40; Alignment = 0x3F; Owner = PCI [00|1F|03:20] Base = 0xD040; Length = 0x20; Alignment = 0x1F; Owner = PCI [00|1F|02:20] [ ... ] Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
-rw-r--r--OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c b/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c
index 69903a6009..bb2389d16c 100644
--- a/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c
+++ b/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.c
@@ -741,7 +741,7 @@ GetResourcePadding (
//
// Request defaults.
//
- SetIoPadding (--FirstResource, (UINTN)HighBitSetRoundUp64 (512));
+ SetIoPadding (--FirstResource, (UINTN)HighBitSetRoundUp64 (0x1000));
}
if (DefaultMmio) {