All of lore.kernel.org
 help / color / mirror / Atom feed
From: Jason Andryuk <jason.andryuk@amd.com>
To: Grygorii Strashko <grygorii_strashko@epam.com>,
	"xen-devel@lists.xenproject.org" <xen-devel@lists.xenproject.org>
Cc: "Jan Beulich" <jbeulich@suse.com>,
	"Andrew Cooper" <andrew.cooper3@citrix.com>,
	"Roger Pau Monné" <roger.pau@citrix.com>,
	"Anthony PERARD" <anthony.perard@vates.tech>,
	"Michal Orzel" <michal.orzel@amd.com>,
	"Julien Grall" <julien@xen.org>,
	"Stefano Stabellini" <sstabellini@kernel.org>,
	"Alejandro Vallejo" <alejandro.garciavallejo@amd.com>
Subject: Re: [XEN][PATCH v2 2/4] x86: hvm: compat: introduce is_hcall_compat() helper
Date: Tue, 2 Dec 2025 13:41:31 -0500	[thread overview]
Message-ID: <0054b5cc-d278-4c8c-bb6b-fbe1d641ac2c@amd.com> (raw)
In-Reply-To: <20251119192916.1009549-3-grygorii_strashko@epam.com>

On 2025-11-19 14:30, Grygorii Strashko wrote:
> From: Grygorii Strashko <grygorii_strashko@epam.com>
> 
> Introduce is_hcall_compat() helper and use it instead of direct access to
> struct vcpu->hcall_compat field in preparation for making HVM COMPAT code
> optional. The vcpu->hcall_compat field is under CONFIG_COMPAT ifdefs
> already.
> 
> Signed-off-by: Grygorii Strashko <grygorii_strashko@epam.com>

> diff --git a/xen/include/xen/sched.h b/xen/include/xen/sched.h
> index 02bdc256ce37..ed6fdeeda9f9 100644
> --- a/xen/include/xen/sched.h
> +++ b/xen/include/xen/sched.h
> @@ -311,6 +311,15 @@ struct vcpu
>   #endif
>   };
>   
> +static inline bool is_hcall_compat(void)
> +{
> +#ifdef CONFIG_COMPAT
> +    return current->hcall_compat;
> +#else
> +    return false;
> +#endif /* CONFIG_COMPAT */
> +}
> +

is_hcall_compat() matches the hcall_compat field, so I am okay with this.

Reviewed-by: Jason Andryuk <jason.andryuk@amd.com>

However, is_compat_hcall() might be a slightly better name for the 
helper.  For me at least, I think of these as "compat hypercalls", so 
that ordering reads a little more naturally for me.  It's not a big 
deal, but I figured I'd mention it in case others have an opinion.

Thanks,
Jason


  reply	other threads:[~2025-12-02 18:42 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 19:30 [XEN][PATCH v2 0/4] x86: pvh: allow to disable 32-bit (COMPAT) interface support Grygorii Strashko
2025-11-19 19:30 ` [XEN][PATCH v2 1/4] x86: hvm: dm: factor out compat code under ifdefs Grygorii Strashko
2025-11-19 19:30 ` [XEN][PATCH v2 2/4] x86: hvm: compat: introduce is_hcall_compat() helper Grygorii Strashko
2025-12-02 18:41   ` Jason Andryuk [this message]
2025-11-19 19:30 ` [XEN][PATCH v2 3/4] x86: hvm: factor out COMPAT code under ifdefs Grygorii Strashko
2025-12-02 19:26   ` Jason Andryuk
2025-12-04 18:39     ` Grygorii Strashko
2025-12-04 18:47   ` Grygorii Strashko
2025-12-18 16:47     ` Jürgen Groß
2025-11-19 19:30 ` [XEN][PATCH v2 4/4] x86: pvh: allow to disable 32-bit interface support Grygorii Strashko
2025-12-02 19:56   ` Jason Andryuk
2025-12-18 16:20 ` [XEN][PATCH v2 0/4] x86: pvh: allow to disable 32-bit (COMPAT) " Grygorii Strashko
2025-12-18 16:33   ` Jan Beulich
2025-12-19  0:33     ` Stefano Stabellini

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=0054b5cc-d278-4c8c-bb6b-fbe1d641ac2c@amd.com \
    --to=jason.andryuk@amd.com \
    --cc=alejandro.garciavallejo@amd.com \
    --cc=andrew.cooper3@citrix.com \
    --cc=anthony.perard@vates.tech \
    --cc=grygorii_strashko@epam.com \
    --cc=jbeulich@suse.com \
    --cc=julien@xen.org \
    --cc=michal.orzel@amd.com \
    --cc=roger.pau@citrix.com \
    --cc=sstabellini@kernel.org \
    --cc=xen-devel@lists.xenproject.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.