]> git.baikalelectronics.ru Git - kernel.git/commit
x86/speculation/swapgs: Exclude ATOMs from speculation through SWAPGS
authorThomas Gleixner <tglx@linutronix.de>
Wed, 17 Jul 2019 19:18:59 +0000 (21:18 +0200)
committerThomas Gleixner <tglx@linutronix.de>
Sun, 28 Jul 2019 19:39:55 +0000 (21:39 +0200)
commit559c157c5f35f4b8221256c03a3775a5b48fe751
tree952026488243d73a5b57f389f6f093398860119d
parentb36e7a3503cfa20e6ff829cd651fa943473e3bc8
x86/speculation/swapgs: Exclude ATOMs from speculation through SWAPGS

Intel provided the following information:

 On all current Atom processors, instructions that use a segment register
 value (e.g. a load or store) will not speculatively execute before the
 last writer of that segment retires. Thus they will not use a
 speculatively written segment value.

That means on ATOMs there is no speculation through SWAPGS, so the SWAPGS
entry paths can be excluded from the extra LFENCE if PTI is disabled.

Create a separate bug flag for the through SWAPGS speculation and mark all
out-of-order ATOMs and AMD/HYGON CPUs as not affected. The in-order ATOMs
are excluded from the whole mitigation mess anyway.

Reported-by: Andrew Cooper <andrew.cooper3@citrix.com>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Tyler Hicks <tyhicks@canonical.com>
Reviewed-by: Josh Poimboeuf <jpoimboe@redhat.com>
arch/x86/include/asm/cpufeatures.h
arch/x86/kernel/cpu/bugs.c
arch/x86/kernel/cpu/common.c