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.
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 | 110 +++++++++++++++++++-- kvm-all.c | 310 +++++++++++++++++++++++++++++++-------------------------- kvm.h | 8 -- 4 files changed, 289 insertions(+), 158 deletions(-)