]> git.karo-electronics.de Git - karo-tx-linux.git/commit
x86: mark read_crX() asm code as volatile
authorKirill Korotaev <dev@openvz.org>
Wed, 17 Oct 2007 16:04:33 +0000 (18:04 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Mon, 26 Nov 2007 17:42:31 +0000 (09:42 -0800)
commit420b463a199d10fc89f41f24fb8c60ed0181b4ad
treedf8b85ead3d18fef0429477361129cbc2ecb78e4
parent2e6792e31175f12538e49d72c6dc2fd6e3eb2791
x86: mark read_crX() asm code as volatile

patch c1217a75ea102d4e69321f210fab60bc47b9a48e in mainline.

x86: mark read_crX() asm code as volatile

Some gcc versions (I checked at least 4.1.1 from RHEL5 & 4.1.2 from gentoo)
can generate incorrect code with read_crX()/write_crX() functions mix up,
due to cached results of read_crX().

The small app for x8664 below compiled with -O2 demonstrates this
(i686 does the same thing):

Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
include/asm-i386/system.h
include/asm-x86_64/system.h