linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Binbin Wu <binbin.wu@linux.intel.com>
To: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Sean Christopherson <seanjc@google.com>,
	Rick Edgecombe <rick.p.edgecombe@intel.com>,
	kvm@vger.kernel.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH] KVM: TDX: Don't report base TDVMCALLs
Date: Thu, 17 Jul 2025 10:45:56 +0800	[thread overview]
Message-ID: <f0281c2f-4ddf-4a0c-81a2-b6de51a4fe82@linux.intel.com> (raw)
In-Reply-To: <20250717022010.677645-1-xiaoyao.li@intel.com>



On 7/17/2025 10:20 AM, Xiaoyao Li wrote:
> Remove TDVMCALLINFO_GET_QUOTE from user_tdvmcallinfo_1_r11 reported to
> userspace to align with the direction of the GHCI spec.
>
> Recently, concern was raised about a gap in the GHCI spec that left
> ambiguity in how to expose to the guest that only a subset of GHCI
> TDVMCalls were supported. During the back and forth on the spec details[0],
> <GetQuote> was moved from an individually enumerable TDVMCall, to one that
> is part of the 'base spec', meaning it doesn't have a specific bit in the

'GHCI base API' is more appropriate instead of 'base spec'

> <GetTDVMCallInfo> return values. Although the spec[1] is still in draft
> form, the GetQoute part has been agreed by the major TDX VMMs.
GetQoute  ->  <GetQuote>

typo and use <> to align with others.

>
> Unfortunately the commits that were upstreamed still treat <GetQuote> as
> individually enumerable. They set bit 0 in the user_tdvmcallinfo_1_r11
> which is reported to userspace to tell supported optional TDVMCalls,
> intending to say that <GetQuote> is supported.
>
> So stop reporting <GetQute> in user_tdvmcallinfo_1_r11 to align with

GetQute -> GetQuote

> the direction of the spec, and allow some future TDVMCall to use that bit.
>
> [0] https://lore.kernel.org/all/aEmuKII8FGU4eQZz@google.com/
> [1] https://cdrdv2.intel.com/v1/dl/getContent/858626
>
> Fixes: 28224ef02b56 ("KVM: TDX: Report supported optional TDVMCALLs in TDX capabilities")
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>

Nits: typos and wording suggested above.

Reviewed-by: Binbin Wu <binbin.wu@linux.intel.com>

> ---
>   arch/x86/kvm/vmx/tdx.c | 2 --
>   1 file changed, 2 deletions(-)
>
> diff --git a/arch/x86/kvm/vmx/tdx.c b/arch/x86/kvm/vmx/tdx.c
> index f31ccdeb905b..ea1261ca805f 100644
> --- a/arch/x86/kvm/vmx/tdx.c
> +++ b/arch/x86/kvm/vmx/tdx.c
> @@ -173,7 +173,6 @@ static void td_init_cpuid_entry2(struct kvm_cpuid_entry2 *entry, unsigned char i
>   	tdx_clear_unsupported_cpuid(entry);
>   }
>   
> -#define TDVMCALLINFO_GET_QUOTE				BIT(0)
>   #define TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT	BIT(1)
>   
>   static int init_kvm_tdx_caps(const struct tdx_sys_info_td_conf *td_conf,
> @@ -192,7 +191,6 @@ static int init_kvm_tdx_caps(const struct tdx_sys_info_td_conf *td_conf,
>   	caps->cpuid.nent = td_conf->num_cpuid_config;
>   
>   	caps->user_tdvmcallinfo_1_r11 =
> -		TDVMCALLINFO_GET_QUOTE |
>   		TDVMCALLINFO_SETUP_EVENT_NOTIFY_INTERRUPT;
>   
>   	for (i = 0; i < td_conf->num_cpuid_config; i++)


  reply	other threads:[~2025-07-17  2:46 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-07-17  2:20 [PATCH] KVM: TDX: Don't report base TDVMCALLs Xiaoyao Li
2025-07-17  2:45 ` Binbin Wu [this message]
2025-07-17  3:14   ` Xiaoyao Li
2025-07-17 12:25 ` Vishal Annapurve
2025-07-17 15:24   ` Edgecombe, Rick P
2025-07-17 15:33     ` Paolo Bonzini

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=f0281c2f-4ddf-4a0c-81a2-b6de51a4fe82@linux.intel.com \
    --to=binbin.wu@linux.intel.com \
    --cc=kvm@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=pbonzini@redhat.com \
    --cc=rick.p.edgecombe@intel.com \
    --cc=seanjc@google.com \
    --cc=xiaoyao.li@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;
as well as URLs for NNTP newsgroup(s).