[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2227406cbc6ca249c78e886c301dd39064053cc4.camel@intel.com>
Date: Tue, 21 Jan 2025 20:24:44 +0000
From: "Edgecombe, Rick P" <rick.p.edgecombe@...el.com>
To: "Li, Xiaoyao" <xiaoyao.li@...el.com>, "pbonzini@...hat.com"
<pbonzini@...hat.com>, "seanjc@...gle.com" <seanjc@...gle.com>
CC: "Huang, Kai" <kai.huang@...el.com>, "kvm@...r.kernel.org"
<kvm@...r.kernel.org>, "Chatre, Reinette" <reinette.chatre@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>, "Zhao, Yan Y"
<yan.y.zhao@...el.com>, "isaku.yamahata@...il.com"
<isaku.yamahata@...il.com>, "tony.lindgren@...ux.intel.com"
<tony.lindgren@...ux.intel.com>
Subject: Re: [PATCH v2 24/25] KVM: x86: Introduce KVM_TDX_GET_CPUID
On Fri, 2025-01-10 at 12:47 +0800, Xiaoyao Li wrote:
> 0x1f needs clarification here.
>
> If it's going to use the maximum leaf KVM can support, it should be 0x24
> to align with __do_cpuid_func().
>
> alternatively, it can use the EAX value of leaf 0 returned by TDX
> module. That is the value TDX module presents to the TD guest.
>
> > + output_e = &td_cpuid->entries[i];
> > + i += tdx_vcpu_get_cpuid_leaf(vcpu, leaf,
> > + KVM_MAX_CPUID_ENTRIES - i - 1,
> > + output_e);
> > + }
> > +
> > + for (leaf = 0x80000000; leaf <= 0x80000008; leaf++) {
> > + output_e = &td_cpuid->entries[i];
> > + i += tdx_vcpu_get_cpuid_leaf(vcpu, leaf,
> > + KVM_MAX_CPUID_ENTRIES - i - 1,
> > + output_e);
Since we are not filtering by KVM supported features anymore, maybe just use the
max leaf for the host CPU, like:
@@ -2790,14 +2791,14 @@ static int tdx_vcpu_get_cpuid(struct kvm_vcpu *vcpu,
struct kvm_tdx_cmd *cmd)
if (!td_cpuid)
return -ENOMEM;
- for (leaf = 0; leaf <= 0x1f; leaf++) {
+ for (leaf = 0; leaf <= boot_cpu_data.cpuid_level; leaf++) {
output_e = &td_cpuid->entries[i];
i += tdx_vcpu_get_cpuid_leaf(vcpu, leaf,
KVM_MAX_CPUID_ENTRIES - i - 1,
output_e);
}
- for (leaf = 0x80000000; leaf <= 0x80000008; leaf++) {
+ for (leaf = 0x80000000; leaf <= boot_cpu_data.extended_cpuid_level;
leaf++) {
output_e = &td_cpuid->entries[i];
i += tdx_vcpu_get_cpuid_leaf(vcpu, leaf,
KVM_MAX_CPUID_ENTRIES - i - 1,
Powered by blists - more mailing lists