Linux Confidential Computing Development
 help / color / mirror / Atom feed
From: Xiaoyao Li <xiaoyao.li@intel.com>
To: Xu Yilun <yilun.xu@linux.intel.com>,
	x86@kernel.org, linux-kernel@vger.kernel.org
Cc: kas@kernel.org, rick.p.edgecombe@intel.com,
	dave.hansen@intel.com, dave.hansen@linux.intel.com,
	yilun.xu@intel.com, chao.gao@intel.com, djbw@kernel.org,
	linux-coco@lists.linux.dev, peter.fang@intel.com
Subject: Re: [PATCH] x86/virt/tdx: Formalize SEAMCALL version encoding support
Date: Fri, 3 Jul 2026 08:00:38 +0800	[thread overview]
Message-ID: <ede965a3-0fd6-46b4-906d-716bce163036@intel.com> (raw)
In-Reply-To: <20260702144614.59464-1-yilun.xu@linux.intel.com>

On 7/2/2026 10:46 PM, Xu Yilun wrote:
> +/*
> + * SEAMCALL leaf:
> + *
> + * Bit 15:0	Leaf number
> + * Bit 23:16	Version number
> + */
> +#define SEAMCALL_VERSION_MASK		GENMASK_U64(23, 16)
> +
> +static __always_inline u64 __seamcall_encode_fn(sc_func_t func, u64 fn,
> +						struct tdx_module_args *args)
> +{
> +	FIELD_MODIFY(SEAMCALL_VERSION_MASK, &fn, args->version);
> +
> +	return func(fn, args);
> +}
> +
>   static __always_inline u64 __seamcall_dirty_cache(sc_func_t func, u64 fn,
>   						  struct tdx_module_args *args)
>   {
> @@ -39,7 +56,7 @@ static __always_inline u64 __seamcall_dirty_cache(sc_func_t func, u64 fn,
>   	 */
>   	this_cpu_write(cache_state_incoherent, true);
>   
> -	return func(fn, args);
> +	return __seamcall_encode_fn(func, fn, args);
>   }

Can we drop the new wrapper? I don't see why we need it. The wrapper 
makes the code harder to read.



      reply	other threads:[~2026-07-03  0:00 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-07-02 14:46 [PATCH] x86/virt/tdx: Formalize SEAMCALL version encoding support Xu Yilun
2026-07-03  0:00 ` Xiaoyao Li [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=ede965a3-0fd6-46b4-906d-716bce163036@intel.com \
    --to=xiaoyao.li@intel.com \
    --cc=chao.gao@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=dave.hansen@linux.intel.com \
    --cc=djbw@kernel.org \
    --cc=kas@kernel.org \
    --cc=linux-coco@lists.linux.dev \
    --cc=linux-kernel@vger.kernel.org \
    --cc=peter.fang@intel.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=x86@kernel.org \
    --cc=yilun.xu@intel.com \
    --cc=yilun.xu@linux.intel.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