public inbox for linux-hyperv@vger.kernel.org
 help / color / mirror / Atom feed
From: Wei Liu <wei.liu@kernel.org>
To: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
Cc: kys@microsoft.com, haiyangz@microsoft.com, wei.liu@kernel.org,
	decui@microsoft.com, longli@microsoft.com,
	linux-hyperv@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] mshv: Fix incorrect access type usage in GPA intercept trace event
Date: Wed, 22 Apr 2026 06:25:58 +0000	[thread overview]
Message-ID: <20260422062558.GA805420@liuwe-devbox-debian-v2.local> (raw)
In-Reply-To: <177682681331.1683870.15540242284121796900.stgit@skinsburskii-cloud-desktop.internal.cloudapp.net>

On Wed, Apr 22, 2026 at 03:00:13AM +0000, Stanislav Kinsburskii wrote:
> The trace event was checking for HV_INTERCEPT_ACCESS_READ twice in the
> ternary operator chain instead of checking for EXECUTE, which would
> cause execute accesses to be incorrectly displayed as '?' in traces.
> 
> Move the access type conversion to the TP_fast_assign section where
> the raw value is available, rather than performing the conversion
> during formatting. This eliminates the redundant checks and ensures
> all access types are correctly identified and displayed.
> 
> Fixes: 03f7d01f699010 ("mshv: Add tracepoint for GPA intercept handling")

This is not yet in Linus' tree.

I folded this into the original patch.

Wei

> Signed-off-by: Stanislav Kinsburskii <skinsburskii@linux.microsoft.com>
> ---
>  drivers/hv/mshv_trace.h |    8 ++++----
>  1 file changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/hv/mshv_trace.h b/drivers/hv/mshv_trace.h
> index 6b8fa477fa3bf..e7280c47e579a 100644
> --- a/drivers/hv/mshv_trace.h
> +++ b/drivers/hv/mshv_trace.h
> @@ -524,16 +524,16 @@ TRACE_EVENT(mshv_handle_gpa_intercept,
>  		    __entry->partition_id = partition_id;
>  		    __entry->vp_index = vp_index;
>  		    __entry->gfn = gfn;
> -		    __entry->access_type = access_type;
> +		    __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 == HV_INTERCEPT_ACCESS_READ ? 'R' :
> -				    (__entry->access_type == HV_INTERCEPT_ACCESS_WRITE ? 'W' :
> -				    (__entry->access_type == HV_INTERCEPT_ACCESS_READ ? 'X' : '?')),
> +		    __entry->access_type,
>  		    __entry->handled
>  	    )
>  );
> 
> 

      reply	other threads:[~2026-04-22  6:26 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-22  3:00 [PATCH] mshv: Fix incorrect access type usage in GPA intercept trace event Stanislav Kinsburskii
2026-04-22  6:25 ` Wei Liu [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260422062558.GA805420@liuwe-devbox-debian-v2.local \
    --to=wei.liu@kernel.org \
    --cc=decui@microsoft.com \
    --cc=haiyangz@microsoft.com \
    --cc=kys@microsoft.com \
    --cc=linux-hyperv@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=longli@microsoft.com \
    --cc=skinsburskii@linux.microsoft.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox