]> Git Repo - qemu.git/commitdiff
xen-hvm: ignore background I/O sections
authorPaul Durrant <[email protected]>
Mon, 9 May 2016 16:31:20 +0000 (17:31 +0100)
committerPaolo Bonzini <[email protected]>
Sun, 29 May 2016 07:11:11 +0000 (09:11 +0200)
Since Xen will correctly handle accesses to unimplemented I/O ports (by
returning all 1's for reads and ignoring writes) there is no need for
QEMU to register backgroud I/O sections.

This patch therefore adds checks to xen_io_add/del so that sections with
memory-region ops pointing at 'unassigned_io_ops' are ignored.

Signed-off-by: Paul Durrant <[email protected]>
Cc: Stefano Stabellini <[email protected]>
Cc: Anthony Perard <[email protected]>
Cc: Paolo Bonzini <[email protected]>
Message-Id: <1462811480[email protected]>
Acked-by: Anthony PERARD <[email protected]>
Signed-off-by: Paolo Bonzini <[email protected]>
xen-hvm.c

index c14e778a8e6fbb191848a1091aa52f6c6e25cf5c..01ee25de21b72640852b43deb52b004066db3dc7 100644 (file)
--- a/xen-hvm.c
+++ b/xen-hvm.c
@@ -511,8 +511,13 @@ static void xen_io_add(MemoryListener *listener,
                        MemoryRegionSection *section)
 {
     XenIOState *state = container_of(listener, XenIOState, io_listener);
+    MemoryRegion *mr = section->mr;
 
-    memory_region_ref(section->mr);
+    if (mr->ops == &unassigned_io_ops) {
+        return;
+    }
+
+    memory_region_ref(mr);
 
     xen_map_io_section(xen_xc, xen_domid, state->ioservid, section);
 }
@@ -521,10 +526,15 @@ static void xen_io_del(MemoryListener *listener,
                        MemoryRegionSection *section)
 {
     XenIOState *state = container_of(listener, XenIOState, io_listener);
+    MemoryRegion *mr = section->mr;
+
+    if (mr->ops == &unassigned_io_ops) {
+        return;
+    }
 
     xen_unmap_io_section(xen_xc, xen_domid, state->ioservid, section);
 
-    memory_region_unref(section->mr);
+    memory_region_unref(mr);
 }
 
 static void xen_device_realize(DeviceListener *listener,
This page took 0.027609 seconds and 4 git commands to generate.