linux/arch/mips/kvm
James Hogan a16f0642cc KVM: MIPS: Fix trace event to save PC directly
commit b3cffac04e upstream.

Currently the guest exit trace event saves the VCPU pointer to the
structure, and the guest PC is retrieved by dereferencing it when the
event is printed rather than directly from the trace record. This isn't
safe as the printing may occur long afterwards, after the PC has changed
and potentially after the VCPU has been freed. Usually this results in
the same (wrong) PC being printed for multiple trace events. It also
isn't portable as userland has no way to access the VCPU data structure
when interpreting the trace record itself.

Lets save the actual PC in the structure so that the correct value is
accessible later.

Fixes: 669e846e6c ("KVM/MIPS32: MIPS arch specific APIs for KVM")
Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: Marcelo Tosatti <mtosatti@redhat.com>
Cc: Gleb Natapov <gleb@kernel.org>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
Acked-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2015-03-18 13:31:28 +01:00
..
00README.txt KVM/MIPS32: Release notes and KVM module Makefile 2013-05-08 03:55:35 +02:00
Kconfig MIPS: kvm: Kconfig: Drop HAVE_KVM dependency from VIRTUALIZATION 2013-07-19 12:45:57 +02:00
Makefile KVM/MIPS32: Release notes and KVM module Makefile 2013-05-08 03:55:35 +02:00
kvm_cb.c KVM/MIPS32: Routines to handle specific traps/exceptions while executing the guest. 2013-05-08 03:55:36 +02:00
kvm_locore.S KVM: MIPS: Don't leak FPU/DSP to guest 2015-03-06 14:43:31 -08:00
kvm_mips.c KVM: MIPS: Don't leak FPU/DSP to guest 2015-03-06 14:43:31 -08:00
kvm_mips_comm.h KVM/MIPS32: Binary patching of select privileged instructions. 2013-05-09 17:48:22 +02:00
kvm_mips_commpage.c KVM/MIPS32: Binary patching of select privileged instructions. 2013-05-09 17:48:22 +02:00
kvm_mips_dyntrans.c KVM/MIPS32: Binary patching of select privileged instructions. 2013-05-09 17:48:22 +02:00
kvm_mips_emul.c MIPS: KVM: Pass reserved instruction exceptions to guest 2014-05-13 13:32:48 +02:00
kvm_mips_int.c KVM/MIPS32: Guest interrupt delivery. 2013-05-08 03:55:36 +02:00
kvm_mips_int.h KVM/MIPS32: Guest interrupt delivery. 2013-05-08 03:55:36 +02:00
kvm_mips_opcode.h KVM/MIPS32: Privileged instruction/target branch emulation. 2013-05-08 03:55:35 +02:00
kvm_mips_stats.c KVM/MIPS32: COP0 accesses profiling. 2013-05-08 03:55:36 +02:00
kvm_tlb.c mips: delete non-required instances of include <linux/init.h> 2014-01-24 22:39:56 +01:00
kvm_trap_emul.c mips/kvm: Fix ABI by moving manipulation of CP0 registers to KVM_{G,S}ET_ONE_REG 2013-06-03 10:58:54 +03:00
trace.h KVM: MIPS: Fix trace event to save PC directly 2015-03-18 13:31:28 +01:00