[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 06/10] target-i386: Remove assert(kvm_enabled()) from
From: |
Eduardo Habkost |
Subject: |
[Qemu-devel] [PULL 06/10] target-i386: Remove assert(kvm_enabled()) from host_x86_cpu_initfn() |
Date: |
Tue, 14 Jun 2016 17:59:04 -0300 |
The code will be changed to allow creation of the CPU object and
report kvm_required errors only at realizefn, so we need to make
the instance_init function more flexible.
Reviewed-by: Igor Mammedov <address@hidden>
Signed-off-by: Eduardo Habkost <address@hidden>
---
target-i386/cpu.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/target-i386/cpu.c b/target-i386/cpu.c
index 647cd30..c91902f 100644
--- a/target-i386/cpu.c
+++ b/target-i386/cpu.c
@@ -1547,16 +1547,17 @@ static void host_x86_cpu_initfn(Object *obj)
CPUX86State *env = &cpu->env;
KVMState *s = kvm_state;
- assert(kvm_enabled());
-
/* We can't fill the features array here because we don't know yet if
* "migratable" is true or false.
*/
cpu->host_features = true;
- env->cpuid_level = kvm_arch_get_supported_cpuid(s, 0x0, 0, R_EAX);
- env->cpuid_xlevel = kvm_arch_get_supported_cpuid(s, 0x80000000, 0, R_EAX);
- env->cpuid_xlevel2 = kvm_arch_get_supported_cpuid(s, 0xC0000000, 0, R_EAX);
+ /* If KVM is disabled, cpu_x86_create() will already report an error */
+ if (kvm_enabled()) {
+ env->cpuid_level = kvm_arch_get_supported_cpuid(s, 0x0, 0, R_EAX);
+ env->cpuid_xlevel = kvm_arch_get_supported_cpuid(s, 0x80000000, 0,
R_EAX);
+ env->cpuid_xlevel2 = kvm_arch_get_supported_cpuid(s, 0xC0000000, 0,
R_EAX);
+ }
object_property_set_bool(OBJECT(cpu), true, "pmu", &error_abort);
}
--
2.5.5
- [Qemu-devel] [PULL 00/10] X86 queue, 2016-06-14, Eduardo Habkost, 2016/06/14
- [Qemu-devel] [PULL 02/10] pc: Add 2.7 machine, Eduardo Habkost, 2016/06/14
- [Qemu-devel] [PULL 03/10] target-i386: Implement CPUID[0xB] (Extended Topology Enumeration), Eduardo Habkost, 2016/06/14
- [Qemu-devel] [PULL 01/10] target-i386: add Skylake-Client cpu model, Eduardo Habkost, 2016/06/14
- [Qemu-devel] [PULL 05/10] target-i386: Move features logic that requires CPUState to realize time, Eduardo Habkost, 2016/06/14
- [Qemu-devel] [PULL 07/10] target-i386: Move xcc->kvm_required check to realize time, Eduardo Habkost, 2016/06/14
- [Qemu-devel] [PULL 04/10] target-i386: Remove xlevel & hv-spinlocks option fixups, Eduardo Habkost, 2016/06/14
- [Qemu-devel] [PULL 08/10] target-i386: Use cpu_generic_init() in cpu_x86_init(), Eduardo Habkost, 2016/06/14
- [Qemu-devel] [PULL 06/10] target-i386: Remove assert(kvm_enabled()) from host_x86_cpu_initfn(),
Eduardo Habkost <=
- [Qemu-devel] [PULL 09/10] target-i386: Consolidate calls of object_property_parse() in x86_cpu_parse_featurestr, Eduardo Habkost, 2016/06/14
- [Qemu-devel] [PULL 10/10] target-i386: Print obsolete warnings if +-features are used, Eduardo Habkost, 2016/06/14
Re: [Qemu-devel] [PULL 00/10] X86 queue, 2016-06-14, Eduardo Habkost, 2016/06/14