android_kernel_oneplus_msm8998/arch
KarimAllah Ahmed fc6aae9f40 KVM/VMX: Allow direct access to MSR_IA32_SPEC_CTRL
commit d28b387fb74da95d69d2615732f50cceb38e9a4d upstream.

[ Based on a patch from Ashok Raj <ashok.raj@intel.com> ]

Add direct access to MSR_IA32_SPEC_CTRL for guests. This is needed for
guests that will only mitigate Spectre V2 through IBRS+IBPB and will not
be using a retpoline+IBPB based approach.

To avoid the overhead of saving and restoring the MSR_IA32_SPEC_CTRL for
guests that do not actually use the MSR, only start saving and restoring
when a non-zero is written to it.

No attempt is made to handle STIBP here, intentionally. Filtering STIBP
may be added in a future patch, which may require trapping all writes
if we don't want to pass it through directly to the guest.

[dwmw2: Clean up CPUID bits, save/restore manually, handle reset]

Signed-off-by: KarimAllah Ahmed <karahmed@amazon.de>
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Reviewed-by: Darren Kenny <darren.kenny@oracle.com>
Reviewed-by: Konrad Rzeszutek Wilk <konrad.wilk@oracle.com>
Reviewed-by: Jim Mattson <jmattson@google.com>
Cc: Andrea Arcangeli <aarcange@redhat.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Jun Nakajima <jun.nakajima@intel.com>
Cc: kvm@vger.kernel.org
Cc: Dave Hansen <dave.hansen@intel.com>
Cc: Tim Chen <tim.c.chen@linux.intel.com>
Cc: Andy Lutomirski <luto@kernel.org>
Cc: Asit Mallick <asit.k.mallick@intel.com>
Cc: Arjan Van De Ven <arjan.van.de.ven@intel.com>
Cc: Greg KH <gregkh@linuxfoundation.org>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Dan Williams <dan.j.williams@intel.com>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Ashok Raj <ashok.raj@intel.com>
Link: https://lkml.kernel.org/r/1517522386-18410-5-git-send-email-karahmed@amazon.de
Signed-off-by: David Woodhouse <dwmw@amazon.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Ben Hutchings <ben.hutchings@codethink.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2018-12-17 21:55:13 +01:00
..
alpha arch/alpha, termios: implement BOTHER, IBSHIFT and termios2 2018-11-21 09:27:42 +01:00
arc arc: [devboards] Add support of NFSv3 ACL 2018-12-13 09:21:33 +01:00
arm ARM: OMAP1: ams-delta: Fix possible use of uninitialized field 2018-12-17 21:55:09 +01:00
arm64 arm64: remove no-op -p linker flag 2018-12-01 09:46:36 +01:00
avr32
blackfin pinctrl: adi2: Fix Kconfig build problem 2017-12-20 10:05:00 +01:00
c6x
cris
frv futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
h8300
hexagon hexagon: modify ffs() and fls() to return int 2018-10-10 08:52:12 +02:00
ia64 kbuild: Consolidate header generation from ASM offset information 2018-11-27 16:07:57 +01:00
m32r
m68k m68k: fix "bad page state" oops on ColdFire boot 2018-08-24 13:26:57 +02:00
metag
microblaze microblaze: Fix simpleImage format generation 2018-08-06 16:24:39 +02:00
mips mips: fix mips_get_syscall_arg o32 check 2018-12-13 09:21:30 +01:00
mn10300 mn10300/misalignment: Use SIGSEGV SEGV_MAPERR to report a failed user copy 2018-02-16 20:09:47 +01:00
nios2
openrisc kthread: fix boot hang (regression) on MIPS/OpenRISC 2018-09-19 22:48:55 +02:00
parisc parisc: Fix map_pages() to not overwrite existing pte entries 2018-11-21 09:27:30 +01:00
powerpc powerpc/numa: Suppress "VPHN is not supported" messages 2018-12-01 09:46:35 +01:00
s390 s390/cpum_cf: Reject request for sampling in event initialization 2018-12-17 21:55:09 +01:00
score
sh sh: New gcc support 2018-06-06 16:46:20 +02:00
sparc sparc: Fix single-pcr perf event counter management. 2018-11-21 09:27:30 +01:00
tile futex: Remove duplicated code and fix undefined behaviour 2018-05-26 08:48:50 +02:00
um um: Give start_idle_thread() a return code 2018-11-27 16:08:00 +01:00
unicore32
x86 KVM/VMX: Allow direct access to MSR_IA32_SPEC_CTRL 2018-12-17 21:55:13 +01:00
xtensa xtensa: fix coprocessor context offset definitions 2018-12-13 09:21:26 +01:00
.gitignore
Kconfig