From: Igor Mammedov <imammedo@redhat.com>
To: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: "Paolo Bonzini" <pbonzini@redhat.com>,
"Daniel P . Berrangé" <berrange@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [PATCH 1/3] i386/cpu: Rename enable_cpuid_0x1f to force_cpuid_0x1f
Date: Tue, 3 Jun 2025 11:22:39 +0200 [thread overview]
Message-ID: <20250603112239.01eb3d01@imammedo.users.ipa.redhat.com> (raw)
In-Reply-To: <20250603050305.1704586-2-xiaoyao.li@intel.com>
On Tue, 3 Jun 2025 01:03:03 -0400
Xiaoyao Li <xiaoyao.li@intel.com> wrote:
> The name of "enable_cpuid_0x1f" isn't right to its behavior because the
> leaf 0x1f can be enabled even when "enable_cpuid_0x1f" is false.
>
> Rename it to "force_cpuid_0x1f" to better reflect its behavior.
>
> Suggested-by: Igor Mammedov <imammedo@redhat.com>
> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
Reviewed-by: Igor Mammedov <imammedo@redhat.com>
> ---
> Suggested by Igor at https://lore.kernel.org/qemu-devel/20250513144515.37615651@imammedo.users.ipa.redhat.com/
> ---
> target/i386/cpu.h | 4 ++--
> target/i386/kvm/tdx.c | 2 +-
> 2 files changed, 3 insertions(+), 3 deletions(-)
>
> diff --git a/target/i386/cpu.h b/target/i386/cpu.h
> index 1146465c8c62..aaef6a2a6767 100644
> --- a/target/i386/cpu.h
> +++ b/target/i386/cpu.h
> @@ -2270,7 +2270,7 @@ struct ArchCPU {
> bool enable_cpuid_0xb;
>
> /* Force to enable cpuid 0x1f */
> - bool enable_cpuid_0x1f;
> + bool force_cpuid_0x1f;
>
> /* Enable auto level-increase for all CPUID leaves */
> bool full_cpuid_auto_level;
> @@ -2540,7 +2540,7 @@ void mark_forced_on_features(X86CPU *cpu, FeatureWord w, uint64_t mask,
>
> static inline bool x86_has_cpuid_0x1f(X86CPU *cpu)
> {
> - return cpu->enable_cpuid_0x1f ||
> + return cpu->force_cpuid_0x1f ||
> x86_has_extended_topo(cpu->env.avail_cpu_topo);
> }
>
> diff --git a/target/i386/kvm/tdx.c b/target/i386/kvm/tdx.c
> index 0a21ae555c5c..17e671f1710f 100644
> --- a/target/i386/kvm/tdx.c
> +++ b/target/i386/kvm/tdx.c
> @@ -746,7 +746,7 @@ static void tdx_cpu_instance_init(X86ConfidentialGuest *cg, CPUState *cpu)
> /* invtsc is fixed1 for TD guest */
> object_property_set_bool(OBJECT(cpu), "invtsc", true, &error_abort);
>
> - x86cpu->enable_cpuid_0x1f = true;
> + x86cpu->force_cpuid_0x1f = true;
> }
>
> static uint32_t tdx_adjust_cpuid_features(X86ConfidentialGuest *cg,
next prev parent reply other threads:[~2025-06-03 9:23 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-06-03 5:03 [PATCH 0/3] TDX: Fix and enhancement Xiaoyao Li
2025-06-03 5:03 ` [PATCH 1/3] i386/cpu: Rename enable_cpuid_0x1f to force_cpuid_0x1f Xiaoyao Li
2025-06-03 8:31 ` Daniel P. Berrangé
2025-06-03 9:22 ` Igor Mammedov [this message]
2025-06-04 10:35 ` Zhao Liu
2025-06-03 5:03 ` [PATCH 2/3] i386/tdx: Fix the typo of the comment of struct TdxGuest Xiaoyao Li
2025-06-03 8:30 ` Daniel P. Berrangé
2025-06-03 9:24 ` Igor Mammedov
2025-06-04 10:36 ` Zhao Liu
2025-06-03 5:03 ` [PATCH 3/3] i386/tdx: Clarify the error message of mrconfigid/mrowner/mrownerconfig Xiaoyao Li
2025-06-03 8:30 ` Daniel P. Berrangé
2025-06-03 9:27 ` Igor Mammedov
2025-06-04 10:38 ` Zhao Liu
2025-06-17 18:02 ` [PATCH 0/3] TDX: Fix and enhancement 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=20250603112239.01eb3d01@imammedo.users.ipa.redhat.com \
--to=imammedo@redhat.com \
--cc=berrange@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--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).