mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-16 03:11:11 -04:00
mshv: Add tracepoint for GPA intercept handling
Provide visibility into GPA intercept operations for debugging and performance analysis of Microsoft Hypervisor guest memory management. Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com> Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com> Signed-off-by: Wei Liu <wei.liu@kernel.org>
This commit is contained in:
committed by
Wei Liu
parent
404cd6bffe
commit
cfc42685e5
@@ -674,7 +674,7 @@ static bool mshv_handle_gpa_intercept(struct mshv_vp *vp)
|
||||
|
||||
region = mshv_partition_region_by_gfn_get(p, gfn);
|
||||
if (!region)
|
||||
return false;
|
||||
goto out;
|
||||
|
||||
if (access_type == HV_INTERCEPT_ACCESS_WRITE &&
|
||||
!(region->hv_map_flags & HV_MAP_GPA_WRITABLE))
|
||||
@@ -690,7 +690,9 @@ static bool mshv_handle_gpa_intercept(struct mshv_vp *vp)
|
||||
|
||||
put_region:
|
||||
mshv_region_put(region);
|
||||
|
||||
out:
|
||||
trace_mshv_handle_gpa_intercept(p->pt_id, vp->vp_index, gfn,
|
||||
access_type, ret);
|
||||
return ret;
|
||||
}
|
||||
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
#define _MSHV_TRACE_H_
|
||||
|
||||
#include <linux/tracepoint.h>
|
||||
#include <hyperv/hvhdk.h>
|
||||
|
||||
#undef TRACE_INCLUDE_PATH
|
||||
#define TRACE_INCLUDE_PATH ../../drivers/hv
|
||||
@@ -509,6 +510,34 @@ TRACE_EVENT(mshv_vp_wait_for_hv_kick,
|
||||
)
|
||||
);
|
||||
|
||||
TRACE_EVENT(mshv_handle_gpa_intercept,
|
||||
TP_PROTO(u64 partition_id, u32 vp_index, u64 gfn, u8 access_type, bool handled),
|
||||
TP_ARGS(partition_id, vp_index, gfn, access_type, handled),
|
||||
TP_STRUCT__entry(
|
||||
__field(u64, partition_id)
|
||||
__field(u32, vp_index)
|
||||
__field(u64, gfn)
|
||||
__field(u8, access_type)
|
||||
__field(bool, handled)
|
||||
),
|
||||
TP_fast_assign(
|
||||
__entry->partition_id = partition_id;
|
||||
__entry->vp_index = vp_index;
|
||||
__entry->gfn = gfn;
|
||||
__entry->access_type = access_type == HV_INTERCEPT_ACCESS_READ ? 'R' :
|
||||
(access_type == HV_INTERCEPT_ACCESS_WRITE ? 'W' :
|
||||
(access_type == HV_INTERCEPT_ACCESS_EXECUTE ? 'X' : '?'));
|
||||
__entry->handled = handled;
|
||||
),
|
||||
TP_printk("partition_id=%llu vp_index=%u gfn=0x%llx access_type=%c handled=%d",
|
||||
__entry->partition_id,
|
||||
__entry->vp_index,
|
||||
__entry->gfn,
|
||||
__entry->access_type,
|
||||
__entry->handled
|
||||
)
|
||||
);
|
||||
|
||||
#endif /* _MSHV_TRACE_H_ */
|
||||
|
||||
/* This part must be outside protection */
|
||||
|
||||
Reference in New Issue
Block a user