alistair23-linux/arch
Borislav Petkov 34bfab0eaf x86/alternatives: Do not use sync_core() to serialize I$
We use sync_core() in the alternatives code to stop speculative
execution of prefetched instructions because we are potentially changing
them and don't want to execute stale bytes.

What it does on most machines is call CPUID which is a serializing
instruction. And that's expensive.

However, the instruction cache is serialized when we're on the local CPU
and are changing the data through the same virtual address. So then, we
don't need the serializing CPUID but a simple control flow change. Last
being accomplished with a CALL/RET which the noinline causes.

Suggested-by: Linus Torvalds <torvalds@linux-foundation.org>
Signed-off-by: Borislav Petkov <bp@suse.de>
Reviewed-by: Andy Lutomirski <luto@kernel.org>
Cc: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: Andy Lutomirski <luto@amacapital.net>
Cc: Brian Gerst <brgerst@gmail.com>
Cc: Henrique de Moraes Holschuh <hmh@hmh.eng.br>
Cc: Matthew Whitehead <tedheadster@gmail.com>
Cc: One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/20161203150258.vwr5zzco7ctgc4pe@pd.tnic
Signed-off-by: Ingo Molnar <mingo@kernel.org>
2016-12-20 09:36:42 +01:00
..
alpha Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2016-12-14 14:09:48 -08:00
arc ARC updates for 4.10-rc1 (part 1) 2016-12-15 14:15:17 -08:00
arm MTD updates for v4.10-rc1: 2016-12-17 16:41:10 -08:00
arm64 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-18 11:12:53 -08:00
avr32 arch/avr32: add option to skip sync on DMA map 2016-12-14 16:04:07 -08:00
blackfin Merge branch 'akpm' (patches from Andrew) 2016-12-14 17:25:18 -08:00
c6x arch/c6x: add option to skip sync on DMA map and unmap 2016-12-14 16:04:07 -08:00
cris Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace 2016-12-14 14:09:48 -08:00
frv arch/frv: add option to skip sync on DMA map 2016-12-14 16:04:07 -08:00
h8300
hexagon arch/hexagon: Add option to skip DMA sync as a part of mapping 2016-12-14 16:04:07 -08:00
ia64 Merge branch 'x86-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-12-18 11:12:53 -08:00
m32r
m68k arch/m68k: add option to skip DMA sync as a part of mapping 2016-12-14 16:04:07 -08:00
metag arch/metag: add option to skip DMA sync as a part of map and unmap 2016-12-14 16:04:07 -08:00
microblaze arch/microblaze: add option to skip DMA sync as a part of map and unmap 2016-12-14 16:04:07 -08:00
mips RTC for 4.10 2016-12-18 18:18:03 -08:00
mn10300
nios2 nios2 update for v4.10-rc1 2016-12-16 09:33:16 -08:00
openrisc arch/openrisc: add option to skip DMA sync as a part of mapping 2016-12-14 16:04:07 -08:00
parisc arch/parisc: add option to skip DMA sync as a part of map and unmap 2016-12-14 16:04:07 -08:00
powerpc Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs 2016-12-17 18:44:00 -08:00
s390 Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux 2016-12-16 09:05:25 -08:00
score
sh Merge branch 'akpm' (patches from Andrew) 2016-12-14 17:25:18 -08:00
sparc sparc: implement watchdog_nmi_enable and watchdog_nmi_disable 2016-12-14 16:04:08 -08:00
tile Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile 2016-12-17 17:05:49 -08:00
um Merge branch 'for-linus-4.10-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/uml 2016-12-16 09:35:03 -08:00
unicore32
x86 x86/alternatives: Do not use sync_core() to serialize I$ 2016-12-20 09:36:42 +01:00
xtensa arch/xtensa: add option to skip DMA sync as a part of mapping 2016-12-14 16:04:08 -08:00
.gitignore
Kconfig