# HG changeset patch
# User Keir Fraser <keir@xxxxxxx>
# Date 1303741713 -3600
# Node ID 7361cc362d642e73b49c319e2263d6b4fe2fe011
# Parent ff57766584b9bdb6480eab3256ec40ad5cba27cf
libxc: Fill in XSAVE-related CPUID leaves for PV guests.
Signed-off-by: Keir Fraser <keir@xxxxxxx>
xen-unstable changeset: 23248:16aac67e948c
xen-unstable date: Mon Apr 25 15:27:56 2011 +0100
---
diff -r ff57766584b9 -r 7361cc362d64 tools/libxc/xc_cpuid_x86.c
--- a/tools/libxc/xc_cpuid_x86.c Mon Apr 25 13:38:51 2011 +0100
+++ b/tools/libxc/xc_cpuid_x86.c Mon Apr 25 15:28:33 2011 +0100
@@ -355,8 +355,9 @@
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 @@
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 @@
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 @@
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 @@
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 */
_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog
|