tcg/i386: Display AMD HT warning only for KVM
PATCH 1/1 tcg/i386: Display AMD HT warning only for KVM
TCG uses the AMD cpu which warns when we use hyperthreading. Disable the warning for TCG since it is not necessary.
--- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
target/i386/cpu.c +1 -1
@@ -3647,7 +3647,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)* NOTE: the following code has to follow qemu_init_vcpu(). Otherwise * cs->nr_threads hasn't be populated yet and the checking is incorrect. */ -if (!IS_INTEL_CPU (env) && cs->nr_threads >1 && !ht_warned) { +if (!IS_INTEL_CPU (env) && cs->nr_threads >1 && !ht_warned &&kvm_enabled ()) {error_report ("AMD CPU doesn't support hyperthreading. Please configure" " -smp options properly." ); ht_warned = true;
Signature · 1 line
2.11.0
Paolo Bonzini
maintainerQuoted 13 lines · Pranith Kumar
TCG uses the AMD cpu which warns when we use hyperthreading. Disable the warning for TCG since it is not necessary.
Signed-off-by Pranith Kumar <[email protected]>--- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)target/i386/cpu.c +0
-0
target/i386/cpu.c static void x86_cpu_realizefn(DeviceState *dev, Error **errp) · line 3653
Quoted 8 lines
target/i386/cpu.c +1
-1@@ -3647,7 +3647,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)* NOTE: the following code has to follow qemu_init_vcpu(). Otherwise * cs->nr_threads hasn't be populated yet and the checking is incorrect. */ -if (!IS_INTEL_CPU (env) && cs->nr_threads >1 && !ht_warned) { +if (!IS_INTEL_CPU (env) && cs->nr_threads >1 && !ht_warned &&kvm_enabled ()) {error_report ("AMD CPU doesn't support hyperthreading. Please configure" " -smp options properly." ); ht_warned = true;
AMD Zen supports hyperthreading. We should check if it uses the same CPUID leaves and drop the if completely (but not in 2.9).
Paolo
Quoted 9 lines · Paolo Bonzini
Quoted 8 lines · Pranith Kumar
TCG uses the AMD cpu which warns when we use hyperthreading. Disable the warning for TCG since it is not necessary.
Signed-off-by Pranith Kumar <[email protected]>--- target/i386/cpu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Quoted 16 lines
target/i386/cpu.c static void x86_cpu_realizefn(DeviceState *dev, Error **errp) · line 3653
Quoted 13 lines
target/i386/cpu.c +1
-1@@ -3647,7 +3647,7 @@ static void x86_cpu_realizefn(DeviceState *dev, Error **errp)* NOTE: the following code has to follow qemu_init_vcpu(). Otherwise * cs->nr_threads hasn't be populated yet and the checking is incorrect. */ -if (!IS_INTEL_CPU (env) && cs->nr_threads >1 && !ht_warned) { +if (!IS_INTEL_CPU (env) && cs->nr_threads >1 && !ht_warned &&kvm_enabled ()) {error_report ("AMD CPU doesn't support hyperthreading. Please configure" " -smp options properly." ); ht_warned = true;AMD Zen supports hyperthreading. We should check if it uses the same CPUID leaves and drop the if completely (but not in 2.9).
AMD's CPUID specification documents the same bit (CPUID[1].EDX[bit 28]) as "HTT: hyper-threading technology".
However:
* Their Extended Method for topology enumeration ignores HTT and CmpLegacy, and has contiguous APIC IDs assigned for each core[1]. I don't know if their Extended Method is compatible[2] with the topology information we expose when nr_threads>1. (I expect it to be compatible, but I'm not sure.)
* Their docs for the Legacy Method for CPU topology enumeration don't mention what to do if CmpLegacy=0, HTT=1.
[1] The APIC ID formula is:
LocalApicId[proc=i, core=j] = (OFFSET_IDX + i) * MNC + j
[2] By compatible, I mean placing the cores/threads at the right physical processor, at least (even if it treats each thread as a separate core).
Signature · 1 line
Eduardo