mirror of
https://github.com/xen-project/xen.git
synced 2026-10-29 10:40:03 +01:00
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
This commit is contained in:
1 parent
12587a3a89
commit
e9a24e2228
1 file changed
+10
-4
@@ -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 */
|
||||
|
||||