linux/arch/mips/kvm
James Hogan f049729c05 MIPS: KVM: Fix preemptable kvm_mips_get_*_asid() calls
There are a couple of places in KVM fault handling code which implicitly
use smp_processor_id() via kvm_mips_get_kernel_asid() and
kvm_mips_get_user_asid() from preemptable context. This is unsafe as a
preemption could cause the guest kernel ASID to be changed, resulting in
a host TLB entry being written with the wrong ASID.

Fix by disabling preemption around the kvm_mips_get_*_asid() call and
the corresponding kvm_mips_host_tlb_write().

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
2016-05-10 15:56:51 +02:00
..
00README.txt KVM/MIPS32: Release notes and KVM module Makefile 2013-05-08 03:55:35 +02:00
Kconfig rcu: Make SRCU optional by using CONFIG_SRCU 2015-01-06 11:04:29 -08:00
Makefile MIPS: KVM: Add base guest MSA support 2015-03-27 21:25:19 +00:00
callback.c MIPS: KVM: Convert EXPORT_SYMBOL to _GPL 2016-01-24 03:13:24 +01:00
commpage.c MIPS: KVM: Skip memory cleaning in kvm_mips_commpage_init() 2014-06-30 16:52:03 +02:00
commpage.h MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_" 2014-06-30 16:52:03 +02:00
dyntrans.c MIPS: KVM: Refactor added offsetof()s 2016-01-24 03:14:15 +01:00
emulate.c MIPS: KVM: Fix timer IRQ race when writing CP0_Compare 2016-05-10 15:56:50 +02:00
fpu.S MIPS: KVM: Add base guest FPU support 2015-03-27 21:25:14 +00:00
interrupt.c MIPS: Move Cause.ExcCode trap codes to mipsregs.h 2016-01-24 03:15:51 +01:00
interrupt.h MIPS: KVM: Rename files to remove the prefix "kvm_" and "kvm_mips_" 2014-06-30 16:52:03 +02:00
locore.S MIPS: KVM: Trivial whitespace and style fixes 2016-01-24 03:05:48 +01:00
mips.c Merge branch 'sched-core-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip 2016-03-14 19:14:06 -07:00
msa.S MIPS: KVM: Add base guest MSA support 2015-03-27 21:25:19 +00:00
stats.c MIPS: KVM: Add MSA exception handling 2015-03-27 21:25:20 +00:00
tlb.c MIPS: KVM: Fix preemptable kvm_mips_get_*_asid() calls 2016-05-10 15:56:51 +02:00
trace.h KVM: MIPS: Fix trace event to save PC directly 2015-03-02 19:17:52 -03:00
trap_emul.c MIPS: KVM: Fix timer IRQ race when writing CP0_Compare 2016-05-10 15:56:50 +02:00