@samitouri / QOSamiQemu / commits / 804cca26dc

target/i386/kvm: Remove X86CPU::hyperv_synic_kvm_only field

The X86CPU::hyperv_synic_kvm_only boolean (see commit 9b4cf107b09 "hyperv: only add SynIC in compatible configurations") was only set in the pc_compat_3_0[] array, via the 'x-hv-synic-kvm-only=on' property. We removed all machines using that array, lets remove that property and all the code around it. Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org> Reviewed-by: Thomas Huth <thuth@redhat.com> Message-Id: <20260307150042.78030-4-philmd@linaro.org>

Philippe Mathieu-Daudé committed Mar 7, 2026 at 12:28 UTC 804cca26dc9be59c6e020641b865012b96faf021
3 files changed +4 -14
target/i386/cpu.c
-2
@@ -10589,8 +10589,6 @@ static const Property x86_cpu_properties[] = {
10589 * to the specific Windows version being used."
10590 */
10591 DEFINE_PROP_INT32("x-hv-max-vps", X86CPU, hv_max_vps, -1),
10592 - DEFINE_PROP_BOOL("x-hv-synic-kvm-only", X86CPU, hyperv_synic_kvm_only,
10593 - false),
10592 DEFINE_PROP_BOOL("x-intel-pt-auto-level", X86CPU, intel_pt_auto_level,
10593 true),
10594 DEFINE_PROP_BOOL("x-l1-cache-per-thread", X86CPU, l1_cache_per_core, true),
target/i386/cpu.h
-1
@@ -2335,7 +2335,6 @@ struct ArchCPU {
2335
2336 uint32_t hyperv_spinlock_attempts;
2337 char *hyperv_vendor;
2338 - bool hyperv_synic_kvm_only;
2338 uint64_t hyperv_features;
2339 bool hyperv_passthrough;
2340 OnOffAuto hyperv_no_nonarch_cs;
target/i386/kvm/kvm.c
+4 -11
@@ -1278,10 +1278,7 @@ static struct kvm_cpuid2 *get_supported_hv_cpuid_legacy(CPUState *cs)
1278 }
1279
1280 if (has_msr_hv_synic) {
1281 - unsigned int cap = cpu->hyperv_synic_kvm_only ?
1282 - KVM_CAP_HYPERV_SYNIC : KVM_CAP_HYPERV_SYNIC2;
1283 -
1284 - if (kvm_check_extension(cs->kvm_state, cap) > 0) {
1281 + if (kvm_check_extension(cs->kvm_state, KVM_CAP_HYPERV_SYNIC2) > 0) {
1282 entry_feat->eax |= HV_SYNIC_AVAILABLE;
1283 }
1284 }
@@ -1543,7 +1540,6 @@ bool kvm_hyperv_expand_features(X86CPU *cpu, Error **errp)
1540
1541 /* Additional dependencies not covered by kvm_hyperv_properties[] */
1542 if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC) &&
1546 - !cpu->hyperv_synic_kvm_only &&
1543 !hyperv_feat_enabled(cpu, HYPERV_FEAT_VPINDEX)) {
1544 error_setg(errp, "Hyper-V %s requires Hyper-V %s",
1545 kvm_hyperv_properties[HYPERV_FEAT_SYNIC].desc,
@@ -1608,8 +1604,7 @@ static int hyperv_fill_cpuids(CPUState *cs,
1604 c->eax |= HV_HYPERCALL_AVAILABLE;
1605
1606 /* SynIC and Vmbus devices require messages/signals hypercalls */
1611 - if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC) &&
1612 - !cpu->hyperv_synic_kvm_only) {
1607 + if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
1608 c->ebx |= HV_POST_MESSAGES | HV_SIGNAL_EVENTS;
1609 }
1610
@@ -1752,16 +1747,14 @@ static int hyperv_init_vcpu(X86CPU *cpu)
1747 }
1748
1749 if (hyperv_feat_enabled(cpu, HYPERV_FEAT_SYNIC)) {
1755 - uint32_t synic_cap = cpu->hyperv_synic_kvm_only ?
1756 - KVM_CAP_HYPERV_SYNIC : KVM_CAP_HYPERV_SYNIC2;
1757 - ret = kvm_vcpu_enable_cap(cs, synic_cap, 0);
1750 + ret = kvm_vcpu_enable_cap(cs, KVM_CAP_HYPERV_SYNIC2, 0);
1751 if (ret < 0) {
1752 error_report("failed to turn on HyperV SynIC in KVM: %s",
1753 strerror(-ret));
1754 return ret;
1755 }
1756
1764 - if (!cpu->hyperv_synic_kvm_only && !hyperv_is_synic_enabled()) {
1757 + if (!hyperv_is_synic_enabled()) {
1758 ret = hyperv_x86_synic_add(cpu);
1759 if (ret < 0) {
1760 error_report("failed to create HyperV SynIC: %s",