]> www.infradead.org Git - users/jedix/linux-maple.git/commit
x86/spec_ctrl: Add sysctl knobs to enable/disable SPEC_CTRL feature
authorKonrad Rzeszutek Wilk <konrad@kernel.org>
Thu, 4 Jan 2018 16:20:00 +0000 (11:20 -0500)
committerKirtikar Kashyap <kirtikar.kashyap@oracle.com>
Fri, 12 Jan 2018 18:19:56 +0000 (10:19 -0800)
commitcfa86e49c0eba93958cc4bf24e70f3194d30855b
tree617a0a778fa3a55e5b67e09fa8c430e3c6b0f0f1
parentbf9b9762d55bd22fe8e5ecbb874d8dcb71e9ecd5
x86/spec_ctrl: Add sysctl knobs to enable/disable SPEC_CTRL feature

There are 2 ways to control IBPB and IBRS

1. At boot time
        noibrs kernel boot parameter will disable IBRS usage
        noibpb kernel boot parameter will disable IBPB usage
Otherwise if the above parameters are not specified, the system
will enable ibrs and ibpb usage if the cpu supports it.

2. At run time
        echo 0 > /proc/sys/kernel/ibrs_enabled will turn off IBRS
        echo 1 > /proc/sys/kernel/ibrs_enabled will turn on IBRS in kernel
        echo 2 > /proc/sys/kernel/ibrs_enabled will turn on IBRS in both userspace and kernel

Orabug: 27344012
CVE: CVE-2017-5715

Signed-off-by: Tim Chen <tim.c.chen@linux.intel.com>
Signed-off-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
[Backport: This completes the scaffolding work done in the earlier
 patch which had the same title]

Reviewed-by: John Haxby <john.haxby@oracle.com>
Signed-off-by: Kirtikar Kashyap <kirtikar.kashyap@oracle.com>
arch/x86/include/asm/mwait.h
arch/x86/include/asm/spec_ctrl.h
arch/x86/kernel/cpu/intel.c
arch/x86/kernel/smpboot.c
arch/x86/kvm/vmx.c
kernel/sysctl.c