From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56009) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bBQQh-0006jD-CT for qemu-devel@nongnu.org; Fri, 10 Jun 2016 13:41:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bBQQf-0000Uh-B4 for qemu-devel@nongnu.org; Fri, 10 Jun 2016 13:41:10 -0400 From: Andrew Jones Date: Fri, 10 Jun 2016 19:40:22 +0200 Message-Id: <1465580427-13596-12-git-send-email-drjones@redhat.com> In-Reply-To: <1465580427-13596-1-git-send-email-drjones@redhat.com> References: <1465580427-13596-1-git-send-email-drjones@redhat.com> Subject: [Qemu-devel] [PATCH RFC 11/16] target-ppc: don't use smp_threads List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org, qemu-ppc@nongnu.org, qemu-arm@nongnu.org Cc: imammedo@redhat.com, ehabkost@redhat.com, pbonzini@redhat.com, peter.maydell@linaro.org, david@gibson.dropbear.id.au, dgibson@redhat.com, agraf@suse.de Use CPUState nr_threads instead. Signed-off-by: Andrew Jones --- target-ppc/translate_init.c | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index a1db5009c4a83..f442b2fc934d1 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -24,7 +24,6 @@ #include #include "kvm_ppc.h" #include "sysemu/arch_init.h" -#include "sysemu/cpus.h" #include "cpu-models.h" #include "mmu-hash32.h" #include "mmu-hash64.h" @@ -9228,15 +9227,15 @@ static void ppc_cpu_realizefn(DeviceState *dev, Error **errp) #endif #if !defined(CONFIG_USER_ONLY) - if (smp_threads > max_smt) { + if (cs->nr_threads > max_smt) { error_setg(errp, "Cannot support more than %d threads on PPC with %s", max_smt, kvm_enabled() ? "KVM" : "TCG"); return; } - if (!is_power_of_2(smp_threads)) { + if (!is_power_of_2(cs->nr_threads)) { error_setg(errp, "Cannot support %d threads on PPC with %s, " "threads count must be a power of 2.", - smp_threads, kvm_enabled() ? "KVM" : "TCG"); + cs->nr_threads, kvm_enabled() ? "KVM" : "TCG"); return; } #endif @@ -9248,14 +9247,14 @@ static void ppc_cpu_realizefn(DeviceState *dev, Error **errp) } #if !defined(CONFIG_USER_ONLY) - cpu->cpu_dt_id = (cs->cpu_index / smp_threads) * max_smt - + (cs->cpu_index % smp_threads); + cpu->cpu_dt_id = (cs->cpu_index / cs->nr_threads) * max_smt + + (cs->cpu_index % cs->nr_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); + cpu->cpu_dt_id * cs->nr_threads / max_smt); return; } #endif @@ -9496,7 +9495,7 @@ static void ppc_cpu_unrealizefn(DeviceState *dev, Error **errp) int ppc_get_compat_smt_threads(PowerPCCPU *cpu) { - int ret = MIN(smp_threads, kvmppc_smt_threads()); + int ret = MIN(CPU(cpu)->nr_threads, kvmppc_smt_threads()); switch (cpu->cpu_version) { case CPU_POWERPC_LOGICAL_2_05: -- 2.4.11