From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Roedel, Joerg" Subject: Re: [PATCH 1/2] KVM: SVM: Fix NMI path when NMI happens in guest mode Date: Fri, 14 Jan 2011 14:36:02 +0100 Message-ID: <20110114133602.GC23914@amd.com> References: <1294932178-26866-1-git-send-email-joerg.roedel@amd.com> <1294932178-26866-2-git-send-email-joerg.roedel@amd.com> <4D2F1D49.8070807@redhat.com> <20110113155129.GA23914@amd.com> <4D2F5204.7020100@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: Marcelo Tosatti , "kvm@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "stable@kernel.org" To: Avi Kivity Return-path: Received: from va3ehsobe004.messaging.microsoft.com ([216.32.180.14]:24423 "EHLO VA3EHSOBE004.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751703Ab1ANNgK (ORCPT ); Fri, 14 Jan 2011 08:36:10 -0500 Content-Disposition: inline In-Reply-To: <4D2F5204.7020100@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Thu, Jan 13, 2011 at 02:27:00PM -0500, Avi Kivity wrote: > On 01/13/2011 05:51 PM, Roedel, Joerg wrote: > > I also had a look at entry_64.S. The save_paranoid could not be the > > cause because MSR_GS_BASE is already negative at this point. But the > > re-schedule condition check at the end of the NMI handler code could > > also not be the cause because the NMI happens while preemption (and > > interrupts) are disabled (a re-schedule should also trigger > > preempt-notifiers and restore KERNEL_GS_BASE). > > > > I have it: Cool, good catch. Thanks :) The only use of load_gs_index in svm is the vcpu_put function. It is sufficient to just swap the KERNEL_GS_BASE wrmsr and the load_gs_index function calls in there to be safe. Joerg -- AMD Operating System Research Center Advanced Micro Devices GmbH Einsteinring 24 85609 Dornach General Managers: Alberto Bozzo, Andrew Bowd Registration: Dornach, Landkr. Muenchen; Registerger. Muenchen, HRB Nr. 43632