Skip to content

Commit 5f8bb00

Browse files
vittyvkbonzini
authored andcommitted
KVM: vmx: hyper-v: don't pass EPT configuration info to vmx_hv_remote_flush_tlb()
I'm observing random crashes in multi-vCPU L2 guests running on KVM on Hyper-V. I bisected the issue to the commit 877ad95 ("KVM: vmx: Add tlb_remote_flush callback support"). Hyper-V TLFS states: "AddressSpace specifies an address space ID (an EPT PML4 table pointer)" So apparently, Hyper-V doesn't expect us to pass naked EPTP, only PML4 pointer should be used. Strip off EPT configuration information before calling into vmx_hv_remote_flush_tlb(). Fixes: 877ad95 ("KVM: vmx: Add tlb_remote_flush callback support") Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 4cebf45 commit 5f8bb00

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

arch/x86/kvm/vmx.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1572,8 +1572,12 @@ static int vmx_hv_remote_flush_tlb(struct kvm *kvm)
15721572
goto out;
15731573
}
15741574

1575+
/*
1576+
* FLUSH_GUEST_PHYSICAL_ADDRESS_SPACE hypercall needs the address of the
1577+
* base of EPT PML4 table, strip off EPT configuration information.
1578+
*/
15751579
ret = hyperv_flush_guest_mapping(
1576-
to_vmx(kvm_get_vcpu(kvm, 0))->ept_pointer);
1580+
to_vmx(kvm_get_vcpu(kvm, 0))->ept_pointer & PAGE_MASK);
15771581

15781582
out:
15791583
spin_unlock(&to_kvm_vmx(kvm)->ept_pointer_lock);

0 commit comments

Comments
 (0)