From patchwork Wed Jul 6 12:13:30 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg Kurz X-Patchwork-Id: 9216269 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A73D460752 for ; Wed, 6 Jul 2016 12:16:23 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9787B28880 for ; Wed, 6 Jul 2016 12:16:23 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 8BA2328882; Wed, 6 Jul 2016 12:16:23 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id E9BE628880 for ; Wed, 6 Jul 2016 12:16:22 +0000 (UTC) Received: from localhost ([::1]:33242 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKlkb-0000YH-Pl for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Jul 2016 08:16:21 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:32956) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKliF-00060y-Jj for qemu-devel@nongnu.org; Wed, 06 Jul 2016 08:13:59 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bKliB-0002ak-Bg for qemu-devel@nongnu.org; Wed, 06 Jul 2016 08:13:55 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:44648) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bKliB-0002aJ-2c for qemu-devel@nongnu.org; Wed, 06 Jul 2016 08:13:51 -0400 Received: from pps.filterd (m0098396.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.11/8.16.0.11) with SMTP id u66C9ZRm040302 for ; Wed, 6 Jul 2016 08:13:50 -0400 Received: from e33.co.us.ibm.com (e33.co.us.ibm.com [32.97.110.151]) by mx0a-001b2d01.pphosted.com with ESMTP id 240nf25cs8-1 (version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT) for ; Wed, 06 Jul 2016 08:13:50 -0400 Received: from localhost by e33.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 6 Jul 2016 06:13:48 -0600 Received: from d03dlp01.boulder.ibm.com (9.17.202.177) by e33.co.us.ibm.com (192.168.1.133) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; Wed, 6 Jul 2016 06:13:33 -0600 X-IBM-Helo: d03dlp01.boulder.ibm.com X-IBM-MailFrom: groug@kaod.org Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by d03dlp01.boulder.ibm.com (Postfix) with ESMTP id A7D351FF001E; Wed, 6 Jul 2016 06:13:16 -0600 (MDT) Received: from b03ledav001.gho.boulder.ibm.com (b03ledav001.gho.boulder.ibm.com [9.17.130.232]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u66CDXfY39256096; Wed, 6 Jul 2016 05:13:33 -0700 Received: from b03ledav001.gho.boulder.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1A2CA6E040; Wed, 6 Jul 2016 06:13:33 -0600 (MDT) Received: from bahia.lab.toulouse-stg.fr.ibm.com (unknown [9.101.4.41]) by b03ledav001.gho.boulder.ibm.com (Postfix) with ESMTP id 54E976E03D; Wed, 6 Jul 2016 06:13:31 -0600 (MDT) From: Greg Kurz To: David Gibson Date: Wed, 06 Jul 2016 14:13:30 +0200 In-Reply-To: <146780713904.26232.12351310667258006783.stgit@bahia.lab.toulouse-stg.fr.ibm.com> References: <146780713904.26232.12351310667258006783.stgit@bahia.lab.toulouse-stg.fr.ibm.com> User-Agent: StGit/0.17.1-dirty MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Content-Scanned: Fidelis XPS MAILER x-cbid: 16070612-0008-0000-0000-000004FD4EC2 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 16070612-0009-0000-0000-0000390F28E2 Message-Id: <146780720136.26232.7902445403479806617.stgit@bahia.lab.toulouse-stg.fr.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2016-07-06_05:, , signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 suspectscore=0 malwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1604210000 definitions=main-1607060108 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 Subject: [Qemu-devel] [PATCH v3 2/7] ppc: move smp_threads sanity checks to spapr X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Eduardo Habkost , Alexander Graf , qemu-devel@nongnu.org, qemu-ppc@nongnu.org, Cedric Le Goater , Bharata B Rao , Scott Wood , Igor Mammedov Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Only POWER5 and newer PowerPC cpus from IBM have SMT capabilities. Since they are only supported by pseries, let's move the checks to ppc_spapr_init(). Signed-off-by: Greg Kurz --- hw/ppc/spapr.c | 12 ++++++++++++ target-ppc/translate_init.c | 14 -------------- 2 files changed, 12 insertions(+), 14 deletions(-) diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c index d134eb2f338e..09600fee19b2 100644 --- a/hw/ppc/spapr.c +++ b/hw/ppc/spapr.c @@ -1739,6 +1739,18 @@ static void ppc_spapr_init(MachineState *machine) } } + if (smp_threads > smt) { + error_report("Cannot support more than %d threads on PPC with %s", + smt, kvm_enabled() ? "KVM" : "TCG"); + exit(1); + } + if (!is_power_of_2(smp_threads)) { + error_report("Cannot support %d threads on PPC with %s, " + "threads count must be a power of 2.", + smp_threads, kvm_enabled() ? "KVM" : "TCG"); + exit(1); + } + msi_nonbroken = true; QLIST_INIT(&spapr->phbs); diff --git a/target-ppc/translate_init.c b/target-ppc/translate_init.c index 31120a5aaf33..775df72cf6c2 100644 --- a/target-ppc/translate_init.c +++ b/target-ppc/translate_init.c @@ -9531,20 +9531,6 @@ static void ppc_cpu_realizefn(DeviceState *dev, Error **errp) 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"); - return; - } - if (!is_power_of_2(smp_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"); - return; - } -#endif - cpu_exec_init(cs, &local_err); if (local_err != NULL) { error_propagate(errp, local_err);