@@ -3218,6 +3218,9 @@ static void kvm_send_hwpoison_signal(struct kvm_memory_slot *slot, gfn_t gfn)
static int kvm_handle_error_pfn(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault)
{
+ uint64_t rounded_gfn;
+ uint64_t fault_size;
+
if (is_sigpending_pfn(fault->pfn)) {
kvm_handle_signal_exit(vcpu);
return -EINTR;
@@ -3236,6 +3239,10 @@ static int kvm_handle_error_pfn(struct kvm_vcpu *vcpu, struct kvm_page_fault *fa
return RET_PF_RETRY;
}
+ fault_size = KVM_HPAGE_SIZE(fault->goal_level);
+ rounded_gfn = round_down(fault->gfn * PAGE_SIZE, fault_size);
+
+ kvm_populate_efault_info(vcpu, rounded_gfn, fault_size);
return -EFAULT;
}
Implement KVM_CAP_MEMORY_FAULT_INFO for efaults generated by kvm_handle_error_pfn(). Signed-off-by: Anish Moorthy <amoorthy@google.com> --- arch/x86/kvm/mmu/mmu.c | 7 +++++++ 1 file changed, 7 insertions(+)