Skip to content

Commit 6adde77

Browse files
Sukrit Bhatnagaropsiff
authored andcommitted
KVM: VMX: Fix check for valid GVA on an EPT violation
[ Upstream commit d0164c1 ] On an EPT violation, bit 7 of the exit qualification is set if the guest linear-address is valid. The derived page fault error code should not be checked for this bit. Fixes: f300948 ("KVM: VMX: Set PFERR_GUEST_{FINAL,PAGE}_MASK if and only if the GVA is valid") Cc: [email protected] Signed-off-by: Sukrit Bhatnagar <[email protected]> Reviewed-by: Xiaoyao Li <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Sean Christopherson <[email protected]> Signed-off-by: Sasha Levin <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> (cherry picked from commit 3010739f53438b87216d4c04b19f8139cf44e40b) Signed-off-by: Wentao Guan <[email protected]>
1 parent f9d60e1 commit 6adde77

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

arch/x86/kvm/vmx/common.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ static inline int __vmx_handle_ept_violation(struct kvm_vcpu *vcpu, gpa_t gpa,
2424
error_code |= (exit_qualification & EPT_VIOLATION_RWX_MASK)
2525
? PFERR_PRESENT_MASK : 0;
2626

27-
if (error_code & EPT_VIOLATION_GVA_IS_VALID)
27+
if (exit_qualification & EPT_VIOLATION_GVA_IS_VALID)
2828
error_code |= (exit_qualification & EPT_VIOLATION_GVA_TRANSLATED) ?
2929
PFERR_GUEST_FINAL_MASK : PFERR_GUEST_PAGE_MASK;
3030

0 commit comments

Comments
 (0)