qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] target/i386: Fix cpuid level for AMD
@ 2021-06-28 13:20 zhenwei pi
  2021-06-29 14:06 ` Dr. David Alan Gilbert
  0 siblings, 1 reply; 14+ messages in thread
From: zhenwei pi @ 2021-06-28 13:20 UTC (permalink / raw)
  To: ehabkost, pbonzini, richard.henderson, philmd, armbru
  Cc: zhenwei pi, qemu-devel, like.xu

A AMD server typically has cpuid level 0x10(test on Rome/Milan), it
should not be changed to 0x1f in multi-dies case.

Fixes: a94e1428991 (target/i386: Add CPUID.1F generation support
for multi-dies PCMachine)
Signed-off-by: zhenwei pi <pizhenwei@bytedance.com>
---
 target/i386/cpu.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index a9fe1662d3..3934c559e4 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5961,8 +5961,12 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
             }
         }
 
-        /* CPU topology with multi-dies support requires CPUID[0x1F] */
-        if (env->nr_dies > 1) {
+        /*
+         * Intel CPU topology with multi-dies support requires CPUID[0x1F].
+         * For AMD Rome/Milan, cpuid level is 0x10, and guest OS should detect
+         * extended toplogy by leaf 0xB. Only adjust it for Intel CPU.
+         */
+        if ((env->nr_dies > 1) && IS_INTEL_CPU(env)) {
             x86_cpu_adjust_level(cpu, &env->cpuid_min_level, 0x1F);
         }
 
-- 
2.25.1



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

end of thread, other threads:[~2021-07-08 13:21 UTC | newest]

Thread overview: 14+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-28 13:20 [PATCH] target/i386: Fix cpuid level for AMD zhenwei pi
2021-06-29 14:06 ` Dr. David Alan Gilbert
2021-06-29 21:29   ` Babu Moger
2021-06-30 19:18   ` Michael Roth
2021-07-01  8:43     ` Igor Mammedov
2021-07-01 20:35       ` Michael Roth
2021-07-02  5:14         ` [External] " zhenwei pi
2021-07-02 15:43           ` Michael Roth
2021-07-02 17:35             ` Eduardo Habkost
2021-07-08  5:11               ` Michael Roth
2021-07-08 13:09                 ` 皮振伟
2021-07-02  6:50         ` David Edmondson
2021-07-02 15:40           ` Michael Roth
2021-07-02 17:32     ` Eduardo Habkost

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).