Commit 794798e3 authored by Anthony PERARD's avatar Anthony PERARD Committed by Stefano Stabellini
Browse files

xen_pt: Fix passthrough of device with ROM.



QEMU does not need and should not allocate memory for the ROM of a
passthrough PCI device. So this patch initialize the particular region
like any other PCI BAR of a passthrough device.

When a guest will access the ROM, Xen will take care of the IO, QEMU
will not be involved in it.

Xen set a limit of memory available for each guest, allocating memory
for a ROM can hit this limit.

Signed-off-by: default avatarAnthony PERARD <anthony.perard@citrix.com>
Signed-off-by: default avatarStefano Stabellini <stefano.stabellini@eu.citrix.com>
Reported-and-Tested-by: default avatarKonrad Rzeszutek Wilk <konrad.wilk@oracle.com>
parent fc33b900
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -440,7 +440,7 @@ static int xen_pt_register_regions(XenPCIPassthroughState *s)

        s->bases[PCI_ROM_SLOT].access.maddr = d->rom.base_addr;

        memory_region_init_rom_device(&s->rom, OBJECT(s), NULL, NULL,
        memory_region_init_io(&s->rom, OBJECT(s), &ops, &s->dev,
                              "xen-pci-pt-rom", d->rom.size);
        pci_register_bar(&s->dev, PCI_ROM_SLOT, PCI_BASE_ADDRESS_MEM_PREFETCH,
                         &s->rom);