On 11/8/23 17:56, David Matlack wrote:
Thanks for the longer explanation. Yes kvm_read_guest() eventually calls __copy_from_user() which will trigger a page fault and UserfaultFD will notify userspace and wait for the page to become present. In the KVM-specific proposal I outlined, calling kvm_read_guest() will ultimately result in a check of the VM's present bitmap and KVM will nnotify userspace and wait for the page to become present if it's not, before calling __copy_from_user(). So I don't expect a KVM-specific solution to have any increased maintenance burden for VGIC (or any other widgets).
It does mean however that we need a cross-thread notification mechanism, instead of just relying on KVM_EXIT_MEMORY_FAULT (or another KVM_EXIT_*).
Paolo