]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/speculation: Use static key to enable/disable retpoline
authorAlexandre Chartre <alexandre.chartre@oracle.com>
Thu, 30 Aug 2018 13:51:47 +0000 (15:51 +0200)
committerBrian Maly <brian.maly@oracle.com>
Mon, 22 Oct 2018 17:21:17 +0000 (13:21 -0400)
commit92296f5f9b6ed55d3961727731fafda0f68cb344
treed6ae9046e57b63a4b2dc2420e8df29778c968df3
parentd9fd25024bc89a28158e11162355a3f9ce6a9810
x86/speculation: Use static key to enable/disable retpoline

Change the way retpoline is enabled.

Up to now, the retpoline feature was enabled using alternatives
depending whether the X86_FEATURE_RETPOLINE cpu capability was set
or not. The usage of alternatives prevented enabling or disabling
after the boot sequence.

Now, retpoline is enabled using jump labels controlled by the
retpoline_enabled_key static key. This enables retpoline to be
selectively enabled or disabled even after the boot sequence.

Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Reviewed-by: Zhenzhong Duan <zhenzhong.duan@oracle.com>
(cherry picked from UEK5 commit 3d01785866e2a73119ed4e35d5cb6b02edf5957a)

Orabug: 28607548

Signed-off-by: Alexandre Chartre <alexandre.chartre@oracle.com>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Mihai Carabas <mihai.carabas@oracle.com>
Reviewed-by: Boris Ostrovsky <boris.ostrovsky@oracle.com>
Signed-off-by: Brian Maly <brian.maly@oracle.com>
arch/x86/include/asm/nospec-branch.h
arch/x86/include/asm/spec_ctrl.h
arch/x86/kernel/cpu/bugs_64.c