diff mbox

[v4,5/5] ppc: drop vcpu_idt_id bits from the target code

Message ID 146832564976.14159.546213803318298318.stgit@bahia.lan (mailing list archive)
State New, archived
Headers show

Commit Message

Greg Kurz July 12, 2016, 12:15 p.m. UTC
Now that all machine types provide vcpu_dt_id, we can safely drop these
bits from the target code.

Signed-off-by: Greg Kurz <groug@kaod.org>
---
v4: keep max_smt needed by smp_threads sanity checks
---
 target-ppc/translate_init.c |   15 ---------------
 1 file changed, 15 deletions(-)
diff mbox

Patch

diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c
index 31120a5aaf33..9b3acd55d7fb 100644
--- a/target-ppc/translate_init.c
+++ b/target-ppc/translate_init.c
@@ -9529,9 +9529,7 @@  static void ppc_cpu_realizefn(DeviceState *dev, Error **errp)
     Error *local_err = NULL;
 #if !defined(CONFIG_USER_ONLY)
     int max_smt = kvmppc_smt_threads();
-#endif
 
-#if !defined(CONFIG_USER_ONLY)
     if (smp_threads > max_smt) {
         error_setg(errp, "Cannot support more than %d threads on PPC with %s",
                    max_smt, kvm_enabled() ? "KVM" : "TCG");
@@ -9551,19 +9549,6 @@  static void ppc_cpu_realizefn(DeviceState *dev, Error **errp)
         return;
     }
 
-#if !defined(CONFIG_USER_ONLY)
-    cpu->cpu_dt_id = (cs->cpu_index / smp_threads) * max_smt
-        + (cs->cpu_index % smp_threads);
-
-    if (kvm_enabled() && !kvm_vcpu_id_is_valid(cpu->cpu_dt_id)) {
-        error_setg(errp, "Can't create CPU with id %d in KVM", cpu->cpu_dt_id);
-        error_append_hint(errp, "Adjust the number of cpus to %d "
-                          "or try to raise the number of threads per core\n",
-                          cpu->cpu_dt_id * smp_threads / max_smt);
-        return;
-    }
-#endif
-
     if (tcg_enabled()) {
         if (ppc_fixup_cpu(cpu) != 0) {
             error_setg(errp, "Unable to emulate selected CPU with TCG");