From: Avi Kivity <avi@redhat.com>
To: Xudong Hao <xudong.hao@intel.com>
Cc: kvm@vger.kernel.org, xiantao.zhang@intel.com
Subject: Re: [PATCH] kvm/fpu: Enable fully eager restore kvm FPU
Date: Thu, 16 Aug 2012 12:08:17 +0300 [thread overview]
Message-ID: <502CB881.1040807@redhat.com> (raw)
In-Reply-To: <1345094044-28962-1-git-send-email-xudong.hao@intel.com>
On 08/16/2012 08:14 AM, Xudong Hao wrote:
> Enable KVM FPU fully eager restore, if there is other FPU state which isn't tracked by
> CR0.TS bit.
>
> Tested with these cases:
> 1) SpecCPU2000 workload( 1 VM, 2 VMs)
> 2) Program for floating point caculate
Is the motivation performance or correctness?
> +
> struct kvm_memory_alias {
> __u32 slot; /* this has a different namespace than memory slots */
> __u32 flags;
> diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c
> index b6379e5..2e628e5 100644
> --- a/arch/x86/kvm/x86.c
> +++ b/arch/x86/kvm/x86.c
> @@ -5966,7 +5966,18 @@ void kvm_put_guest_fpu(struct kvm_vcpu *vcpu)
> vcpu->guest_fpu_loaded = 0;
> fpu_save_init(&vcpu->arch.guest_fpu);
> ++vcpu->stat.fpu_reload;
> - kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
> + /*
> + * Currently KVM trigger FPU restore by #NM (via CR0.TS),
> + * till now only XCR0.bit0, XCR0.bit1, XCR0.bit2 is tracked
> + * by TS bit, there might be other FPU state is not tracked
> + * by TS bit.
Which state is that?
> Here it only make FPU deactivate request and do
> + * FPU lazy restore for these cases: 1)xsave isn't enabled
> + * in guest, 2)all guest FPU states can be tracked by TS bit.
> + * For others, doing fully FPU eager restore.
> + */
> + if (!kvm_read_cr4_bits(vcpu, X86_CR4_OSXSAVE) ||
> + !(vcpu->arch.xcr0 & ~KVM_XSTATE_LAZY))
> + kvm_make_request(KVM_REQ_DEACTIVATE_FPU, vcpu);
> trace_kvm_fpu(0);
> }
Is there no way to track accesses to this extended state?
Although I expect that on modern hardware which exits rarely, eager fpu
reload might be more performant.
--
error compiling committee.c: too many arguments to function
next prev parent reply other threads:[~2012-08-16 9:08 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-16 5:14 [PATCH] kvm/fpu: Enable fully eager restore kvm FPU Xudong Hao
2012-08-16 9:08 ` Avi Kivity [this message]
2012-08-16 9:48 ` Hao, Xudong
2012-08-16 10:59 ` Avi Kivity
2012-08-16 11:50 ` Hao, Xudong
2012-08-20 9:24 ` Roedel, Joerg
2012-08-20 10:08 ` Avi Kivity
2012-08-20 10:14 ` Roedel, Joerg
2012-08-20 10:43 ` Avi Kivity
2012-08-20 10:53 ` Roedel, Joerg
2012-08-23 8:51 ` Hao, Xudong
2012-09-03 9:23 ` Avi Kivity
2012-09-05 1:10 ` 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=502CB881.1040807@redhat.com \
--to=avi@redhat.com \
--cc=kvm@vger.kernel.org \
--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.