* [Xen-4.0][PATCH] xsave: move xsave initialization code to a common place
@ 2011-10-24 20:50 Wei Huang
0 siblings, 0 replies; only message in thread
From: Wei Huang @ 2011-10-24 20:50 UTC (permalink / raw)
To: xen-devel@lists.xensource.com
[-- Attachment #1: Type: text/plain, Size: 385 bytes --]
Please apply this patch to xen-4.0 tree.
This patch moves xsave option setting and initilization to CPU common
file. Without this Xen would crash on __context_switch() on xsave-capable
AMD CPUs. The crash was due to cpu_has_xsave reports true in domain.c
while xsave space wasn't initialized. This patch is adopted from xen
upstream.
Signed-off-by: Wei Huang <wei.huang2@amd.com>
[-- Attachment #2: xen-4-xsave-init-code-path.txt --]
[-- Type: text/plain, Size: 2042 bytes --]
# HG changeset patch
# User Wei Huang <wei.huang2@amd.com>
# Date 1319469115 18000
# Branch patches
# Node ID c863dbcd714987ca8f1ab93ffbf61ea64b394f23
# Parent 71b96c0b083f3de46f566a406e0aee16a427950f
xsave: Move xsave initialization code to a common place
This patch moves xsave option setting and initilization to CPU common
file. Without this Xen would crash on __context_switch() on xsave-capable
AMD CPUs. The crash was due to cpu_has_xsave reports true in domain.c
while xsave space wasn't initialized. This patch is adopted from xen
upstream.
Signed-off-by: Wei Huang <wei.huang2@amd.com>
diff -r 71b96c0b083f -r c863dbcd7149 xen/arch/x86/cpu/common.c
--- a/xen/arch/x86/cpu/common.c Mon Oct 24 10:04:25 2011 -0500
+++ b/xen/arch/x86/cpu/common.c Mon Oct 24 10:11:55 2011 -0500
@@ -22,6 +22,9 @@
static int disable_x86_fxsr __cpuinitdata;
static int disable_x86_serial_nr __cpuinitdata;
+static int use_xsave;
+boolean_param("xsave", use_xsave);
+
struct cpu_dev * cpu_devs[X86_VENDOR_NUM] = {};
/*
@@ -391,6 +394,13 @@
if (this_cpu->c_init)
this_cpu->c_init(c);
+ /* Initialize xsave/xrstor features */
+ if ( !use_xsave )
+ clear_bit(X86_FEATURE_XSAVE, boot_cpu_data.x86_capability);
+
+ if ( cpu_has_xsave )
+ xsave_init();
+
/* Disable the PN if appropriate */
squash_the_stupid_serial_number(c);
diff -r 71b96c0b083f -r c863dbcd7149 xen/arch/x86/cpu/intel.c
--- a/xen/arch/x86/cpu/intel.c Mon Oct 24 10:04:25 2011 -0500
+++ b/xen/arch/x86/cpu/intel.c Mon Oct 24 10:11:55 2011 -0500
@@ -30,9 +30,6 @@
integer_param("cpuid_mask_ecx", opt_cpuid_mask_ecx);
integer_param("cpuid_mask_edx", opt_cpuid_mask_edx);
-static int use_xsave;
-boolean_param("xsave", use_xsave);
-
#ifdef CONFIG_X86_INTEL_USERCOPY
/*
* Alignment at which movsl is preferred for bulk memory copies.
@@ -219,12 +216,6 @@
set_bit(X86_FEATURE_ARAT, c->x86_capability);
start_vmx();
-
- if ( !use_xsave )
- clear_bit(X86_FEATURE_XSAVE, boot_cpu_data.x86_capability);
-
- if ( cpu_has_xsave )
- xsave_init();
}
[-- Attachment #3: Type: text/plain, Size: 138 bytes --]
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xensource.com
http://lists.xensource.com/xen-devel
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2011-10-24 20:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2011-10-24 20:50 [Xen-4.0][PATCH] xsave: move xsave initialization code to a common place Wei Huang
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.