From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52468) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4BX0-0000IN-Aj for qemu-devel@nongnu.org; Fri, 17 Jan 2014 10:40:30 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1W4BWw-0001O4-7R for qemu-devel@nongnu.org; Fri, 17 Jan 2014 10:40:26 -0500 Received: from smtp.citrix.com ([66.165.176.89]:30309) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1W4BWw-0001Nt-2g for qemu-devel@nongnu.org; Fri, 17 Jan 2014 10:40:22 -0500 From: Stefano Stabellini Date: Fri, 17 Jan 2014 15:39:12 +0000 Message-ID: <1389973152-12997-3-git-send-email-stefano.stabellini@eu.citrix.com> In-Reply-To: References: MIME-Version: 1.0 Content-Type: text/plain Subject: [Qemu-devel] [PULL 3/3] xen_pt: Fix passthrough of device with ROM. List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: anthony@codemonkey.ws Cc: anthony.perard@citrix.com, xen-devel@lists.xen, qemu-devel@nongnu.org, Stefano Stabellini From: Anthony PERARD 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: Anthony PERARD Signed-off-by: Stefano Stabellini Reported-and-Tested-by: Konrad Rzeszutek Wilk --- hw/xen/xen_pt.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/hw/xen/xen_pt.c b/hw/xen/xen_pt.c index eee4354..be4220b 100644 --- a/hw/xen/xen_pt.c +++ b/hw/xen/xen_pt.c @@ -440,8 +440,8 @@ 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, - "xen-pci-pt-rom", d->rom.size); + 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); -- 1.7.10.4