]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/speculation: Switch to IBRS when loading a non-retpoline module
authorAlexandre Chartre <alexandre.chartre@oracle.com>
Tue, 18 Sep 2018 09:30:26 +0000 (11:30 +0200)
committerBrian Maly <brian.maly@oracle.com>
Mon, 22 Oct 2018 17:21:18 +0000 (13:21 -0400)
commit8cab1ba2992da9e86197822fd68c7dccd58f664a
treee32e2c6f3723f4b61efbaf4c0f4eb07dccf0c070
parent16673071342a6c7524b51a6c25d4ef8ec69d6ff9
x86/speculation: Switch to IBRS when loading a non-retpoline module

When retpoline is used and a non-retpoline module gets loaded, IBRS
is enabled in addition of retpoline. Now that we can dynamically
disable retpoline, do it and use IBRS only. That way, IBRS and
retpoline will never be enabled together.

Changes are located in kernel/module.c. Additional changes are from
parts of UEK5 commit d75554157882d9b4df91f0b2bbc4907e2731781e
("x86/speculation: Add sysfs entry to enable/disable retpoline")
to provide the mechanism for switching between retpoline and IBRS.

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/processor.h
arch/x86/kernel/cpu/bugs_64.c
arch/x86/kernel/cpu/spec_ctrl.c
kernel/module.c