From mboxrd@z Thu Jan 1 00:00:00 1970 From: Brijesh Singh Subject: [RFC Part2 PATCH v3 24/26] KVM: SVM: Clear C-bit from the page fault address Date: Mon, 24 Jul 2017 15:03:01 -0500 Message-ID: <20170724200303.12197-25-brijesh.singh@amd.com> References: <20170724200303.12197-1-brijesh.singh@amd.com> Mime-Version: 1.0 Content-Type: text/plain Cc: Thomas Gleixner , Borislav Petkov , Joerg Roedel , "Michael S . Tsirkin" , Paolo Bonzini , =?UTF-8?q?=5C=22Radim=20Kr=C4=8Dm=C3=A1=C5=99=5C=22?= , Tom Lendacky , Brijesh Singh To: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org Return-path: Received: from mail-by2nam01on0080.outbound.protection.outlook.com ([104.47.34.80]:6848 "EHLO NAM01-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753606AbdGXUIi (ORCPT ); Mon, 24 Jul 2017 16:08:38 -0400 In-Reply-To: <20170724200303.12197-1-brijesh.singh@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: When SEV is active, on #NPF the page fault address will contain C-bit. We must clear the C-bit before handling the fault. Signed-off-by: Brijesh Singh --- arch/x86/kvm/svm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 0bbd050..64b9f60 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c @@ -2321,7 +2321,7 @@ static void svm_set_dr7(struct kvm_vcpu *vcpu, unsigned long value) static int pf_interception(struct vcpu_svm *svm) { - u64 fault_address = svm->vmcb->control.exit_info_2; + u64 fault_address = __sme_clr(svm->vmcb->control.exit_info_2); u64 error_code = svm->vmcb->control.exit_info_1; return kvm_handle_page_fault(&svm->vcpu, error_code, fault_address, -- 2.9.4