@@ -3994,23 +3994,27 @@ static void perform_access(struct kvm_vcpu *vcpu,
struct sys_reg_params *params,
const struct sys_reg_desc *r)
{
- trace_kvm_sys_access(*vcpu_pc(vcpu), params, r);
+ bool skip;
/* Check for regs disabled by runtime config */
if (sysreg_hidden(vcpu, r)) {
kvm_inject_undefined(vcpu);
- return;
+ skip = false;
+ } else {
+ /*
+ * Not having an accessor means that we have configured a trap
+ * that we don't know how to handle. This certainly qualifies
+ * as a gross bug that should be fixed right away.
+ */
+ BUG_ON(!r->access);
+
+ /* Skip instruction if instructed so */
+ skip = r->access(vcpu, params, r);
}
- /*
- * Not having an accessor means that we have configured a trap
- * that we don't know how to handle. This certainly qualifies
- * as a gross bug that should be fixed right away.
- */
- BUG_ON(!r->access);
+ trace_kvm_sys_access(*vcpu_pc(vcpu), params, r);
- /* Skip instruction if instructed so */
- if (likely(r->access(vcpu, params, r)))
+ if (likely(skip))
kvm_incr_pc(vcpu);
}
@@ -88,6 +88,7 @@ TRACE_EVENT(kvm_sys_access,
TP_STRUCT__entry(
__field(unsigned long, vcpu_pc)
+ __field(u64, regval)
__field(bool, is_write)
__field(const char *, name)
__field(u8, Op0)
@@ -99,6 +100,7 @@ TRACE_EVENT(kvm_sys_access,
TP_fast_assign(
__entry->vcpu_pc = vcpu_pc;
+ __entry->regval = params->regval;
__entry->is_write = params->is_write;
__entry->name = reg->name;
__entry->Op0 = reg->Op0;
@@ -109,10 +111,10 @@ TRACE_EVENT(kvm_sys_access,
__entry->Op2 = reg->Op2;
),
- TP_printk("PC: %lx %s (%d,%d,%d,%d,%d) %s",
+ TP_printk("PC: %lx %s (%d,%d,%d,%d,%d) %llx %s",
__entry->vcpu_pc, __entry->name ?: "UNKN",
__entry->Op0, __entry->Op1, __entry->CRn,
- __entry->CRm, __entry->Op2,
+ __entry->CRm, __entry->Op2, __entry->regval,
__entry->is_write ? "write" : "read")
);
Tracing values written to or read from system registers. Signed-off-by: Akihiko Odaki <akihiko.odaki@daynix.com> --- arch/arm64/kvm/sys_regs.c | 24 ++++++++++++++---------- arch/arm64/kvm/trace_handle_exit.h | 6 ++++-- 2 files changed, 18 insertions(+), 12 deletions(-)