Skip to content

qemu: memory notifiers

Michael S. Tsirkin qemu-devel 2 versions New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest posting 2/20 of 3 patches 0 repliesNew
  2. v2 posting 1/23 patches 10 repliesSuperseded

Patches in v2 posting 2/2 No applies recorded yet

None of the 3 patches the cover letter announces are in this archive.

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [Qemu-devel] [PATCHv2 0/3] qemu: memory notifiers

This patch against qemu upstream adds notifiers hook which lets backends get notified on memory changes, and converts kvm to use it. It survived light testing. Avi, could you please take a look at this patch? Thanks!

---
 cpu-common.h |   19 +++++++++++++++++
 exec.c       |   62 +++++++++++++++++++++++++++++++++++++++++++++++++++++++--
 2 files changed, 78 insertions(+), 3 deletions(-)
cpu-common.h +19 -0
index 6302372..0ec9b72 100644
@@ -8,6 +8,7 @@
 #endif
 
 #include "bswap.h"
+#include "qemu-queue.h"
 
 /* address in the RAM (different from a physical address) */
 typedef unsigned long ram_addr_t;
@@ -61,6 +62,24 @@ void cpu_physical_memory_unmap(void *buffer, target_phys_addr_t len,
 void *cpu_register_map_client(void *opaque, void (*callback)(void *opaque));
 void cpu_unregister_map_client(void *cookie);
 
+struct CPUPhysMemoryClient;
+typedef struct CPUPhysMemoryClient CPUPhysMemoryClient;
+struct CPUPhysMemoryClient {
+    void (*set_memory)(struct CPUPhysMemoryClient *client,
+                       target_phys_addr_t start_addr,
+                       ram_addr_t size,
+                       ram_addr_t phys_offset);
+    int (*sync_dirty_bitmap)(struct CPUPhysMemoryClient *client,
+                             target_phys_addr_t start_addr,
+                             target_phys_addr_t end_addr);
+    int (*migration_log)(struct CPUPhysMemoryClient *client,
+                         int enable);
+    QLIST_ENTRY(CPUPhysMemoryClient) list;
+};
+
+void cpu_register_phys_memory_client(CPUPhysMemoryClient *);
+void cpu_unregister_phys_memory_client(CPUPhysMemoryClient *);
+
 uint32_t ldub_phys(target_phys_addr_t addr);
 uint32_t lduw_phys(target_phys_addr_t addr);
 uint32_t ldl_phys(target_phys_addr_t addr);
exec.c +59 -3

90 lines not on this page · raw message

Signature · 14 lines
1.6.6.rc1.43.gf55cc



Michael S. Tsirkin (3):
  qemu: memory notifiers
  kvm: move kvm_set_phys_mem around
  kvm: move kvm to use memory notifiers

 cpu-common.h |   19 ++++
 exec.c       |  108 +++++++++++++++++++--
 kvm-all.c    |  310 +++++++++++++++++++++++++++++++--------------------------
 kvm.h        |    8 --
 4 files changed, 287 insertions(+), 158 deletions(-)