[{"id":1764461,"web_url":"http://patchwork.ozlabs.org/comment/1764461/","msgid":"<06db0a9c-e8e6-5b28-d8f3-bd953c102ed9@linux.vnet.ibm.com>","list_archive_url":null,"date":"2017-09-07T01:42:01","subject":"Re: [Qemu-devel] [PATCH v2 12/19] target/s390x: set cpu->id for\n\tlinux user when realizing","submitter":{"id":26065,"url":"http://patchwork.ozlabs.org/api/people/26065/","name":"Matthew Rosato","email":"mjrosato@linux.vnet.ibm.com"},"content":"On 09/04/2017 11:43 AM, David Hildenbrand wrote:\n> scc->next_cpu_id is updated when realizing. Setting it just before that\n> point looks cleaner.\n> \n> Signed-off-by: David Hildenbrand <david@redhat.com>\n\nReviewed-by: Matthew Rosato <mjrosato@linux.vnet.ibm.com>\n\n> ---\n>  target/s390x/cpu.c | 11 ++++-------\n>  1 file changed, 4 insertions(+), 7 deletions(-)\n> \n> diff --git a/target/s390x/cpu.c b/target/s390x/cpu.c\n> index 74b3e4fd0d..5f9315fb16 100644\n> --- a/target/s390x/cpu.c\n> +++ b/target/s390x/cpu.c\n> @@ -194,7 +194,11 @@ static void s390_cpu_realizefn(DeviceState *dev, Error **errp)\n>                     \", max allowed: %d\", cpu->id, max_cpus - 1);\n>          goto out;\n>      }\n> +#else\n> +    /* implicitly set for linux-user only */\n> +    cpu->id = scc->next_cpu_id;\n>  #endif\n> +\n>      if (cpu_exists(cpu->id)) {\n>          error_setg(&err, \"Unable to add CPU: %\" PRIi64\n>                     \", it already exists\", cpu->id);\n> @@ -306,13 +310,6 @@ static void s390_cpu_initfn(Object *obj)\n>          inited = true;\n>          s390x_translate_init();\n>      }\n> -\n> -#if defined(CONFIG_USER_ONLY)\n> -    {\n> -        S390CPUClass *scc = S390_CPU_GET_CLASS(obj);\n> -        cpu->id = scc->next_cpu_id;\n> -    }\n> -#endif\n>  }\n> \n>  static void s390_cpu_finalize(Object *obj)\n>","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@bilbo.ozlabs.org","Authentication-Results":"ozlabs.org;\n\tspf=pass (mailfrom) smtp.mailfrom=nongnu.org\n\t(client-ip=2001:4830:134:3::11; helo=lists.gnu.org;\n\tenvelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n\treceiver=<UNKNOWN>)","Received":["from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11])\n\t(using TLSv1 with cipher AES256-SHA (256/256 bits))\n\t(No client certificate requested)\n\tby ozlabs.org (Postfix) with ESMTPS id 3xnjrG0jVbz9ryk\n\tfor <incoming@patchwork.ozlabs.org>;\n\tThu,  7 Sep 2017 11:42:36 +1000 (AEST)","from localhost ([::1]:38547 helo=lists.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.71) (envelope-from\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>)\n\tid 1dplpw-0000Kn-AL\n\tfor incoming@patchwork.ozlabs.org; Wed, 06 Sep 2017 21:42:32 -0400","from eggs.gnu.org ([2001:4830:134:3::10]:35426)\n\tby lists.gnu.org with esmtp (Exim 4.71)\n\t(envelope-from <mjrosato@linux.vnet.ibm.com>) id 1dplpd-0000KX-Ag\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 21:42:14 -0400","from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)\n\t(envelope-from <mjrosato@linux.vnet.ibm.com>) id 1dplpa-0003sb-59\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 21:42:13 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1]:39401)\n\tby eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32)\n\t(Exim 4.71) (envelope-from <mjrosato@linux.vnet.ibm.com>)\n\tid 1dplpZ-0003ry-Ry\n\tfor qemu-devel@nongnu.org; Wed, 06 Sep 2017 21:42:10 -0400","from pps.filterd (m0098404.ppops.net [127.0.0.1])\n\tby mx0a-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id\n\tv871crbM025552\n\tfor <qemu-devel@nongnu.org>; Wed, 6 Sep 2017 21:42:08 -0400","from e11.ny.us.ibm.com (e11.ny.us.ibm.com [129.33.205.201])\n\tby mx0a-001b2d01.pphosted.com with ESMTP id 2ctsb1j2wg-1\n\t(version=TLSv1.2 cipher=AES256-SHA bits=256 verify=NOT)\n\tfor <qemu-devel@nongnu.org>; Wed, 06 Sep 2017 21:42:07 -0400","from localhost\n\tby e11.ny.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use\n\tOnly! Violators will be prosecuted\n\tfor <qemu-devel@nongnu.org> from <mjrosato@linux.vnet.ibm.com>;\n\tWed, 6 Sep 2017 21:42:06 -0400","from b01cxnp22034.gho.pok.ibm.com (9.57.198.24)\n\tby e11.ny.us.ibm.com (146.89.104.198) with IBM ESMTP SMTP Gateway:\n\tAuthorized Use Only! Violators will be prosecuted; \n\tWed, 6 Sep 2017 21:42:03 -0400","from b01ledav001.gho.pok.ibm.com (b01ledav001.gho.pok.ibm.com\n\t[9.57.199.106])\n\tby b01cxnp22034.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP\n\tid v871g2n122741246; Thu, 7 Sep 2017 01:42:02 GMT","from b01ledav001.gho.pok.ibm.com (unknown [127.0.0.1])\n\tby IMSVA (Postfix) with ESMTP id 119D12803D;\n\tWed,  6 Sep 2017 21:41:56 -0400 (EDT)","from [9.85.195.170] (unknown [9.85.195.170])\n\tby b01ledav001.gho.pok.ibm.com (Postfix) with ESMTP id 7FD692803E;\n\tWed,  6 Sep 2017 21:41:55 -0400 (EDT)"],"To":"David Hildenbrand <david@redhat.com>, qemu-devel@nongnu.org","References":"<20170904154316.4148-1-david@redhat.com>\n\t<20170904154316.4148-13-david@redhat.com>","From":"Matthew Rosato <mjrosato@linux.vnet.ibm.com>","Date":"Wed, 6 Sep 2017 21:42:01 -0400","User-Agent":"Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101\n\tThunderbird/52.2.1","MIME-Version":"1.0","In-Reply-To":"<20170904154316.4148-13-david@redhat.com>","Content-Type":"text/plain; charset=utf-8","Content-Language":"en-US","Content-Transfer-Encoding":"7bit","X-TM-AS-GCONF":"00","x-cbid":"17090701-2213-0000-0000-00000216541A","X-IBM-SpamModules-Scores":"","X-IBM-SpamModules-Versions":"BY=3.00007680; HX=3.00000241; KW=3.00000007;\n\tPH=3.00000004; SC=3.00000226; SDB=6.00913331; UDB=6.00458388;\n\tIPR=6.00693593; \n\tBA=6.00005574; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009;\n\tZB=6.00000000; \n\tZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017042;\n\tXFM=3.00000015; UTC=2017-09-07 01:42:05","X-IBM-AV-DETECTION":"SAVI=unused REMOTE=unused XFE=unused","x-cbparentid":"17090701-2214-0000-0000-000057755795","Message-Id":"<06db0a9c-e8e6-5b28-d8f3-bd953c102ed9@linux.vnet.ibm.com>","X-Proofpoint-Virus-Version":"vendor=fsecure engine=2.50.10432:, ,\n\tdefinitions=2017-09-07_01:, , signatures=0","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n\tspamscore=0 suspectscore=0\n\tmalwarescore=0 phishscore=0 adultscore=0 bulkscore=0 classifier=spam\n\tadjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000\n\tdefinitions=main-1709070021","X-detected-operating-system":"by eggs.gnu.org: GNU/Linux 3.x [generic] [fuzzy]","X-Received-From":"148.163.156.1","Subject":"Re: [Qemu-devel] [PATCH v2 12/19] target/s390x: set cpu->id for\n\tlinux user when realizing","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.21","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<http://lists.nongnu.org/archive/html/qemu-devel/>","List-Post":"<mailto:qemu-devel@nongnu.org>","List-Help":"<mailto:qemu-devel-request@nongnu.org?subject=help>","List-Subscribe":"<https://lists.nongnu.org/mailman/listinfo/qemu-devel>,\n\t<mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Cc":"thuth@redhat.com, Eduardo Habkost <ehabkost@redhat.com>,\n\tcohuck@redhat.com, Richard Henderson <richard.henderson@linaro.org>,\n\tAlexander Graf <agraf@suse.de>, borntraeger@de.ibm.com","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"\"Qemu-devel\"\n\t<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>"}}]