From: "Jan Beulich" <JBeulich@novell.com>
To: Wei Huang2 <Wei.Huang2@amd.com>,
"xen-devel@lists.xensource.com" <xen-devel@lists.xensource.com>
Subject: Re: [PATCH 0 of 8] FPU LWP: patch description
Date: Mon, 09 May 2011 09:39:41 +0100 [thread overview]
Message-ID: <4DC7C46D0200007800040552@vpn.id2.novell.com> (raw)
In-Reply-To: <EE335F95F28A664DB4A21289D2AA053BD1601298@SAUSEXMBP01.amd.com>
>>> On 07.05.11 at 07:39, "Huang2, Wei" <Wei.Huang2@amd.com> wrote:
> This patch set supports AMD lightweight profiling for SVM guests. Because LWP
> isn't tracked by CR0.TS bit, we clean up the FPU code to handle lazy and
> unlazy FPU states differently. Lazy FPU state (such as SSE, YMM) is handled
> when #NM is triggered. Unlazy state, such as LWP, is saved and restored on
> each vcpu context switch.
>
> Per Keir's comments, I moved extended state related code into xstate.c and
> xstate.h. The FPU related code in i387.c was also cleaned up and has
> consistent names now. The comments from Jan Beulich were also taken. I added
> a new variable, nonlazy_xstate_used, to control whether save/restore nonlazy
> state.
>
> ====== i387.c ======
> * void vcpu_restore_fpu_eager(struct vcpu *v);
> * void vcpu_restore_fpu_lazy(struct vcpu *v);
> * void vcpu_save_fpu(struct vcpu *v);
> * int vcpu_init_fpu(struct vcpu *v);
> * void vcpu_destroy_fpu(struct vcpu *v);
>
> ====== xstate.c ======
> * void set_xcr0(u64 xfeatures);
> * uint64_t get_xcr0(void);
> * void xsave(struct vcpu *v, uint64_t mask);
> * void xrstor(struct vcpu *v, uint64_t mask);
> * bool_t xsave_enabled(const struct vcpu *v);
> * void xstate_free_save_area(struct vcpu *v);
> * int xstate_alloc_save_area(struct vcpu *v);
> * void xstate_init(void);
>
>
> This code has been tested on real hardware. Please comment.
Thanks, Wei - this looks good now to me.
Jan
>
> -Wei
>
>
> b/xen/arch/x86/xstate.c | 188 +++++++++++++++
> b/xen/include/asm-x86/xstate.h | 72 +++++
> tools/libxc/xc_cpuid_x86.c | 6
> xen/arch/x86/Makefile | 1
> xen/arch/x86/acpi/suspend.c | 2
> xen/arch/x86/cpu/common.c | 4
> xen/arch/x86/domain.c | 29 --
> xen/arch/x86/domctl.c | 2
> xen/arch/x86/hvm/hvm.c | 3
> xen/arch/x86/hvm/svm/svm.c | 75 ++++++
> xen/arch/x86/hvm/svm/vmcb.c | 5
> xen/arch/x86/hvm/vmx/vmcs.c | 1
> xen/arch/x86/hvm/vmx/vmx.c | 2
> xen/arch/x86/i387.c | 450 ++++++++++++++++---------------------
> xen/arch/x86/traps.c | 3
> xen/include/asm-x86/cpufeature.h | 2
> xen/include/asm-x86/domain.h | 5
> xen/include/asm-x86/hvm/svm/vmcb.h | 3
> xen/include/asm-x86/i387.h | 71 -----
> xen/include/asm-x86/msr-index.h | 4
> 20 files changed, 573 insertions(+), 355 deletions(-)
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xensource.com
> http://lists.xensource.com/xen-devel
next prev parent reply other threads:[~2011-05-09 8:39 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <patchbomb.1304747132@weisles1164.amd.com>
2011-05-07 5:39 ` [PATCH 0 of 8] FPU LWP: patch description Huang2, Wei
2011-05-09 8:39 ` Jan Beulich [this message]
[not found] ` <439311a108d71aba1580.1304747133@weisles1164.amd.com>
2011-05-07 5:40 ` [PATCH 1 of 8] FPU: extract extended related code into xstate.h and xstate.c Huang2, Wei
[not found] ` <eb6f1c5d0c7e688df083.1304747134@weisles1164.amd.com>
2011-05-07 5:40 ` [PATCH 2 of 8] FPU: create FPU init and destroy functions Huang2, Wei
[not found] ` <5560826d130f143c8aec.1304747135@weisles1164.amd.com>
2011-05-07 5:41 ` [PATCH 3 of 8] FPU: clean up FPU context save function Huang2, Wei
[not found] ` <5badff7cda6b4af71991.1304747136@weisles1164.amd.com>
2011-05-07 5:42 ` [PATCH 4 of 8] FPU: clean up FPU context restore function Huang2, Wei
[not found] ` <ab7d2191421fbf95313e.1304747137@weisles1164.amd.com>
2011-05-07 5:42 ` [PATCH 5 of 8] FPU: add mask parameter to xsave and xrstor Huang2, Wei
[not found] ` <e58b1d06aabe5c0aa26f.1304747138@weisles1164.amd.com>
2011-05-07 5:42 ` [PATCH 6 of 8] FPU: create lazy and non-lazy FPU restore functions Huang2, Wei
2011-05-09 8:37 ` Jan Beulich
[not found] ` <92b0ed16c09da1fb24f5.1304747139@weisles1164.amd.com>
2011-05-07 5:43 ` [PATCH 7 of 8] LWP: export LWP related CPUID to AMD SVM guest Huang2, Wei
[not found] ` <ea027ce41fb45a619d39.1304747140@weisles1164.amd.com>
2011-05-07 5:43 ` [PATCH 8 of 8] LWP: Add LWP support for SVM guests Huang2, Wei
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=4DC7C46D0200007800040552@vpn.id2.novell.com \
--to=jbeulich@novell.com \
--cc=Wei.Huang2@amd.com \
--cc=xen-devel@lists.xensource.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).