[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 4/5] target-i386: Clear KVM CPUID features if KVM is
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PATCH 4/5] target-i386: Clear KVM CPUID features if KVM is disabled |
Date: |
Mon, 26 Sep 2016 19:24:09 -0300 |
This will ensure all checks for features[FEAT_KVM] in the code
will be correct in case the KVM CPUID leaf is completely
disabled.
Signed-off-by: Eduardo Habkost <address@hidden>
---
target-i386/cpu.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index db12728..8aa2b0f 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -2998,6 +2998,10 @@ static void x86_cpu_realizefn(DeviceState *dev, Error
**errp)
cpu->env.features[w] &= ~minus_features[w];
}
+ if (!kvm_enabled() || !cpu->expose_kvm) {
+ env->features[FEAT_KVM] = 0;
+ }
+
if (env->features[FEAT_7_0_EBX] && env->cpuid_level < 7) {
env->cpuid_level = 7;
}
--
2.7.4
- [Qemu-devel] [PATCH 0/5] target-i386: Eliminate unnecessary has_msr_* global variables, Eduardo Habkost, 2016/09/26
- [Qemu-devel] [PATCH 1/5] target-i386: Remove has_msr_mtrr global variable, Eduardo Habkost, 2016/09/26
- [Qemu-devel] [PATCH 2/5] target-i386: Remove has_msr_hv_apic global variable, Eduardo Habkost, 2016/09/26
- [Qemu-devel] [PATCH 3/5] target-i386: Remove has_msr_hv_tsc global variable, Eduardo Habkost, 2016/09/26
- [Qemu-devel] [PATCH 4/5] target-i386: Clear KVM CPUID features if KVM is disabled,
Eduardo Habkost <=
- [Qemu-devel] [PATCH 5/5] target-i386: Remove has_msr_* global vars for KVM features, Eduardo Habkost, 2016/09/26
- Re: [Qemu-devel] [PATCH 0/5] target-i386: Eliminate unnecessary has_msr_* global variables, Paolo Bonzini, 2016/09/27