Missing feature, KVM on ARM, dirty page logging.
Hi folks,
I'm looking at dirty page logging on KVM on ARM, which appears, at present to be non-existent. Is anyone working on this, or willing to lend a hand?
I'm running KVM on an OMAP5, and my guest is a vexpress-a15 with PL-111 framebuffer.
running tcg mode, this works, however in KVM I was seeing (occasionally) one frame of video.
Some debugging led me to the dirty_log code, and I discovered that qemu makes a bad test for the return code from kvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d) in kvm_physical_sync_dirty_bitmap(), so the problem was going unreported.
Furthermore, I think the vexpress emulation was missing a call tomemory_region_set_log(vram, true, DIRTY_MEMORY_VGA);
for the vram region, which was preventing the host kernel knowing that dirty page logging was required. (I think - Im not really very clear on the whole qemu memory API, as AFAICT, its barely documented...)
Anyhow, If I add the call to memory_region_set_log(), and if I ask the host kernel to mark absolutely everything as dirty, it does in fact, work.
Obviously this is a massive hack, but I'm not too sure where to go on from here, so pointers would be nice. Presumably, I'm going to have to do some prodding of the hosts page tables, but I'm not clear exactly what, as yet.
-Ian
Quoted 2 lines · Ian Molton
I'm looking at dirty page logging on KVM on ARM, which appears, at present to be non-existent. Is anyone working on this, or willing to lend a hand?
I've cc'd the kvmarm mailing list to give this a slightly wider airing.
Quoted 5 lines
I'm running KVM on an OMAP5, and my guest is a vexpress-a15 with PL-111 framebuffer.
running tcg mode, this works, however in KVM I was seeing (occasionally) one frame of video.
Yeah, not sure if anybody's tested video in a KVM guest.
Quoted 11 lines
Some debugging led me to the
dirty_logcode, and I discovered that qemu makes a bad test for the return code fromkvm_vm_ioctl(s, KVM_GET_DIRTY_LOG, &d)inkvm_physical_sync_dirty_bitmap(), so the problem was going unreported.Furthermore, I think the vexpress emulation was missing a call to
memory_region_set_log(vram, true, DIRTY_MEMORY_VGA);
for the vram region, which was preventing the host kernel knowing that dirty page logging was required. (I think - Im not really very clear on the whole qemu memory API, as AFAICT, its barely documented...)
Quoted 6 lines
Anyhow, If I add the call to
memory_region_set_log(), and if I ask the host kernel to mark absolutely everything as dirty, it does in fact, work.Obviously this is a massive hack, but I'm not too sure where to go on from here, so pointers would be nice. Presumably, I'm going to have to do some prodding of the hosts page tables, but I'm not clear exactly what, as yet.
-- PMM