aboutsummaryrefslogtreecommitdiff
path: root/target/i386/cpu.c
diff options
context:
space:
mode:
authorVitaly Kuznetsov <vkuznets@redhat.com>2021-06-08 14:08:13 +0200
committerEduardo Habkost <ehabkost@redhat.com>2021-07-13 09:13:29 -0400
commit071ce4b03becf9e2df6b758fde9609be8ddf56f1 (patch)
tree25d8806960b1497e2e709682c9725364e95cab62 /target/i386/cpu.c
parentd7652b772f302346c8f1043aa850a28c445e80d7 (diff)
downloadqemu-071ce4b03becf9e2df6b758fde9609be8ddf56f1.zip
qemu-071ce4b03becf9e2df6b758fde9609be8ddf56f1.tar.gz
qemu-071ce4b03becf9e2df6b758fde9609be8ddf56f1.tar.bz2
i386: expand Hyper-V features during CPU feature expansion time
To make Hyper-V features appear in e.g. QMP query-cpu-model-expansion we need to expand and set the corresponding CPUID leaves early. Modify x86_cpu_get_supported_feature_word() to call newly intoduced Hyper-V specific kvm_hv_get_supported_cpuid() instead of kvm_arch_get_supported_cpuid(). We can't use kvm_arch_get_supported_cpuid() as Hyper-V specific CPUID leaves intersect with KVM's. Note, early expansion will only happen when KVM supports system wide KVM_GET_SUPPORTED_HV_CPUID ioctl (KVM_CAP_SYS_HYPERV_CPUID). Reviewed-by: Eduardo Habkost <ehabkost@redhat.com> Signed-off-by: Vitaly Kuznetsov <vkuznets@redhat.com> Message-Id: <20210608120817.1325125-6-vkuznets@redhat.com> Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
Diffstat (limited to 'target/i386/cpu.c')
-rw-r--r--target/i386/cpu.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/target/i386/cpu.c b/target/i386/cpu.c
index 5f595a0..46befde 100644
--- a/target/i386/cpu.c
+++ b/target/i386/cpu.c
@@ -5974,6 +5974,10 @@ void x86_cpu_expand_features(X86CPU *cpu, Error **errp)
if (env->cpuid_xlevel2 == UINT32_MAX) {
env->cpuid_xlevel2 = env->cpuid_min_xlevel2;
}
+
+ if (kvm_enabled()) {
+ kvm_hyperv_expand_features(cpu, errp);
+ }
}
/*