Comments
Patch
@@ -28,6 +28,7 @@
#include <kvm.h>
#include "kvm_ppc.h"
#include "arch_init.h"
+#include "cpus.h"
//#define PPC_DUMP_CPU
//#define PPC_DEBUG_SPR
@@ -10037,6 +10038,8 @@ static int ppc_fixup_cpu(CPUPPCState *env)
int cpu_ppc_register_internal (CPUPPCState *env, const ppc_def_t *def)
{
+ int max_smt = kvmppc_smt_threads();
+
env->msr_mask = def->msr_mask;
env->mmu_model = def->mmu_model;
env->excp_model = def->excp_model;
@@ -10046,6 +10049,11 @@ int cpu_ppc_register_internal (CPUPPCState *env, const ppc_def_t *def)
env->flags = def->flags;
env->bfd_mach = def->bfd_mach;
env->check_pow = def->check_pow;
+ if (smp_threads > max_smt){
+ fprintf(stderr, "Cannot support more than %d threads on PPC with %s\n",
+ max_smt, kvm_enabled() ? "KVM" : "TCG");
+ exit(1);
+ }
#if defined(TARGET_PPC64)
if (def->sps)