Re: [PATCH 0/4] KVM: API to block and resume all running vcpus in a vm

From: Paolo Bonzini
Date: Tue Oct 25 2022 - 05:33:45 EST


On 10/25/22 00:45, Sean Christopherson wrote:
Yes that helps and should be part of the cover letter for the next iterations.
But that doesn't explain why KVM needs to get involved, it only explains why QEMU
can't use its existing pause_all_vcpus(). I do not understand why this is a
problem QEMU needs KVM's help to solve.

I agree that it's not KVM's problem that QEMU cannot use pause_all_vcpus(). Having a ioctl in KVM, rather than coding the same in QEMU, is *mostly* a matter of programmer and computer efficiency because the code is pretty simple.

That said, I believe the limited memslot API makes it more than just a QEMU problem. Because KVM_GET_DIRTY_LOG cannot be combined atomically with KVM_SET_USER_MEMORY_REGION(MR_DELETE), any VMM that uses dirty-log regions while the VM is running is liable to losing the dirty status of some pages. That's also a reason to provide this API in KVM.

Paolo