All of lore.kernel.org
 help / color / mirror / Atom feed
From: Zhao Liu <zhao1.liu@intel.com>
To: Xiaoyao Li <xiaoyao.li@intel.com>
Cc: Paolo Bonzini <pbonzini@redhat.com>,
	Cameron Esfahani <dirty@apple.com>,
	Roman Bolshakov <rbolshakov@ddn.com>,
	Phil Dennis-Jordan <phil@philjordan.eu>,
	qemu-devel@nongnu.org
Subject: Re: [PATCH 1/2] i386/tcg: Make CPUID_HT and CPUID_EXT3_CMP_LEG supported
Date: Thu, 15 May 2025 15:53:40 +0800	[thread overview]
Message-ID: <aCWdhIqZiu4q+UJi@intel.com> (raw)
In-Reply-To: <20250514031652.838763-2-xiaoyao.li@intel.com>

On Tue, May 13, 2025 at 11:16:51PM -0400, Xiaoyao Li wrote:
> Date: Tue, 13 May 2025 23:16:51 -0400
> From: Xiaoyao Li <xiaoyao.li@intel.com>
> Subject: [PATCH 1/2] i386/tcg: Make CPUID_HT and CPUID_EXT3_CMP_LEG
>  supported
> X-Mailer: git-send-email 2.43.0
> 
> Since commit c6bd2dd63420 ("i386/cpu: Set up CPUID_HT in
> x86_cpu_expand_features() instead of cpu_x86_cpuid()") and
> commit 99a637a86f55 ("i386/cpu: Set and track CPUID_EXT3_CMP_LEG in
> env->features[FEAT_8000_0001_ECX]"), it gets warnings when booting the
> VM with vcpus >= 2 and with tcg:
> 
>   qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.01H:EDX.ht [bit 28]
>   qemu-system-x86_64: warning: TCG doesn't support requested feature: CPUID.80000001H:ECX.cmp-legacy [bit 1]
> 
> This is because, after the two commits, CPUID_HT and CPUID_EXT3_CMP_LEG
> are set in env->features[] when vcpus >=2 (in x86_cpu_expand_features())
> later in x86_cpu_filter_features() it will check against the TCG supported
> bits. However, current TCG doesn't mark the two bits as supported, hence
> the warnings.
> 
> Fix it by adding the two bits to the supported bits of TCG since multiple
> vcpus are supported by TCG.
> 
> Fixes: c6bd2dd63420 ("i386/cpu: Set up CPUID_HT in x86_cpu_expand_features() instead of cpu_x86_cpuid()")
> Fixes: 99a637a86f55 ("i386/cpu: Set and track CPUID_EXT3_CMP_LEG in env->features[FEAT_8000_0001_ECX]")
> Reported-by: Ewan Hai <ewanhai-oc@zhaoxin.com>

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/2894

Then QEMU gitlab can track this fix.

> Signed-off-by: Xiaoyao Li <xiaoyao.li@intel.com>
> ---
>  target/i386/cpu.c | 8 +++++---
>  1 file changed, 5 insertions(+), 3 deletions(-)

Both HT and CMPLegacy depend on CPU topology (mutiple threads per
package), therefore, there's no need for extra work in TCG.

So,

Reviewed-by: Zhao Liu <zhao1.liu@intel.com>




  reply	other threads:[~2025-05-15  7:33 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-05-14  3:16 [PATCH 0/2] Fixes for TCG/HVF warning of CPUID_HT and CPUID_EXT3_CMP_LEG Xiaoyao Li
2025-05-14  3:16 ` [PATCH 1/2] i386/tcg: Make CPUID_HT and CPUID_EXT3_CMP_LEG supported Xiaoyao Li
2025-05-15  7:53   ` Zhao Liu [this message]
2025-05-14  3:16 ` [PATCH 2/2] i386/hvf: Make CPUID_HT supported Xiaoyao Li
2025-05-15  8:17   ` Zhao Liu
2025-05-16  3:17     ` Zhao Liu
2025-05-22 11:27 ` [PATCH 0/2] Fixes for TCG/HVF warning of CPUID_HT and CPUID_EXT3_CMP_LEG Michael Tokarev

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=aCWdhIqZiu4q+UJi@intel.com \
    --to=zhao1.liu@intel.com \
    --cc=dirty@apple.com \
    --cc=pbonzini@redhat.com \
    --cc=phil@philjordan.eu \
    --cc=qemu-devel@nongnu.org \
    --cc=rbolshakov@ddn.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 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.