Skip to content

RFC lwp: adding support for AMD lightweight profiling

Wei Huang xen-devel 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 RFC Latest5 patches 6 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5lwp: adding support for AMD lightweight profilingtools/libxc/xc_cpuid_x86.c+23 -50 replies
2/5lwp: adding support for AMD lightweight profilingxen/arch/x86/i387.c xen/include/asm-x86/i387.h+18 -90 replies
3/5lwp: adding support for AMD lightweight profilingxen/include/asm-x86/cpufeature.h xen/include/asm-x86/msr-index.h+6 -00 replies
4/5lwp: adding support for AMD lightweight profilingxen/arch/x86/domain.c xen/arch/x86/i387.c xen/include/asm-x86/i387.h+54 -14 replies
5/5lwp: adding support for AMD lightweight profilingxen/arch/x86/hvm/svm/svm.c xen/arch/x86/hvm/svm/vmcb.c xen/arch/x86/i387.c +1 more+73 -32 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5][RFC] lwp: adding support for AMD lightweight profiling

Hi,

The following patch set is to enable lightweight profiling for AMD CPUs. Note that they are targeted at Xen-4.1 beyond. But I am posting them now for comments. The changes are summarized as the following:

1. The patches extend CPUID leaves (in tools) from 0x80000008 to 0x8000001c. The idea of this change was borrowed from Christoph Egger's nested virtualization tools patch.
2. Because TS doesn't track LWP xsave area, we have to save and restore this area on every domain_context_switch. For this purpose, we add a new parameter in xsave/xrstor function to specify the save/restore area in EAX:EDX. We check some bits (xsave_read.hdr and lwp_cfg MSR) to avoid unnecessary save/restore. A similar idea was proposed to Linux kernel by Hans Rosenfeld.
3. Inside svm.c, we keep track of lwp_cfg MSR for various purposes. In comparison, lwp_cbaddr is handed by xsave/xrstor automatically.

Please comment. I would start to submit a formal one after 4.1 is closed.

Thanks,
-Wei