diff options
author | Lorenzo Brescia <lorenzo.brescia@edu.unito.it> | 2020-12-23 14:45:07 +0000 |
---|---|---|
committer | Paolo Bonzini <pbonzini@redhat.com> | 2021-01-25 18:52:08 -0500 |
commit | d95df9510679757bdfc22376d351cdf367b3a604 (patch) | |
tree | bc191b86ea2a8ef698470f38ccd91b4711eecd5a /samples/bpf/hbm.h | |
parent | 01ead84ccd23afadebe66aea0eda002ac29ca9be (diff) | |
download | linux-d95df9510679757bdfc22376d351cdf367b3a604.tar.bz2 |
kvm: tracing: Fix unmatched kvm_entry and kvm_exit events
On VMX, if we exit and then re-enter immediately without leaving
the vmx_vcpu_run() function, the kvm_entry event is not logged.
That means we will see one (or more) kvm_exit, without its (their)
corresponding kvm_entry, as shown here:
CPU-1979 [002] 89.871187: kvm_entry: vcpu 1
CPU-1979 [002] 89.871218: kvm_exit: reason MSR_WRITE
CPU-1979 [002] 89.871259: kvm_exit: reason MSR_WRITE
It also seems possible for a kvm_entry event to be logged, but then
we leave vmx_vcpu_run() right away (if vmx->emulation_required is
true). In this case, we will have a spurious kvm_entry event in the
trace.
Fix these situations by moving trace_kvm_entry() inside vmx_vcpu_run()
(where trace_kvm_exit() already is).
A trace obtained with this patch applied looks like this:
CPU-14295 [000] 8388.395387: kvm_entry: vcpu 0
CPU-14295 [000] 8388.395392: kvm_exit: reason MSR_WRITE
CPU-14295 [000] 8388.395393: kvm_entry: vcpu 0
CPU-14295 [000] 8388.395503: kvm_exit: reason EXTERNAL_INTERRUPT
Of course, not calling trace_kvm_entry() in common x86 code any
longer means that we need to adjust the SVM side of things too.
Signed-off-by: Lorenzo Brescia <lorenzo.brescia@edu.unito.it>
Signed-off-by: Dario Faggioli <dfaggioli@suse.com>
Message-Id: <160873470698.11652.13483635328769030605.stgit@Wayrath>
Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
Diffstat (limited to 'samples/bpf/hbm.h')
0 files changed, 0 insertions, 0 deletions