Skip to content

Commit

Permalink
xen: just completely disable XSAVE
Browse files Browse the repository at this point in the history
Some (old) versions of Xen just kill the domain if it tries to set any
unknown bits in CR4, so we can't reliably probe for OSXSAVE in
CR4.

Since Xen doesn't support XSAVE for guests at the moment, and no such
support is being worked on, there's no downside in just unconditionally
masking XSAVE support.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
  • Loading branch information
Jeremy Fitzhardinge authored and Konrad Rzeszutek Wilk committed Apr 6, 2011
1 parent d88885d commit 61f4237
Showing 1 changed file with 1 addition and 17 deletions.
18 changes: 1 addition & 17 deletions arch/x86/xen/enlighten.c
Original file line number Diff line number Diff line change
Expand Up @@ -250,23 +250,7 @@ static __init void xen_init_cpuid_mask(void)
~((1 << X86_FEATURE_APIC) | /* disable local APIC */
(1 << X86_FEATURE_ACPI)); /* disable ACPI */

ax = 1;
cx = 0;
xen_cpuid(&ax, &bx, &cx, &dx);

/* cpuid claims we support xsave; try enabling it to see what happens */
if (cx & (1 << (X86_FEATURE_XSAVE % 32))) {
unsigned long cr4;

set_in_cr4(X86_CR4_OSXSAVE);

cr4 = read_cr4();

if ((cr4 & X86_CR4_OSXSAVE) == 0)
cpuid_leaf1_ecx_mask &= ~(1 << (X86_FEATURE_XSAVE % 32));

clear_in_cr4(X86_CR4_OSXSAVE);
}
cpuid_leaf1_ecx_mask &= ~(1 << (X86_FEATURE_XSAVE % 32)); /* disable XSAVE */
}

static void xen_set_debugreg(int reg, unsigned long val)
Expand Down

0 comments on commit 61f4237

Please sign in to comment.