@samitouri / QOSamiQemu / commits / 0bb959afd5

target/i386/mshv: fix cpuid propagation bug

The list argument was missing a pointer and hence e.g. -cpu qemu64 and -cpu EPYC would produce the same of cpuid leaves. Fixes: 4fa04dd1621 ("target/i386: Register CPUID entries with MSHV") Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com> Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Anirudh Rayabharam (Microsoft) <anirudh@anirudhrb.com> Reviewed-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com> Link: https://lore.kernel.org/r/20260416121116.527927-3-magnuskulke@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Magnus Kulke committed Apr 16, 2026 at 14:11 UTC 0bb959afd5d910a9166c499e07e8f3df028ca341
1 file changed +4 -4
target/i386/mshv/mshv-cpu.c
+4 -4
@@ -441,7 +441,7 @@ int mshv_load_regs(CPUState *cpu)
441 return 0;
442 }
443
444 -static void add_cpuid_entry(GList *cpuid_entries,
444 +static void add_cpuid_entry(GList **cpuid_entries,
445 uint32_t function, uint32_t index,
446 uint32_t eax, uint32_t ebx,
447 uint32_t ecx, uint32_t edx)
@@ -456,10 +456,10 @@ static void add_cpuid_entry(GList *cpuid_entries,
456 entry->ecx = ecx;
457 entry->edx = edx;
458
459 - cpuid_entries = g_list_append(cpuid_entries, entry);
459 + *cpuid_entries = g_list_append(*cpuid_entries, entry);
460 }
461
462 -static void collect_cpuid_entries(const CPUState *cpu, GList *cpuid_entries)
462 +static void collect_cpuid_entries(const CPUState *cpu, GList **cpuid_entries)
463 {
464 X86CPU *x86_cpu = X86_CPU(cpu);
465 CPUX86State *env = &x86_cpu->env;
@@ -615,7 +615,7 @@ static int set_cpuid2(const CPUState *cpu)
615 struct hv_cpuid_entry *entry;
616 GList *entries = NULL;
617
618 - collect_cpuid_entries(cpu, entries);
618 + collect_cpuid_entries(cpu, &entries);
619 n_entries = g_list_length(entries);
620
621 cpuid_size = sizeof(struct hv_cpuid)