From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Roedel, Joerg" Subject: Re: [PATCH] KVM: SVM: Load %gs earlier if CONFIG_X86_32_LAZY_GS=n Date: Tue, 8 Mar 2011 15:26:29 +0100 Message-ID: <20110308142629.GN17719@amd.com> References: <1299593591-14968-1-git-send-email-avi@redhat.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Cc: Marcelo Tosatti , "kvm@vger.kernel.org" , IVAN ANGELOV To: Avi Kivity Return-path: Received: from tx2ehsobe003.messaging.microsoft.com ([65.55.88.13]:26468 "EHLO TX2EHSOBE006.bigfish.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750931Ab1CHO0p (ORCPT ); Tue, 8 Mar 2011 09:26:45 -0500 Content-Disposition: inline In-Reply-To: <1299593591-14968-1-git-send-email-avi@redhat.com> Sender: kvm-owner@vger.kernel.org List-ID: On Tue, Mar 08, 2011 at 09:13:11AM -0500, Avi Kivity wrote: > With CONFIG_CC_STACKPROTECTOR, we need a valid %gs at all times, so disable > lazy reload and do an eager reload immediately after the vmexit. > Reported-by: IVAN ANGELOV > Signed-off-by: Avi Kivity Acked-By: Joerg Roedel > --- > arch/x86/kvm/svm.c | 5 +++++ > 1 files changed, 5 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c > index 8d61df4..6bb15d5 100644 > --- a/arch/x86/kvm/svm.c > +++ b/arch/x86/kvm/svm.c > @@ -1155,8 +1155,10 @@ static void svm_vcpu_put(struct kvm_vcpu *vcpu) > wrmsrl(MSR_KERNEL_GS_BASE, current->thread.gs); > load_gs_index(svm->host.gs); > #else > +#ifdef CONFIG_X86_32_LAZY_GS > loadsegment(gs, svm->host.gs); > #endif > +#endif > for (i = 0; i < NR_HOST_SAVE_USER_MSRS; i++) > wrmsrl(host_save_user_msrs[i], svm->host_user_msrs[i]); > } > @@ -3649,6 +3651,9 @@ static void svm_vcpu_run(struct kvm_vcpu *vcpu) > wrmsrl(MSR_GS_BASE, svm->host.gs_base); > #else > loadsegment(fs, svm->host.fs); > +#ifndef CONFIG_X86_32_LAZY_GS > + loadsegment(gs, svm->host.gs); > +#endif > #endif > > reload_tss(vcpu); > -- > 1.7.1 > -- 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