From mboxrd@z Thu Jan 1 00:00:00 1970 From: Scott Wood Subject: Re: [RFC PATCH 6/6] KVM: PPC: Book3E: Enhance FPU laziness Date: Tue, 4 Jun 2013 17:53:52 -0500 Message-ID: <1370386432.748.22@snotra> References: <1370292868-2697-7-git-send-email-mihai.caraman@freescale.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii"; delsp=Yes; format=Flowed Content-Transfer-Encoding: 8BIT Cc: , , , Mihai Caraman To: Mihai Caraman Return-path: Received: from mail-db8lp0189.outbound.messaging.microsoft.com ([213.199.154.189]:21416 "EHLO db8outboundpool.messaging.microsoft.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754696Ab3FDWx7 convert rfc822-to-8bit (ORCPT ); Tue, 4 Jun 2013 18:53:59 -0400 In-Reply-To: <1370292868-2697-7-git-send-email-mihai.caraman@freescale.com> (from mihai.caraman@freescale.com on Mon Jun 3 15:54:28 2013) Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: On 06/03/2013 03:54:28 PM, Mihai Caraman wrote: > Adopt AltiVec approach to increase laziness by calling > kvmppc_load_guest_fp() > just before returning to guest instaed of each sched in. > > Signed-off-by: Mihai Caraman If you did this *before* adding Altivec it would have saved a question in an earlier patch. :-) > --- > arch/powerpc/kvm/booke.c | 1 + > arch/powerpc/kvm/e500mc.c | 2 -- > 2 files changed, 1 insertions(+), 2 deletions(-) > > diff --git a/arch/powerpc/kvm/booke.c b/arch/powerpc/kvm/booke.c > index 019496d..5382238 100644 > --- a/arch/powerpc/kvm/booke.c > +++ b/arch/powerpc/kvm/booke.c > @@ -1258,6 +1258,7 @@ int kvmppc_handle_exit(struct kvm_run *run, > struct kvm_vcpu *vcpu, > } else { > kvmppc_lazy_ee_enable(); > kvmppc_load_guest_altivec(vcpu); > + kvmppc_load_guest_fp(vcpu); > } > } > You should probably do these before kvmppc_lazy_ee_enable(). Actually, I don't think this is a good idea at all. As I understand it, you're not supposed to take kernel ownersship of floating point in non-atomic context, because an interrupt could itself call enable_kernel_fp(). Do you have benchmarks showing it's even worthwhile? -Scott