WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-devel

[Xen-devel] [PATCH] FPU LWP 0/8: patch description

To: "'xen-devel@xxxxxxxxxxxxxxxxxxx'" <xen-devel@xxxxxxxxxxxxxxxxxxx>, <keir@xxxxxxx>, Jan Beulich <JBeulich@xxxxxxxxxx>
Subject: [Xen-devel] [PATCH] FPU LWP 0/8: patch description
From: Wei Huang <wei.huang2@xxxxxxx>
Date: Tue, 3 May 2011 15:14:59 -0500
Cc:
Delivery-date: Tue, 03 May 2011 13:18:25 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
User-agent: Mozilla/5.0 (X11; U; Linux i686 (x86_64); en-US; rv:1.9.2.17) Gecko/20110414 Thunderbird/3.1.10
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.

====== 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.

-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         |   72 +++++
 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/hvm/svm/vmcb.h |    3
 xen/include/asm-x86/i387.h         |   71 -----
 xen/include/asm-x86/msr-index.h    |    4
 19 files changed, 566 insertions(+), 354 deletions(-)




_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] FPU LWP 0/8: patch description, Wei Huang <=