@@ -1129,7 +1129,7 @@ static void kvm_trim_features(uint32_t *features, uint32_t supported)
}
}
-int kvm_arch_init_vcpu(CPUState *env)
+static int _kvm_arch_init_vcpu(CPUState *env)
{
struct kvm_cpuid_entry2 cpuid_ent[100];
#ifdef KVM_CPUID_SIGNATURE
@@ -163,10 +163,13 @@ static int get_para_features(CPUState *env)
}
#endif
-#ifdef KVM_UPSTREAM
+static int _kvm_arch_init_vcpu(CPUState *env);
int kvm_arch_init_vcpu(CPUState *env)
{
+ int r;
+#ifdef KVM_UPSTREAM
+
struct {
struct kvm_cpuid2 cpuid;
struct kvm_cpuid_entry2 entries[100];
@@ -178,6 +181,15 @@ int kvm_arch_init_vcpu(CPUState *env)
uint32_t signature[3];
#endif
+#endif
+
+ r = _kvm_arch_init_vcpu(env);
+ if (r < 0) {
+ return r;
+ }
+
+#ifdef KVM_UPSTREAM
+
env->mp_state = KVM_MP_STATE_RUNNABLE;
env->cpuid_features &= kvm_arch_get_supported_cpuid(env, 1, R_EDX);
@@ -273,9 +285,10 @@ int kvm_arch_init_vcpu(CPUState *env)
cpuid_data.cpuid.nent = cpuid_i;
return kvm_vcpu_ioctl(env, KVM_SET_CPUID2, &cpuid_data);
+#endif
+ return 0;
}
-#endif
void kvm_arch_reset_vcpu(CPUState *env)
{
env->exception_injected = -1;