From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gleb Natapov Subject: Re: [PATCH] KVM: nVMX: Clear segment cache after switching between L1 and L2 Date: Wed, 27 Feb 2013 15:41:23 +0200 Message-ID: <20130227134123.GK23616@redhat.com> References: <51293629.7050605@web.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Cc: Marcelo Tosatti , kvm , "Nadav Har'El" , "Nakajima, Jun" To: Jan Kiszka Return-path: Received: from mx1.redhat.com ([209.132.183.28]:14626 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1759785Ab3B0Nl1 (ORCPT ); Wed, 27 Feb 2013 08:41:27 -0500 Content-Disposition: inline In-Reply-To: <51293629.7050605@web.de> Sender: kvm-owner@vger.kernel.org List-ID: On Sat, Feb 23, 2013 at 10:35:37PM +0100, Jan Kiszka wrote: > From: Jan Kiszka > > Switching the VMCS obviously invalidates what may have been cached about > the guest segments. > > Signed-off-by: Jan Kiszka Applied, thanks. > --- > > Probably, the missing invalidations are harmless ATM, but you never > know. > > arch/x86/kvm/vmx.c | 4 ++++ > 1 files changed, 4 insertions(+), 0 deletions(-) > > diff --git a/arch/x86/kvm/vmx.c b/arch/x86/kvm/vmx.c > index 94f3b66..d45f0e0 100644 > --- a/arch/x86/kvm/vmx.c > +++ b/arch/x86/kvm/vmx.c > @@ -7236,6 +7236,8 @@ static int nested_vmx_run(struct kvm_vcpu *vcpu, bool launch) > vcpu->cpu = cpu; > put_cpu(); > > + vmx_segment_cache_clear(vmx); > + > vmcs12->launch_state = 1; > > prepare_vmcs02(vcpu, vmcs12); > @@ -7504,6 +7506,8 @@ static void nested_vmx_vmexit(struct kvm_vcpu *vcpu) > vcpu->cpu = cpu; > put_cpu(); > > + vmx_segment_cache_clear(vmx); > + > /* if no vmcs02 cache requested, remove the one we used */ > if (VMCS02_POOL_SIZE == 0) > nested_free_vmcs02(vmx, vmx->nested.current_vmptr); > -- > 1.7.3.4 -- Gleb.