linux/arch/powerpc
Paul Mackerras e052d6eeed KVM: PPC: Book3S HV: Prohibit setting illegal transaction state in MSR
commit c20875a3e6 upstream.

Currently it is possible for userspace (e.g. QEMU) to set a value
for the MSR for a guest VCPU which has both of the TS bits set,
which is an illegal combination.  The result of this is that when
we execute a hrfid (hypervisor return from interrupt doubleword)
instruction to enter the guest, the CPU will take a TM Bad Thing
type of program interrupt (vector 0x700).

Now, if PR KVM is configured in the kernel along with HV KVM, we
actually handle this without crashing the host or giving hypervisor
privilege to the guest; instead what happens is that we deliver a
program interrupt to the guest, with SRR0 reflecting the address
of the hrfid instruction and SRR1 containing the MSR value at that
point.  If PR KVM is not configured in the kernel, then we try to
run the host's program interrupt handler with the MMU set to the
guest context, which almost certainly causes a host crash.

This closes the hole by making kvmppc_set_msr_hv() check for the
illegal combination and force the TS field to a safe value (00,
meaning non-transactional).

Signed-off-by: Paul Mackerras <paulus@samba.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
History 2016-01-31 11:23:31 -08:00
..
boot powerpc/boot: Specify ABI v2 when building an LE boot wrapper 2015-09-29 19:26:05 +02:00
configs powerpc: Remove the celleb support 2015-04-07 17:15:13 +10:00
crypto crypto: powerpc - move files to fix build error 2015-03-09 21:06:19 +11:00
include powerpc: Uncomment and make enable_kernel_vsx() routine available 2015-09-29 19:26:05 +02:00
kernel powerpc/rtas: Validate rtas.entry before calling enter_rtas() 2015-11-09 14:33:33 -08:00
kvm KVM: PPC: Book3S HV: Prohibit setting illegal transaction state in MSR 2016-01-31 11:23:31 -08:00
lib powerpc: Export __spin_yield 2015-04-21 15:21:28 +02:00
math-emu powerpc: Correct emulated mtfsf instruction 2014-04-07 10:33:11 +10:00
mm powerpc/mm: Recompute hash value after a failed update 2015-09-29 19:26:05 +02:00
net ppc: bpf: Add SKF_AD_CPU for ppc32 2015-02-20 15:19:43 -05:00
oprofile powerpc/oprofile: reduce mmap_sem hold for exe_file 2015-04-17 09:04:11 -04:00
perf powerpc/perf: Fix book3s kernel to userspace backtraces 2015-07-10 09:49:35 -07:00
platforms powerpc/MSI: Fix race condition in tearing down MSI interrupts 2015-10-22 14:43:24 -07:00
sysdev powerpc/MSI: Fix race condition in tearing down MSI interrupts 2015-10-22 14:43:24 -07:00
xmon powerpc updates for 3.20 2015-02-11 18:15:38 -08:00
Kconfig powerpc updates for 4.1 2015-04-16 13:53:32 -05:00
Kconfig.debug powerpc: Remove the celleb support 2015-04-07 17:15:13 +10:00
Makefile powerpc: Convert relocs_check to a shell script using grep 2015-03-23 14:47:39 +11:00
relocs_check.sh powerpc: Convert relocs_check to a shell script using grep 2015-03-23 14:47:39 +11:00