xen: mask XSAVE from cpuid
commit191216b9289ed02256086e6bab4f668112109399
authorJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Sun, 8 Mar 2009 01:09:27 +0000 (7 17:09 -0800)
committerJeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
Wed, 8 Apr 2009 18:51:46 +0000 (8 11:51 -0700)
tree1f9db4f838ab11d04b34f04f3ebd61ccb1180409
parent1207cf8eb99d8c699919e352292bdf1f519fbba5
xen: mask XSAVE from cpuid

Xen leaves XSAVE set in cpuid, but doesn't allow cr4.OSXSAVE
to be set.  This confuses the kernel and it ends up crashing on
an xsetbv instruction.

At boot time, try to set cr4.OSXSAVE, and mask XSAVE out of
cpuid it we can't.  This will produce a spurious error from Xen,
but allows us to support XSAVE if/when Xen does.

This also factors out the cpuid mask decisions to boot time.

Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
arch/x86/xen/enlighten.c