]> git.baikalelectronics.ru Git - kernel.git/commit
KVM: MIPS/VZ: Trace guest mode changes
authorJames Hogan <james.hogan@imgtec.com>
Tue, 14 Mar 2017 10:15:40 +0000 (10:15 +0000)
committerJames Hogan <james.hogan@imgtec.com>
Tue, 28 Mar 2017 13:54:00 +0000 (14:54 +0100)
commit3e2ec6fd1249f3d30a0d5f79018c165d1dfad05a
tree89b4d3c4b8c0f549d9aa9c4f379142bce3e85bed
parent6b89dfcf1b200c5892dc7fe392df9717d1607ae3
KVM: MIPS/VZ: Trace guest mode changes

Create a trace event for guest mode changes, and enable VZ's
GuestCtl0.MC bit after the trace event is enabled to trap all guest mode
changes.

The MC bit causes Guest Hardware Field Change (GHFC) exceptions whenever
a guest mode change occurs (such as an exception entry or return from
exception), so we need to handle this exception now. The MC bit is only
enabled when restoring register state, so enabling the trace event won't
take immediate effect.

Tracing guest mode changes can be particularly handy when trying to work
out what a guest OS gets up to before something goes wrong, especially
if the problem occurs as a result of some previous guest userland
exception which would otherwise be invisible in the trace.

Signed-off-by: James Hogan <james.hogan@imgtec.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>
Cc: "Radim Krčmář" <rkrcmar@redhat.com>
Cc: Steven Rostedt <rostedt@goodmis.org>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Ralf Baechle <ralf@linux-mips.org>
Cc: linux-mips@linux-mips.org
Cc: kvm@vger.kernel.org
arch/mips/kvm/mips.c
arch/mips/kvm/trace.h
arch/mips/kvm/vz.c