From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jan Kiszka Subject: Re: [PATCH 1/2] KVM: SVM: Fix NMI path when NMI happens in guest mode Date: Thu, 13 Jan 2011 16:48:33 +0100 Message-ID: <4D2F1ED1.1020001@siemens.com> References: <1294932178-26866-1-git-send-email-joerg.roedel@amd.com> <1294932178-26866-2-git-send-email-joerg.roedel@amd.com> Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Avi Kivity , Marcelo Tosatti , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, stable@kernel.org To: Joerg Roedel Return-path: Received: from thoth.sbs.de ([192.35.17.2]:18161 "EHLO thoth.sbs.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1756751Ab1AMPtS (ORCPT ); Thu, 13 Jan 2011 10:49:18 -0500 In-Reply-To: <1294932178-26866-2-git-send-email-joerg.roedel@amd.com> Sender: kvm-owner@vger.kernel.org List-ID: Am 13.01.2011 16:22, Joerg Roedel wrote: > The vmexit path on SVM needs to restore the KERNEL_GS_BASE > MSR in order to savely execute the NMI handler. Otherwise a > pending NMI can occur after the STGI instruction and crash > the machine. > This makes it impossible to run perf and kvm in parallel on > an AMD machine in a stable way. > > Cc: stable@kernel.org > Signed-off-by: Joerg Roedel > --- > arch/x86/kvm/svm.c | 1 + > 1 files changed, 1 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index 25bd1bc..8b9bc72 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -3637,6 +3637,7 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) > > #ifdef CONFIG_X86_64 > wrmsrl(MSR_GS_BASE, svm->host.gs_base); > + wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs); > #else > loadsegment(fs, svm->host.fs); > #endif Doesn't this also obsolete the wrmsrl(MSR_KERNEL_GS_BASE) in svm_vcpu_put? Jan -- Siemens AG, Corporate Technology, CT T DE IT 1 Corporate Competence Center Embedded Linux