Jesse Keating 7a32965
Jesse Keating 7a32965
Legacy hypervisors (RHEL 5.0 and RHEL 5.1) do not handle guest writes to
Jesse Keating 7a32965
cr4 gracefully. If a guest attempts to write a bit of cr4 that is
Jesse Keating 7a32965
unsupported, then the HV is so offended it crashes the domain. While
Jesse Keating 7a32965
later guest kernels (such as RHEL6) don't assume the HV supports all
Jesse Keating 7a32965
features, they do expect nicer responses. That assumption introduced
Jesse Keating 7a32965
code that probes whether or not xsave is supported early in the boot. So
Jesse Keating 7a32965
now when attempting to boot a RHEL6 guest on RHEL5.0 or RHEL5.1 an early
Jesse Keating 7a32965
crash will occur.
Jesse Keating 7a32965
Jesse Keating 7a32965
This patch is quite obviously an undesirable hack. The real fix for this
Jesse Keating 7a32965
problem should be in the HV, and is, in later HVs. However, to support
Jesse Keating 7a32965
running on old HVs, RHEL6 can take this small change. No impact will
Jesse Keating 7a32965
occur for running on any RHEL HV (not even RHEL 5.5 supports xsave).
Jesse Keating 7a32965
There is only potential for guest performance loss on upstream Xen.
Jesse Keating 7a32965
Jesse Keating 7a32965
---
Jesse Keating 7a32965
 arch/x86/xen/enlighten.c |    1 +
Jesse Keating 7a32965
 1 files changed, 1 insertions(+), 0 deletions(-)
Jesse Keating 7a32965
Jesse Keating 7a32965
diff --git a/arch/x86/xen/enlighten.c b/arch/x86/xen/enlighten.c
Jesse Keating 7a32965
index 52f8e19..6db3d67 100644
Jesse Keating 7a32965
--- a/arch/x86/xen/enlighten.c
Jesse Keating 7a32965
+++ b/arch/x86/xen/enlighten.c
Jesse Keating 7a32965
@@ -802,6 +802,7 @@ static void xen_write_cr4(unsigned long cr4)
Jesse Keating 7a32965
 {
Jesse Keating 7a32965
 	cr4 &= ~X86_CR4_PGE;
Jesse Keating 7a32965
 	cr4 &= ~X86_CR4_PSE;
Jesse Keating 7a32965
+	cr4 &= ~X86_CR4_OSXSAVE;
Jesse Keating 7a32965
 
Jesse Keating 7a32965
 	native_write_cr4(cr4);
Jesse Keating 7a32965
 }
Jesse Keating 7a32965
-- 
Jesse Keating 7a32965
1.6.6.1