mirror of
https://github.com/tbsdtv/linux_media.git
synced 2025-07-23 20:51:03 +02:00
kvm: x86/mmu: Add TDP MMU SPTE changed trace point
Add an extremely verbose trace point to the TDP MMU to log all SPTE changes, regardless of callstack / motivation. This is useful when a complete picture of the paging structure is needed or a change cannot be explained with the other, existing trace points. Tested: ran the demand paging selftest on an Intel Skylake machine with all the trace points used by the TDP MMU enabled and observed them firing with expected values. This patch can be viewed in Gerrit at: https://linux-review.googlesource.com/c/virt/kvm/kvm/+/3813 Signed-off-by: Ben Gardon <bgardon@google.com> Message-Id: <20201027175944.1183301-2-bgardon@google.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
committed by
Paolo Bonzini
parent
33dd3574f5
commit
b9a98c3437
@@ -381,6 +381,35 @@ TRACE_EVENT(
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
TRACE_EVENT(
|
||||||
|
kvm_tdp_mmu_spte_changed,
|
||||||
|
TP_PROTO(int as_id, gfn_t gfn, int level, u64 old_spte, u64 new_spte),
|
||||||
|
TP_ARGS(as_id, gfn, level, old_spte, new_spte),
|
||||||
|
|
||||||
|
TP_STRUCT__entry(
|
||||||
|
__field(u64, gfn)
|
||||||
|
__field(u64, old_spte)
|
||||||
|
__field(u64, new_spte)
|
||||||
|
/* Level cannot be larger than 5 on x86, so it fits in a u8. */
|
||||||
|
__field(u8, level)
|
||||||
|
/* as_id can only be 0 or 1 x86, so it fits in a u8. */
|
||||||
|
__field(u8, as_id)
|
||||||
|
),
|
||||||
|
|
||||||
|
TP_fast_assign(
|
||||||
|
__entry->gfn = gfn;
|
||||||
|
__entry->old_spte = old_spte;
|
||||||
|
__entry->new_spte = new_spte;
|
||||||
|
__entry->level = level;
|
||||||
|
__entry->as_id = as_id;
|
||||||
|
),
|
||||||
|
|
||||||
|
TP_printk("as id %d gfn %llx level %d old_spte %llx new_spte %llx",
|
||||||
|
__entry->as_id, __entry->gfn, __entry->level,
|
||||||
|
__entry->old_spte, __entry->new_spte
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
#endif /* _TRACE_KVMMMU_H */
|
#endif /* _TRACE_KVMMMU_H */
|
||||||
|
|
||||||
#undef TRACE_INCLUDE_PATH
|
#undef TRACE_INCLUDE_PATH
|
||||||
|
@@ -248,6 +248,8 @@ static void __handle_changed_spte(struct kvm *kvm, int as_id, gfn_t gfn,
|
|||||||
if (old_spte == new_spte)
|
if (old_spte == new_spte)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
trace_kvm_tdp_mmu_spte_changed(as_id, gfn, level, old_spte, new_spte);
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* The only times a SPTE should be changed from a non-present to
|
* The only times a SPTE should be changed from a non-present to
|
||||||
* non-present state is when an MMIO entry is installed/modified/
|
* non-present state is when an MMIO entry is installed/modified/
|
||||||
|
Reference in New Issue
Block a user