Skip to content

Commit 0ede79e

Browse files
committed
KVM: SVM: Clear C-bit from the page fault address
When SEV is active, on #VMEXIT the page fault address will contain the C-bit. We must clear the C-bit before handling the fault. Cc: Thomas Gleixner <[email protected]> Cc: Ingo Molnar <[email protected]> Cc: "H. Peter Anvin" <[email protected]> Cc: Paolo Bonzini <[email protected]> Cc: "Radim Krčmář" <[email protected]> Cc: Joerg Roedel <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Tom Lendacky <[email protected]> Cc: [email protected] Cc: [email protected] Cc: [email protected] Reviewed-by: Borislav Petkov <[email protected]> Signed-off-by: Brijesh Singh <[email protected]>
1 parent 1e80fdc commit 0ede79e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

arch/x86/kvm/svm.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2430,7 +2430,7 @@ static void svm_set_dr7(struct kvm_vcpu *vcpu, unsigned long value)
24302430

24312431
static int pf_interception(struct vcpu_svm *svm)
24322432
{
2433-
u64 fault_address = svm->vmcb->control.exit_info_2;
2433+
u64 fault_address = __sme_clr(svm->vmcb->control.exit_info_2);
24342434
u64 error_code = svm->vmcb->control.exit_info_1;
24352435

24362436
return kvm_handle_page_fault(&svm->vcpu, error_code, fault_address,
@@ -2440,7 +2440,7 @@ static int pf_interception(struct vcpu_svm *svm)
24402440

24412441
static int npf_interception(struct vcpu_svm *svm)
24422442
{
2443-
u64 fault_address = svm->vmcb->control.exit_info_2;
2443+
u64 fault_address = __sme_clr(svm->vmcb->control.exit_info_2);
24442444
u64 error_code = svm->vmcb->control.exit_info_1;
24452445

24462446
trace_kvm_page_fault(fault_address, error_code);

0 commit comments

Comments
 (0)