* [PATCH] mshv: Add tracepoint for GPA intercept handling
@ 2026-03-24 23:59 Stanislav Kinsburskii
2026-04-02 15:45 ` Anirudh Rayabharam
0 siblings, 1 reply; 4+ messages in thread
From: Stanislav Kinsburskii @ 2026-03-24 23:59 UTC (permalink / raw)
To: kys, haiyangz, wei.liu, decui, longli; +Cc: linux-hyperv, linux-kernel
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>
---
drivers/hv/mshv_root_main.c | 6 ++++--
drivers/hv/mshv_trace.h | 29 +++++++++++++++++++++++++++++
2 files changed, 33 insertions(+), 2 deletions(-)
diff --git a/drivers/hv/mshv_root_main.c b/drivers/hv/mshv_root_main.c
index bb9fe4985e95..d4aab09fba47 100644
--- a/drivers/hv/mshv_root_main.c
+++ b/drivers/hv/mshv_root_main.c
@@ -675,7 +675,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))
@@ -691,7 +691,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;
}
diff --git a/drivers/hv/mshv_trace.h b/drivers/hv/mshv_trace.h
index ba3b3f575983..6b8fa477fa3b 100644
--- a/drivers/hv/mshv_trace.h
+++ b/drivers/hv/mshv_trace.h
@@ -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;
+ __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 == HV_INTERCEPT_ACCESS_READ ? 'R' :
+ (__entry->access_type == HV_INTERCEPT_ACCESS_WRITE ? 'W' :
+ (__entry->access_type == HV_INTERCEPT_ACCESS_READ ? 'X' : '?')),
+ __entry->handled
+ )
+);
+
#endif /* _MSHV_TRACE_H_ */
/* This part must be outside protection */
^ permalink raw reply related [flat|nested] 4+ messages in thread* Re: [PATCH] mshv: Add tracepoint for GPA intercept handling
2026-03-24 23:59 [PATCH] mshv: Add tracepoint for GPA intercept handling Stanislav Kinsburskii
@ 2026-04-02 15:45 ` Anirudh Rayabharam
2026-04-04 6:41 ` Wei Liu
2026-04-04 6:45 ` Wei Liu
0 siblings, 2 replies; 4+ messages in thread
From: Anirudh Rayabharam @ 2026-04-02 15:45 UTC (permalink / raw)
To: Stanislav Kinsburskii
Cc: kys, haiyangz, wei.liu, decui, longli, linux-hyperv, linux-kernel
On Tue, Mar 24, 2026 at 11:59:59PM +0000, Stanislav Kinsburskii wrote:
> 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>
> ---
> drivers/hv/mshv_root_main.c | 6 ++++--
> drivers/hv/mshv_trace.h | 29 +++++++++++++++++++++++++++++
> 2 files changed, 33 insertions(+), 2 deletions(-)
Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mshv: Add tracepoint for GPA intercept handling
2026-04-02 15:45 ` Anirudh Rayabharam
@ 2026-04-04 6:41 ` Wei Liu
2026-04-04 6:45 ` Wei Liu
1 sibling, 0 replies; 4+ messages in thread
From: Wei Liu @ 2026-04-04 6:41 UTC (permalink / raw)
To: Anirudh Rayabharam
Cc: Stanislav Kinsburskii, kys, haiyangz, wei.liu, decui, longli,
linux-hyperv, linux-kernel
On Thu, Apr 02, 2026 at 03:45:58PM +0000, Anirudh Rayabharam wrote:
> On Tue, Mar 24, 2026 at 11:59:59PM +0000, Stanislav Kinsburskii wrote:
> > 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>
> > ---
> > drivers/hv/mshv_root_main.c | 6 ++++--
> > drivers/hv/mshv_trace.h | 29 +++++++++++++++++++++++++++++
> > 2 files changed, 33 insertions(+), 2 deletions(-)
>
> Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
>
This doesn't apply cleanly to hyperv-next.
Wei
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH] mshv: Add tracepoint for GPA intercept handling
2026-04-02 15:45 ` Anirudh Rayabharam
2026-04-04 6:41 ` Wei Liu
@ 2026-04-04 6:45 ` Wei Liu
1 sibling, 0 replies; 4+ messages in thread
From: Wei Liu @ 2026-04-04 6:45 UTC (permalink / raw)
To: Anirudh Rayabharam
Cc: Stanislav Kinsburskii, kys, haiyangz, wei.liu, decui, longli,
linux-hyperv, linux-kernel
On Thu, Apr 02, 2026 at 03:45:58PM +0000, Anirudh Rayabharam wrote:
> On Tue, Mar 24, 2026 at 11:59:59PM +0000, Stanislav Kinsburskii wrote:
> > 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>
> > ---
> > drivers/hv/mshv_root_main.c | 6 ++++--
> > drivers/hv/mshv_trace.h | 29 +++++++++++++++++++++++++++++
> > 2 files changed, 33 insertions(+), 2 deletions(-)
>
> Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com>
>
This patch has a dependency on another bug fix. That's not listed
anywhere. In the future, please list the dependency, or post this as
part of a series.
The tracing support is in hyeprv-next. This patch needs to wait.
Wei
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-04-04 6:45 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-24 23:59 [PATCH] mshv: Add tracepoint for GPA intercept handling Stanislav Kinsburskii
2026-04-02 15:45 ` Anirudh Rayabharam
2026-04-04 6:41 ` Wei Liu
2026-04-04 6:45 ` Wei Liu
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox