diff options
author | Keir Fraser <keir@xen.org> | 2011-04-25 15:28:33 +0100 |
---|---|---|
committer | Keir Fraser <keir@xen.org> | 2011-04-25 15:28:33 +0100 |
commit | e9a24e2228e33743d1f0ef2ae3e9dbfa71bb9ac9 (patch) | |
tree | cbdc23cf1f6d2f698376f5b6fd9aac99942b50d0 | |
parent | 12587a3a895685a094be2bbd291c286944f139d6 (diff) | |
download | xen-e9a24e2228e33743d1f0ef2ae3e9dbfa71bb9ac9.tar.gz xen-e9a24e2228e33743d1f0ef2ae3e9dbfa71bb9ac9.tar.bz2 xen-e9a24e2228e33743d1f0ef2ae3e9dbfa71bb9ac9.zip |
libxc: Fill in XSAVE-related CPUID leaves for PV guests.
Signed-off-by: Keir Fraser <keir@xen.org>
xen-unstable changeset: 23248:16aac67e948c
xen-unstable date: Mon Apr 25 15:27:56 2011 +0100
-rw-r--r-- | tools/libxc/xc_cpuid_x86.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/tools/libxc/xc_cpuid_x86.c b/tools/libxc/xc_cpuid_x86.c index 150ca18066..44cc8398b3 100644 --- a/tools/libxc/xc_cpuid_x86.c +++ b/tools/libxc/xc_cpuid_x86.c @@ -355,8 +355,9 @@ static void xc_cpuid_pv_policy( const unsigned int *input, unsigned int *regs) { DECLARE_DOMCTL; - int guest_64bit, xsave_supported, xen_64bit = hypervisor_is_64bit(xch); + int guest_64bit, xen_64bit = hypervisor_is_64bit(xch); char brand[13]; + uint64_t xfeature_mask; xc_cpuid_brand_get(brand); @@ -371,7 +372,7 @@ static void xc_cpuid_pv_policy( domctl.cmd = XEN_DOMCTL_getvcpuextstate; domctl.domain = domid; do_domctl(xch, &domctl); - xsave_supported = (domctl.u.vcpuextstate.xfeature_mask != 0); + xfeature_mask = domctl.u.vcpuextstate.xfeature_mask; if ( (input[0] & 0x7fffffff) == 1 ) { @@ -402,7 +403,7 @@ static void xc_cpuid_pv_policy( clear_bit(X86_FEATURE_TM2, regs[2]); if ( !guest_64bit ) clear_bit(X86_FEATURE_CX16, regs[2]); - if ( !xsave_supported ) + if ( xfeature_mask == 0 ) { clear_bit(X86_FEATURE_XSAVE, regs[2]); clear_bit(X86_FEATURE_AVX, regs[2]); @@ -412,6 +413,11 @@ static void xc_cpuid_pv_policy( clear_bit(X86_FEATURE_DCA, regs[2]); set_bit(X86_FEATURE_HYPERVISOR, regs[2]); break; + + case 0x0000000d: + xc_cpuid_config_xsave(xch, domid, xfeature_mask, input, regs); + break; + case 0x80000001: if ( !guest_64bit ) { @@ -436,9 +442,9 @@ static void xc_cpuid_pv_policy( clear_bit(X86_FEATURE_NODEID_MSR, regs[2]); clear_bit(X86_FEATURE_TOPOEXT, regs[2]); break; + case 5: /* MONITOR/MWAIT */ case 0xa: /* Architectural Performance Monitor Features */ - case 0xd: /* XSAVE */ case 0x8000000a: /* SVM revision and features */ case 0x8000001b: /* Instruction Based Sampling */ case 0x8000001c: /* Light Weight Profiling */ |