All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] target/i386: Treat qtest like TCG for supported-features
@ 2026-03-30 15:14 Peter Maydell
  2026-03-30 21:58 ` Philippe Mathieu-Daudé
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Peter Maydell @ 2026-03-30 15:14 UTC (permalink / raw)
  To: qemu-devel; +Cc: Paolo Bonzini, Zhao Liu

In x86_cpu_get_supported_feature_word() we figure out the supported
features differently for each accelerator. The default case is
"set all feature bits"; however this triggers a warning because
it enables two features which conflict with each other:

$ ./build/x86/qemu-system-x86_64   -cpu max -accel qtest -S
qemu-system-x86_64: warning: this feature conflicts with APX: CPUID[eax=07h,ecx=00h].EBX.mpx [bit 14]
qemu-system-x86_64: warning: this feature conflicts with MPX: CPUID[eax=07h,ecx=01h].EDX.apxf [bit 21]

Treat qtest like TCG here, to avoid the complaint.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
This suggests to me that the default case is not something
we ever want to be in, and we should instead be exhaustively
enumerating the accelerators and asserting if we don't know
how to handle this for the accelerator in use. But there are
several accelerators that we don't have code for here...
---
 target/i386/cpu.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 3b0a7c7363..c6fd1dc00e 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -8087,7 +8087,7 @@ uint64_t x86_cpu_get_supported_feature_word(X86CPU *cpu, FeatureWord w)
         r = hvf_get_supported_cpuid(wi->cpuid.eax,
                                     wi->cpuid.ecx,
                                     wi->cpuid.reg);
-    } else if (tcg_enabled()) {
+    } else if (tcg_enabled() || qtest_enabled()) {
         r = wi->tcg_features;
     } else {
         return ~0;
-- 
2.43.0



^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH] target/i386: Treat qtest like TCG for supported-features
  2026-03-30 15:14 [PATCH] target/i386: Treat qtest like TCG for supported-features Peter Maydell
@ 2026-03-30 21:58 ` Philippe Mathieu-Daudé
  2026-03-31  8:46 ` Zhao Liu
  2026-03-31 13:07 ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-03-30 21:58 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Paolo Bonzini, Zhao Liu

On 30/3/26 17:14, Peter Maydell wrote:
> In x86_cpu_get_supported_feature_word() we figure out the supported
> features differently for each accelerator. The default case is
> "set all feature bits"; however this triggers a warning because
> it enables two features which conflict with each other:
> 
> $ ./build/x86/qemu-system-x86_64   -cpu max -accel qtest -S
> qemu-system-x86_64: warning: this feature conflicts with APX: CPUID[eax=07h,ecx=00h].EBX.mpx [bit 14]
> qemu-system-x86_64: warning: this feature conflicts with MPX: CPUID[eax=07h,ecx=01h].EDX.apxf [bit 21]
> 
> Treat qtest like TCG here, to avoid the complaint.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> This suggests to me that the default case is not something
> we ever want to be in, and we should instead be exhaustively
> enumerating the accelerators and asserting if we don't know
> how to handle this for the accelerator in use. But there are
> several accelerators that we don't have code for here...

Indeed. Meanwhile:
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>

> ---
>   target/i386/cpu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target/i386: Treat qtest like TCG for supported-features
  2026-03-30 15:14 [PATCH] target/i386: Treat qtest like TCG for supported-features Peter Maydell
  2026-03-30 21:58 ` Philippe Mathieu-Daudé
@ 2026-03-31  8:46 ` Zhao Liu
  2026-03-31 13:07 ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 4+ messages in thread
From: Zhao Liu @ 2026-03-31  8:46 UTC (permalink / raw)
  To: Peter Maydell; +Cc: qemu-devel, Paolo Bonzini

On Mon, Mar 30, 2026 at 04:14:37PM +0100, Peter Maydell wrote:
> Date: Mon, 30 Mar 2026 16:14:37 +0100
> From: Peter Maydell <peter.maydell@linaro.org>
> Subject: [PATCH] target/i386: Treat qtest like TCG for supported-features
> X-Mailer: git-send-email 2.43.0
> 
> In x86_cpu_get_supported_feature_word() we figure out the supported
> features differently for each accelerator. The default case is
> "set all feature bits"; however this triggers a warning because
> it enables two features which conflict with each other:
> 
> $ ./build/x86/qemu-system-x86_64   -cpu max -accel qtest -S
> qemu-system-x86_64: warning: this feature conflicts with APX: CPUID[eax=07h,ecx=00h].EBX.mpx [bit 14]
> qemu-system-x86_64: warning: this feature conflicts with MPX: CPUID[eax=07h,ecx=01h].EDX.apxf [bit 21]
> 
> Treat qtest like TCG here, to avoid the complaint.

I see, this is a proper way to resolve this for max cpu with qtest,

> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

so,

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

> ---
> This suggests to me that the default case is not something
> we ever want to be in, and we should instead be exhaustively
> enumerating the accelerators and asserting if we don't know
> how to handle this for the accelerator in use. But there are
> several accelerators that we don't have code for here...

yes, when I have some time, I’d see if I can sort this out, to clarify
what accelerator needs to be covered here.

Regards,
Zhao



^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] target/i386: Treat qtest like TCG for supported-features
  2026-03-30 15:14 [PATCH] target/i386: Treat qtest like TCG for supported-features Peter Maydell
  2026-03-30 21:58 ` Philippe Mathieu-Daudé
  2026-03-31  8:46 ` Zhao Liu
@ 2026-03-31 13:07 ` Philippe Mathieu-Daudé
  2 siblings, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2026-03-31 13:07 UTC (permalink / raw)
  To: Peter Maydell, qemu-devel; +Cc: Paolo Bonzini, Zhao Liu

On 30/3/26 17:14, Peter Maydell wrote:
> In x86_cpu_get_supported_feature_word() we figure out the supported
> features differently for each accelerator. The default case is
> "set all feature bits"; however this triggers a warning because
> it enables two features which conflict with each other:
> 
> $ ./build/x86/qemu-system-x86_64   -cpu max -accel qtest -S
> qemu-system-x86_64: warning: this feature conflicts with APX: CPUID[eax=07h,ecx=00h].EBX.mpx [bit 14]
> qemu-system-x86_64: warning: this feature conflicts with MPX: CPUID[eax=07h,ecx=01h].EDX.apxf [bit 21]
> 
> Treat qtest like TCG here, to avoid the complaint.
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> This suggests to me that the default case is not something
> we ever want to be in, and we should instead be exhaustively
> enumerating the accelerators and asserting if we don't know
> how to handle this for the accelerator in use. But there are
> several accelerators that we don't have code for here...
> ---
>   target/i386/cpu.c | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Queued via hw-misc tree, thanks.


^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-03-31 13:07 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-30 15:14 [PATCH] target/i386: Treat qtest like TCG for supported-features Peter Maydell
2026-03-30 21:58 ` Philippe Mathieu-Daudé
2026-03-31  8:46 ` Zhao Liu
2026-03-31 13:07 ` Philippe Mathieu-Daudé

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.