diff mbox

[V2] qemu-xen: vt-d bugfix for pci rom

Message ID DE8DF0795D48FD4CA783C40EC82923350135A1DA@SHSMSX101.ccr.corp.intel.com
State New
Headers show

Commit Message

Liu, Jinsong Sept. 6, 2013, 9:50 a.m. UTC
Liu, Jinsong wrote:
> From 7d93370e8005499d18507b8cd9fa71f4ae794e19 Mon Sep 17 00:00:00 2001
> From: Liu Jinsong <jinsong.liu@vt-nhm7.tsp.org>
> Date: Fri, 6 Sep 2013 16:34:56 +0800
> Subject: [PATCH] qemu-xen: vt-d bugfix for pci rom
> 

Sorry, update 'From: Liu Jinsong <jinsong.liu@vt-nhm7.tsp.org>' and add some error log.

Comments

Liu, Jinsong Sept. 11, 2013, 6:21 a.m. UTC | #1
Ping?

Thanks,
Jinsong

Liu, Jinsong wrote:
> Liu, Jinsong wrote:
>> From 7d93370e8005499d18507b8cd9fa71f4ae794e19 Mon Sep 17 00:00:00
>> 2001 From: Liu Jinsong <jinsong.liu@vt-nhm7.tsp.org>
>> Date: Fri, 6 Sep 2013 16:34:56 +0800
>> Subject: [PATCH] qemu-xen: vt-d bugfix for pci rom
>> 
> 
> Sorry, update 'From: Liu Jinsong <jinsong.liu@vt-nhm7.tsp.org>' and
> add some error log. 
> 
> ===========
> From 7d93370e8005499d18507b8cd9fa71f4ae794e19 Mon Sep 17 00:00:00 2001
> From: Liu Jinsong <jinsong.liu@intel.com>
> Date: Fri, 6 Sep 2013 16:34:56 +0800
> Subject: [PATCH V2] qemu-xen: vt-d bugfix for pci rom
> 
> Remove incorrect memory_region_init_rom_device() from
> xen_pt_register_regions(), otherwise vt-d device with pci rom cannot
> pass through to hvm, since it trys to populate from normal ram for
> pci rom. For example, when we pass through Intel 82576 NIC (with 4MB
> pci rom) to hvm guest, it fails with 
> 
> libxl: error: libxl_qmp.c:454:qmp_next: Socket read error: Connection
> reset by peer qemu: hardware error: xen: xen_domid = 3, nr_pfn = 400,
> ram_addr = 20010000 (XEN) page_alloc.c:1460:d0 Over-allocation for
> domain 3: 131329 > 131328 (XEN) memory.c:132:d0 Could not allocate
> order=0 extent: id=3 memflags=0 (254 of 1024) 
> 
> Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
> ---
>  hw/xen_pt.c |    2 --
>  1 files changed, 0 insertions(+), 2 deletions(-)
> 
> diff --git a/hw/xen_pt.c b/hw/xen_pt.c
> index 7aae826..b0bffdb 100644
> --- a/hw/xen_pt.c
> +++ b/hw/xen_pt.c
> @@ -440,8 +440,6 @@ 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, NULL, NULL,
> -                                      "xen-pci-pt-rom", d->rom.size);
>          pci_register_bar(&s->dev, PCI_ROM_SLOT,
>                           PCI_BASE_ADDRESS_MEM_PREFETCH, &s->rom);
diff mbox

Patch

===========
From 7d93370e8005499d18507b8cd9fa71f4ae794e19 Mon Sep 17 00:00:00 2001
From: Liu Jinsong <jinsong.liu@intel.com>
Date: Fri, 6 Sep 2013 16:34:56 +0800
Subject: [PATCH V2] qemu-xen: vt-d bugfix for pci rom

Remove incorrect memory_region_init_rom_device() from xen_pt_register_regions(),
otherwise vt-d device with pci rom cannot pass through to hvm, since it trys to
populate from normal ram for pci rom. For example, when we pass through Intel 82576
NIC (with 4MB pci rom) to hvm guest, it fails with

libxl: error: libxl_qmp.c:454:qmp_next: Socket read error: Connection reset by peer
qemu: hardware error: xen: xen_domid = 3, nr_pfn = 400, ram_addr = 20010000
(XEN) page_alloc.c:1460:d0 Over-allocation for domain 3: 131329 > 131328
(XEN) memory.c:132:d0 Could not allocate order=0 extent: id=3 memflags=0 (254 of 1024)

Signed-off-by: Liu Jinsong <jinsong.liu@intel.com>
---
 hw/xen_pt.c |    2 --
 1 files changed, 0 insertions(+), 2 deletions(-)

diff --git a/hw/xen_pt.c b/hw/xen_pt.c
index 7aae826..b0bffdb 100644
--- a/hw/xen_pt.c
+++ b/hw/xen_pt.c
@@ -440,8 +440,6 @@  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, NULL, NULL,
-                                      "xen-pci-pt-rom", d->rom.size);
         pci_register_bar(&s->dev, PCI_ROM_SLOT, PCI_BASE_ADDRESS_MEM_PREFETCH,
                          &s->rom);