public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Improve retpoline for Skylake
@ 2018-01-12 18:45 Andi Kleen
  2018-01-12 18:45 ` [PATCH 1/4] x86/retpoline: Add new mode RETPOLINE_UNDERFLOW Andi Kleen
                   ` (4 more replies)
  0 siblings, 5 replies; 20+ messages in thread
From: Andi Kleen @ 2018-01-12 18:45 UTC (permalink / raw)
  To: tglx
  Cc: x86, dwmw, linux-kernel, pjt, torvalds, gregkh, peterz, luto,
	thomas.lendacky, arjan.van.de.ven

[This is an alternative to David's earlier patch to only
handle context switch. It handles more cases.]

Skylake needs some additional protections over plain RETPOLINE
for Spectre_v2.

The CPU can fall back to the potentially poisioned indirect branch
predictor when the return buffer underflows.

This patch kit extends RETPOLINE to guard against many (but not
all) of such cases by filling the return buffer.

- Context switch when switching from shallow to deeper call chain
- Idle which clears the return buffer
- Interrupts which cause deep call chains

This is done with a new SPECTRE_V2 defense mode and feature flag.

The mitigations are only enabled on Skylake, patched out
on other CPUs.

Git tree at

git://git.kernel.org/pub/scm/linux/kernel/git/ak/linux-misc.git spec/skl-rsb-3

Against current tip/x86/pti

v1: Initial post, but containing some patches posted earlier, but
reworked.

^ permalink raw reply	[flat|nested] 20+ messages in thread

end of thread, other threads:[~2018-01-15 18:10 UTC | newest]

Thread overview: 20+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-01-12 18:45 Improve retpoline for Skylake Andi Kleen
2018-01-12 18:45 ` [PATCH 1/4] x86/retpoline: Add new mode RETPOLINE_UNDERFLOW Andi Kleen
2018-01-12 22:13   ` Dominik Brodowski
2018-01-12 22:57     ` Andi Kleen
2018-01-12 18:45 ` [PATCH 2/4] x86/retpoline: Avoid return buffer underflows on context switch Andi Kleen
2018-01-12 18:45 ` [PATCH 3/4] x86/retpoline: Fill return buffer after idle Andi Kleen
2018-01-12 18:45 ` [PATCH 4/4] x86/retpoline: Fill return buffer on interrupt return to kernel Andi Kleen
2018-01-12 19:12 ` Improve retpoline for Skylake David Woodhouse
2018-01-12 19:21   ` Andi Kleen
2018-01-12 22:03     ` Henrique de Moraes Holschuh
2018-01-15  8:26       ` Jon Masters
2018-01-15  9:06         ` David Woodhouse
2018-01-15 10:03         ` Thomas Gleixner
2018-01-15 10:20           ` David Woodhouse
2018-01-15 16:57         ` Andy Lutomirski
2018-01-15 17:38           ` Andrew Cooper
2018-01-15 17:56             ` Van De Ven, Arjan
2018-01-15 18:06             ` Andy Lutomirski
2018-01-15 18:07               ` David Woodhouse
2018-01-15 18:10                 ` Andy Lutomirski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox