[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH] The processor id in SMBIOS should be same as edx:eax that CPUID
From: |
windy |
Subject: |
[PATCH] The processor id in SMBIOS should be same as edx:eax that CPUID instruction returned. |
Date: |
Mon, 21 Feb 2022 18:52:05 +0800 |
Signed-off-by: windy <tai7sy@gmail.com>
---
hw/i386/fw_cfg.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/hw/i386/fw_cfg.c b/hw/i386/fw_cfg.c
index a283785..44f27ae 100644
--- a/hw/i386/fw_cfg.c
+++ b/hw/i386/fw_cfg.c
@@ -56,9 +56,14 @@ void fw_cfg_build_smbios(MachineState *ms, FWCfgState
*fw_cfg)
struct smbios_phys_mem_area *mem_array;
unsigned i, array_count;
X86CPU *cpu = X86_CPU(ms->possible_cpus->cpus[0].cpu);
+ CPUState *cs = CPU(cpu);
/* tell smbios about cpuid version and features */
- smbios_set_cpuid(cpu->env.cpuid_version, cpu->env.features[FEAT_1_EDX]);
+ uint32_t edx = cpu->env.features[FEAT_1_EDX];
+ if (cs->nr_cores * cs->nr_threads > 1) {
+ edx |= CPUID_HT;
+ }
+ smbios_set_cpuid(cpu->env.cpuid_version, edx);
smbios_tables = smbios_get_table_legacy(ms, &smbios_tables_len);
if (smbios_tables) {
--
1.8.3.1
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [PATCH] The processor id in SMBIOS should be same as edx:eax that CPUID instruction returned.,
windy <=