Skip to content

Commit 0e464f7

Browse files
committed
pci: fix PCI resource reserve capability on BE
PCI resource reserve capability should use LE format as all other PCI things. If we don't then seabios won't boot: === PCI new allocation pass #1 === PCI: check devices PCI: QEMU resource reserve cap: size 10000000000000 type io PCI: secondary bus 1 size 10000000000000 type io PCI: secondary bus 1 size 00200000 type mem PCI: secondary bus 1 size 00200000 type prefmem === PCI new allocation pass #2 === PCI: out of I/O address space This became more important since we started reserving IO by default, previously no one noticed. Fixes: e2a6290 ("hw/pcie-root-port: Fix hotplug for PCI devices requiring IO") Cc: [email protected] Fixes: 226263f ("hw/pci: add QEMU-specific PCI capability to the Generic PCI Express Root Port") Cc: [email protected] Fixes: 6755e61 ("hw/pci: add PCI resource reserve capability to legacy PCI bridge") Cc: [email protected] Tested-by: Thomas Huth <[email protected]> Signed-off-by: Michael S. Tsirkin <[email protected]> Reviewed-by: Philippe Mathieu-Daudé <[email protected]>
1 parent 4023784 commit 0e464f7

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

hw/pci/pci_bridge.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -448,11 +448,11 @@ int pci_bridge_qemu_reserve_cap_init(PCIDevice *dev, int cap_offset,
448448
PCIBridgeQemuCap cap = {
449449
.len = cap_len,
450450
.type = REDHAT_PCI_CAP_RESOURCE_RESERVE,
451-
.bus_res = res_reserve.bus,
452-
.io = res_reserve.io,
453-
.mem = res_reserve.mem_non_pref,
454-
.mem_pref_32 = res_reserve.mem_pref_32,
455-
.mem_pref_64 = res_reserve.mem_pref_64
451+
.bus_res = cpu_to_le32(res_reserve.bus),
452+
.io = cpu_to_le64(res_reserve.io),
453+
.mem = cpu_to_le32(res_reserve.mem_non_pref),
454+
.mem_pref_32 = cpu_to_le32(res_reserve.mem_pref_32),
455+
.mem_pref_64 = cpu_to_le64(res_reserve.mem_pref_64)
456456
};
457457

458458
int offset = pci_add_capability(dev, PCI_CAP_ID_VNDR,

0 commit comments

Comments
 (0)