Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751458AbdINOfj (ORCPT ); Thu, 14 Sep 2017 10:35:39 -0400 Received: from mx2.suse.de ([195.135.220.15]:42402 "EHLO mx1.suse.de" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751131AbdINOfi (ORCPT ); Thu, 14 Sep 2017 10:35:38 -0400 Date: Thu, 14 Sep 2017 16:35:26 +0200 From: Borislav Petkov To: Brijesh Singh Cc: linux-kernel@vger.kernel.org, x86@kernel.org, kvm@vger.kernel.org, Thomas Gleixner , Joerg Roedel , "Michael S . Tsirkin" , Paolo Bonzini , =?utf-8?B?XCJSYWRpbSBLcsSNbcOhxZlcIg==?= , Tom Lendacky Subject: Re: [RFC Part2 PATCH v3 24/26] KVM: SVM: Clear C-bit from the page fault address Message-ID: <20170914143526.l5g7ydgklnqbu5wo@pd.tnic> References: <20170724200303.12197-1-brijesh.singh@amd.com> <20170724200303.12197-25-brijesh.singh@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20170724200303.12197-25-brijesh.singh@amd.com> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1100 Lines: 37 On Mon, Jul 24, 2017 at 03:03:01PM -0500, Brijesh Singh wrote: > When SEV is active, on #NPF the page fault address will contain C-bit. "... contain the 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, > -- Otherwise: Reviewed-by: Borislav Petkov -- Regards/Gruss, Boris. SUSE Linux GmbH, GF: Felix Imendörffer, Jane Smithard, Graham Norton, HRB 21284 (AG Nürnberg) --