All of lore.kernel.org
 help / color / mirror / Atom feed
From: Avi Kivity <avi@redhat.com>
To: "Hao, Xudong" <xudong.hao@intel.com>
Cc: Marcelo Tosatti <mtosatti@redhat.com>,
	"kvm@vger.kernel.org" <kvm@vger.kernel.org>,
	"Zhang, Xiantao" <xiantao.zhang@intel.com>
Subject: Re: [PATCH v3] kvm/fpu: Enable fully eager restore kvm FPU
Date: Wed, 19 Sep 2012 13:23:30 +0300	[thread overview]
Message-ID: <50599D22.5070308@redhat.com> (raw)
In-Reply-To: <403610A45A2B5242BD291EDAE8B37D300FEC34AA@SHSMSX102.ccr.corp.intel.com>

On 09/18/2012 04:08 AM, Hao, Xudong wrote:
>> 
>> The objective of the change is to disable lazy fpu loading (that is,
>> host fpu loaded in guest and vice-versa), 

Not vice versa.  We allow the guest fpu loaded in the host, but save it
on heavyweight exit or task switch.

when some bit except the
>> initial tree bits set in guest XCR0 (initial tree being XSTATE_FP|XSTATE_SSE|
>> XSTATE_YMM). Yes?
>> 
> 
> Yes, it's just the object.
> 
>> If i get that right, then the suggestion seems to be:
>> 
>> static bool lazy_fpu_allowed()
>> {
>> 	return (vcpu->arch.xcr0 & ~((u64)KVM_XSTATE_LAZY));
>> }
>> 
> 
> That may be:
> 
> static bool lazy_fpu_allowed()
> {
> 	return !(vcpu->arch.xcr0 & ~((u64)KVM_XSTATE_LAZY));
> }

Shouldn't it depend on cr4.osxsave as well?

> 
>> On guest entry:
>>         if (!lazy_fpu_allowed(vcpu))
>>                 kvm_x86_ops->fpu_activate(vcpu);
> 

But we already have that:

	if (vcpu->fpu_active)
		kvm_load_guest_fpu(vcpu);

so why not manage fpu_active to be always set when needed?  I don't want
more checks in the entry path.

-- 
error compiling committee.c: too many arguments to function

  reply	other threads:[~2012-09-19 10:23 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-12  8:10 [PATCH v3] kvm/fpu: Enable fully eager restore kvm FPU Xudong Hao
2012-09-13 16:26 ` Marcelo Tosatti
2012-09-13 16:29   ` Marcelo Tosatti
2012-09-13 16:40     ` Avi Kivity
2012-09-17  2:07       ` Hao, Xudong
2012-09-17 13:30         ` Marcelo Tosatti
2012-09-18  1:08           ` Hao, Xudong
2012-09-19 10:23             ` Avi Kivity [this message]
2012-09-20  1:43               ` Hao, Xudong
2012-09-20  9:19                 ` Avi Kivity
2012-09-21  8:47                   ` Hao, Xudong
2012-09-23  9:03                     ` Avi Kivity
2012-09-14  8:54     ` Hao, Xudong
2012-09-14  9:35       ` Marcelo Tosatti
2012-09-13 16:38 ` Avi Kivity
2012-09-14  8:52   ` Hao, Xudong

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=50599D22.5070308@redhat.com \
    --to=avi@redhat.com \
    --cc=kvm@vger.kernel.org \
    --cc=mtosatti@redhat.com \
    --cc=xiantao.zhang@intel.com \
    --cc=xudong.hao@intel.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.