On Wed, Jan 31, 2024 at 2:38 PM Anish Moorthy <amoorthy@xxxxxxxxxx> wrote: > > On Tue, Jan 30, 2024 at 3:58 PM James Houghton <jthoughton@xxxxxxxxxx> wrote: > > > > I think that either (1) we move this kvm_prepare_memory_fault_exit > > logic into the previous patch[1], or (2) we merge this patch with the > > previous one. IIUC, we can only advertise KVM_CAP_MEMORY_FAULT_INFO on > > arm64 if this logic is present. > > Actually (sorry, about-face from our off-list chat), *does* it make > sense to merge these two patches? As per [1]: yes, it makes sense to move the kvm_prepare_memory_fault_exit(). So for the next version, the description is also going to change a bit to > KVM: arm64: Implement and advertise KVM_CAP_EXIT_ON_MISSING > > Prevent the stage-2 fault handler from faulting in pages when > KVM_MEM_EXIT_ON_MISSING is set by allowing its __gfn_to_pfn_memslot() > call to check the memslot flag. This effects the delivery of stage-2 > faults as vCPU exits (see KVM_CAP_MEMORY_FAULT_INFO), which userspace > can attempt to resolve without terminating the guest. > Delivering stage-2 faults to userspace in this way sidesteps the > significant scalabiliy issues associated with using userfaultfd for the > same purpose. [1] https://lore.kernel.org/kvm/ZcP_JHsMJUlvjAs1@xxxxxxxxx/#t