]> git.baikalelectronics.ru Git - kernel.git/commit
x86: Specify a size for the cmp in the NMI handler
authorSteven Rostedt <srostedt@redhat.com>
Mon, 20 Feb 2012 20:29:34 +0000 (15:29 -0500)
committerSteven Rostedt <rostedt@goodmis.org>
Tue, 21 Feb 2012 00:45:26 +0000 (19:45 -0500)
commit78be42e1a87c86d0544c29ee05a57780e1f78ba1
tree67a44b0f4a694469babe2aa13786c206d382d228
parent16c9622e4b28d56a61c31655c52badbdfd045133
x86: Specify a size for the cmp in the NMI handler

Linus noticed that the cmp used to check if the code segment is
__KERNEL_CS or not did not specify a size. Perhaps it does not matter
as H. Peter Anvin noted that user space can not set the bottom two
bits of the %cs register. But it's best not to let the assembly choose
and change things between different versions of gas, but instead just
pick the size.

Four bytes are used to compare the saved code segment against
__KERNEL_CS. Perhaps this might mess up Xen, but we can fix that when
the time comes.

Also I noticed that there was another non-specified cmp that checks
the special stack variable if it is 1 or 0. This too probably doesn't
matter what cmp is used, but this patch uses cmpl just to make it non
ambiguous.

Link: http://lkml.kernel.org/r/CA+55aFxfAn9MWRgS3O5k2tqN5ys1XrhSFVO5_9ZAoZKDVgNfGA@mail.gmail.com
Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Cc: H. Peter Anvin <hpa@zytor.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
arch/x86/kernel/entry_64.S