@samitouri / QOSamiQemu / commits / 2f6da91e8a

target/i386/mshv: change cpuid mask to UINT32_MAX

The current implementation would only override the feature bits that are enabled, however we also want to consider disabled features, hence all bits are set on the masks in the hypercall argument. Signed-off-by: Magnus Kulke <magnuskulke@linux.microsoft.com> Acked-by: Wei Liu <wei.liu@kernel.org> Reviewed-by: Doru Blânzeanu <dblanzeanu@linux.microsoft.com> Link: https://lore.kernel.org/r/20260416121116.527927-5-magnuskulke@linux.microsoft.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>

Magnus Kulke committed Apr 16, 2026 at 14:11 UTC 2f6da91e8af3157f477e4b9d8feaa90520cc90ac
1 file changed +6 -11
target/i386/mshv/mshv-cpu.c
+6 -11
@@ -538,22 +538,17 @@ static int register_intercept_result_cpuid_entry(const CPUState *cpu,
538 .input.always_override = always_override,
539 .input.padding = 0,
540 /*
541 - * With regard to masks - these are to specify bits to be overwritten
542 - * The current CpuidEntry structure wouldn't allow to carry the masks
543 - * in addition to the actual register values. For this reason, the
544 - * masks are set to the exact values of the corresponding register bits
545 - * to be registered for an overwrite. To view resulting values the
546 - * hypervisor would return, HvCallGetVpCpuidValues hypercall can be
547 - * used.
541 + * Masks specify which bits to override. Set to 0xFFFFFFFF to
542 + * override all bits with the values from the QEMU CPU model.
543 */
544 .result.eax = entry->eax,
550 - .result.eax_mask = entry->eax,
545 + .result.eax_mask = 0xFFFFFFFF,
546 .result.ebx = entry->ebx,
552 - .result.ebx_mask = entry->ebx,
547 + .result.ebx_mask = 0xFFFFFFFF,
548 .result.ecx = entry->ecx,
554 - .result.ecx_mask = entry->ecx,
549 + .result.ecx_mask = 0xFFFFFFFF,
550 .result.edx = entry->edx,
556 - .result.edx_mask = entry->edx,
551 + .result.edx_mask = 0xFFFFFFFF,
552 };
553 union hv_register_intercept_result_parameters parameters = {
554 .cpuid = cpuid_params,