Skip to content

Commit a3e0b8b

Browse files
committed
KVM: MMU: change tracepoints arguments to kvm_page_fault
Pass struct kvm_page_fault to tracepoints instead of extracting the arguments from the struct. Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 8424625 commit a3e0b8b

File tree

4 files changed

+13
-13
lines changed

4 files changed

+13
-13
lines changed

arch/x86/kvm/mmu/mmu.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2966,7 +2966,7 @@ static int __direct_map(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault)
29662966

29672967
kvm_mmu_hugepage_adjust(vcpu, fault);
29682968

2969-
trace_kvm_mmu_spte_requested(fault->addr, fault->goal_level, fault->pfn);
2969+
trace_kvm_mmu_spte_requested(fault);
29702970
for_each_shadow_entry(vcpu, fault->addr, it) {
29712971
/*
29722972
* We cannot overwrite existing page tables with an NX
@@ -3258,7 +3258,7 @@ static int fast_page_fault(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault)
32583258

32593259
} while (true);
32603260

3261-
trace_fast_page_fault(vcpu, fault->addr, fault->error_code, sptep, spte, ret);
3261+
trace_fast_page_fault(vcpu, fault, sptep, spte, ret);
32623262
walk_shadow_page_lockless_end(vcpu);
32633263

32643264
return ret;

arch/x86/kvm/mmu/mmutrace.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -252,9 +252,9 @@ TRACE_EVENT(
252252

253253
TRACE_EVENT(
254254
fast_page_fault,
255-
TP_PROTO(struct kvm_vcpu *vcpu, gpa_t cr2_or_gpa, u32 error_code,
255+
TP_PROTO(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault,
256256
u64 *sptep, u64 old_spte, int ret),
257-
TP_ARGS(vcpu, cr2_or_gpa, error_code, sptep, old_spte, ret),
257+
TP_ARGS(vcpu, fault, sptep, old_spte, ret),
258258

259259
TP_STRUCT__entry(
260260
__field(int, vcpu_id)
@@ -268,8 +268,8 @@ TRACE_EVENT(
268268

269269
TP_fast_assign(
270270
__entry->vcpu_id = vcpu->vcpu_id;
271-
__entry->cr2_or_gpa = cr2_or_gpa;
272-
__entry->error_code = error_code;
271+
__entry->cr2_or_gpa = fault->addr;
272+
__entry->error_code = fault->error_code;
273273
__entry->sptep = sptep;
274274
__entry->old_spte = old_spte;
275275
__entry->new_spte = *sptep;
@@ -367,8 +367,8 @@ TRACE_EVENT(
367367

368368
TRACE_EVENT(
369369
kvm_mmu_spte_requested,
370-
TP_PROTO(gpa_t addr, int level, kvm_pfn_t pfn),
371-
TP_ARGS(addr, level, pfn),
370+
TP_PROTO(struct kvm_page_fault *fault),
371+
TP_ARGS(fault),
372372

373373
TP_STRUCT__entry(
374374
__field(u64, gfn)
@@ -377,9 +377,9 @@ TRACE_EVENT(
377377
),
378378

379379
TP_fast_assign(
380-
__entry->gfn = addr >> PAGE_SHIFT;
381-
__entry->pfn = pfn | (__entry->gfn & (KVM_PAGES_PER_HPAGE(level) - 1));
382-
__entry->level = level;
380+
__entry->gfn = fault->addr >> PAGE_SHIFT;
381+
__entry->pfn = fault->pfn | (__entry->gfn & (KVM_PAGES_PER_HPAGE(fault->goal_level) - 1));
382+
__entry->level = fault->goal_level;
383383
),
384384

385385
TP_printk("gfn %llx pfn %llx level %d",

arch/x86/kvm/mmu/paging_tmpl.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,7 @@ static int FNAME(fetch)(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault,
719719

720720
kvm_mmu_hugepage_adjust(vcpu, fault);
721721

722-
trace_kvm_mmu_spte_requested(fault->addr, gw->level, fault->pfn);
722+
trace_kvm_mmu_spte_requested(fault);
723723

724724
for (; shadow_walk_okay(&it); shadow_walk_next(&it)) {
725725
clear_sp_write_flooding_count(it.sptep);

arch/x86/kvm/mmu/tdp_mmu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -983,7 +983,7 @@ int kvm_tdp_mmu_map(struct kvm_vcpu *vcpu, struct kvm_page_fault *fault)
983983

984984
kvm_mmu_hugepage_adjust(vcpu, fault);
985985

986-
trace_kvm_mmu_spte_requested(fault->addr, fault->goal_level, fault->pfn);
986+
trace_kvm_mmu_spte_requested(fault);
987987

988988
rcu_read_lock();
989989

0 commit comments

Comments
 (0)