qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [QEMU][RFC PATCH 3/6] memory: Add xen memory hook


From: Julien Grall
Subject: Re: [Qemu-devel] [QEMU][RFC PATCH 3/6] memory: Add xen memory hook
Date: Fri, 23 Mar 2012 15:08:21 +0000
User-agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.9.1.16) Gecko/20120207 Icedove/3.0.11

On 03/22/2012 05:44 PM, Jan Kiszka wrote:

  static void core_region_nop(MemoryListener *listener,
diff --git a/ioport.c b/ioport.c
index 78a3b89..073ed75 100644
--- a/ioport.c
+++ b/ioport.c
@@ -28,6 +28,7 @@
  #include "ioport.h"
  #include "trace.h"
  #include "memory.h"
+#include "hw/xen.h"

  /***********************************************************/
  /* IO Port */
@@ -155,6 +156,11 @@ int register_ioport_read(pio_addr_t start, int length, int 
size,
                       i);
          ioport_opaque[i] = opaque;
      }
+
+    if (xen_enabled()) {
+        xen_map_iorange(start, length, 0);
+    }
+
      return 0;
  }

@@ -175,7 +181,13 @@ int register_ioport_write(pio_addr_t start, int length, 
int size,
                       i);
          ioport_opaque[i] = opaque;
      }
+
+    if (xen_enabled()) {
+        xen_map_iorange(start, length, 0);
+    }
+
      return 0;
+
  }

  static uint32_t ioport_readb_thunk(void *opaque, uint32_t addr)
@@ -260,6 +272,11 @@ void isa_unassign_ioport(pio_addr_t start, int length)
          ioport_destructor_table[start](ioport_opaque[start]);
          ioport_destructor_table[start] = NULL;
      }
+
+    if (xen_enabled()) {
+        xen_unmap_iorange(start, length, 0);
+    }
+
      for(i = start; i<  start + length; i++) {
          ioport_read_table[0][i] = NULL;
          ioport_read_table[1][i] = NULL;
memory_listener_register(xen_hooks, system_io)?
QEMU doesn't seem to call region_add/region_del for ioport.
Moreover, some of ioport are directly register without
using memory hook (for example cirrus vga).

What is the best way to do it ?

Even if that is not yet powerful enough, tuning the hooks is usually
better than open-coding.

Jan





reply via email to

[Prev in Thread] Current Thread [Next in Thread]