On Wed, Apr 12, 2023 at 09:34:57PM +0000, Anish Moorthy wrote: > Implement KVM_CAP_MEMORY_FAULT_INFO for efaults generated by > kvm_vcpu_map(). > > Signed-off-by: Anish Moorthy <amoorthy@xxxxxxxxxx> > --- > virt/kvm/kvm_main.c | 4 +++- > 1 file changed, 3 insertions(+), 1 deletion(-) > > diff --git a/virt/kvm/kvm_main.c b/virt/kvm/kvm_main.c > index 572adba9ad8ed..f3be5aa49829a 100644 > --- a/virt/kvm/kvm_main.c > +++ b/virt/kvm/kvm_main.c > @@ -2843,8 +2843,10 @@ int kvm_vcpu_map(struct kvm_vcpu *vcpu, gfn_t gfn, struct kvm_host_map *map) > #endif > } > > - if (!hva) > + if (!hva) { > + kvm_populate_efault_info(vcpu, gfn * PAGE_SIZE, PAGE_SIZE); > return -EFAULT; > + } > > map->page = page; > map->hva = hva; Totally not familiar with nested, just a pure question on whether all the kvm_vcpu_map() callers will be prepared to receive this -EFAULT yet? I quickly went over the later patches but I didn't find a full solution yet, but maybe I missed something. Thanks, -- Peter Xu