lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <20091008091202.GB14073@amd.com>
Date:	Thu, 8 Oct 2009 11:12:02 +0200
From:	Joerg Roedel <joerg.roedel@....com>
To:	Marcelo Tosatti <mtosatti@...hat.com>
CC:	Avi Kivity <avi@...hat.com>, kvm@...r.kernel.org,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH 03/10] KVM: SVM: Move nested INTR #vmexit into
 preemtible code

On Wed, Oct 07, 2009 at 05:58:52PM -0300, Marcelo Tosatti wrote:
> On Wed, Oct 07, 2009 at 04:31:21PM +0200, Joerg Roedel wrote:
> > This patch makes use of the KVM_REQ_VMEXIT to move the
> > emulation of #vmexit(INTR) out of non-preemptible code.
> > 
> > Signed-off-by: Joerg Roedel <joerg.roedel@....com>
> > ---
> >  arch/x86/kvm/svm.c |   18 ++++++++++++++++--
> >  1 files changed, 16 insertions(+), 2 deletions(-)
> > 
> > diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
> > index b6ce1a9..7015680 100644
> > --- a/arch/x86/kvm/svm.c
> > +++ b/arch/x86/kvm/svm.c
> > @@ -1379,8 +1379,14 @@ static inline int nested_svm_intr(struct vcpu_svm *svm)
> >  
> >  	svm->vmcb->control.exit_code = SVM_EXIT_INTR;
> >  
> > -	if (nested_svm_exit_handled(svm)) {
> > -		nsvm_printk("VMexit -> INTR\n");
> > +	if (svm->nested.intercept & 1ULL) {
> > +		/*
> > +		 * The #vmexit can't be emulated here directly because this
> > +		 * code path runs with irqs and preemtion disabled and a
> > +		 * #vmexit emulation might sleep. Only set the request bit for
> > +		 * the #vmexit here.
> > +		 */
> > +		set_bit(KVM_REQ_VMEXIT, &svm->vcpu.requests);
> >  		return 1;
> >  	}
> 
> What if you keep this internal to SVM? Proceed to svm_vcpu_run and
> return, do the emulation on the exit handler.
> 
> Then there's no need for the request bit (VMX does that, see
> vmx_vcpu_run).

Yeah, right. This would be cleaner code. I will change it.

	Joerg


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ