diff options
author | Borislav Petkov <bp@suse.de> | 2015-04-05 00:07:42 +0300 |
---|---|---|
committer | Ingo Molnar <mingo@kernel.org> | 2015-04-06 10:24:09 +0300 |
commit | 69df353ff305805fc16082d0c5bfa6e20fa8b863 (patch) | |
tree | 2d6377b1a094d38e0993ba94c0b9a72d3ff716b5 /arch/x86/xen | |
parent | fc3e958a2b552fe6210e6de3bebb4348156a0b5f (diff) | |
download | linux-69df353ff305805fc16082d0c5bfa6e20fa8b863.tar.xz |
x86/alternatives: Guard NOPs optimization
Take a look at the first instruction byte before optimizing the NOP -
there might be something else there already, like the ALTERNATIVE_2()
in rdtsc_barrier() which NOPs out on AMD even though we just
patched in an MFENCE.
This happens because the alternatives sees X86_FEATURE_MFENCE_RDTSC,
AMD CPUs set it, we patch in the MFENCE and right afterwards it sees
X86_FEATURE_LFENCE_RDTSC which AMD CPUs don't set and we blindly
optimize the NOP.
Checking whether at least the first byte is 0x90 prevents that.
Signed-off-by: Borislav Petkov <bp@suse.de>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Borislav Petkov <bp@alien8.de>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Denys Vlasenko <dvlasenk@redhat.com>
Cc: H. Peter Anvin <hpa@zytor.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/1428181662-18020-1-git-send-email-bp@alien8.de
Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'arch/x86/xen')
0 files changed, 0 insertions, 0 deletions