kernel-hacking-2024-linux-s.../arch/x86
Suresh Siddha 45a94d7cd4 x86, cpuid: Add "volatile" to asm in native_cpuid()
xsave_cntxt_init() does something like:

	cpuid(0xd, ..);	// find out what features FP/SSE/.. etc are supported

	xsetbv();	// enable the features known to OS

	cpuid(0xd, ..);	// find out the size of the context for features enabled

Depending on what features get enabled in xsetbv(), value of the
cpuid.eax=0xd.ecx=0.ebx changes correspondingly (representing the
size of the context that is enabled).

As we don't have volatile keyword for native_cpuid(), gcc 4.1.2
optimizes away the second cpuid and the kernel continues to use
the cpuid information obtained before xsetbv(), ultimately leading to kernel
crash on processors supporting more state than the legacy FP/SSE.

Add "volatile" for native_cpuid().

Signed-off-by: Suresh Siddha <suresh.b.siddha@intel.com>
LKML-Reference: <1261009542.2745.55.camel@sbs-t61.sc.intel.com>
Cc: stable@kernel.org
Signed-off-by: H. Peter Anvin <hpa@zytor.com>
2009-12-16 16:30:57 -08:00
..
boot x86: Regex support and known-movable symbols for relocs, fix _end 2009-12-14 13:55:20 -08:00
configs
crypto
ia32
include/asm x86, cpuid: Add "volatile" to asm in native_cpuid() 2009-12-16 16:30:57 -08:00
kernel x86, amd: Get multi-node CPU info from NodeId MSR instead of PCI config space 2009-12-16 15:06:23 -08:00
kvm x86: i8254.c: Add pr_fmt(fmt) 2009-12-10 08:57:50 +01:00
lguest
lib x86, msr: msrs_alloc/free for CONFIG_SMP=n 2009-12-16 15:36:32 -08:00
math-emu
mm x86: Fix build warning in arch/x86/mm/mmio-mod.c 2009-12-14 08:55:43 +01:00
oprofile
pci
power
tools x86: Fix kprobes build with non-gawk awk 2009-12-15 20:35:49 +01:00
vdso
video
xen Merge branch 'bugfix' of git://git.kernel.org/pub/scm/linux/kernel/git/jeremy/xen 2009-12-10 09:35:02 -08:00
Kbuild
Kconfig Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:38:11 -08:00
Kconfig.cpu Merge branch 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:27:33 -08:00
Kconfig.debug
Makefile
Makefile_32.cpu Merge branch 'x86-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2009-12-08 13:38:11 -08:00