[{"id":3202724,"web_url":"http://patchwork.ozlabs.org/comment/3202724/","msgid":"<05b66fe93ec995d48b8c8fbfbd5f9c6098199851.camel@linux.ibm.com>","list_archive_url":null,"date":"2023-10-19T17:57:51","subject":"Re: [PULL 03/25] s390x/cpu topology: add topology entries on CPU\n hotplug","submitter":{"id":85377,"url":"http://patchwork.ozlabs.org/api/people/85377/","name":"Nina Schoetterl-Glausch","email":"nsg@linux.ibm.com"},"content":"On Wed, 2023-10-18 at 15:06 +0200, Thomas Huth wrote:\n> From: Pierre Morel <pmorel@linux.ibm.com>\n> \n> The topology information are attributes of the CPU and are\n> specified during the CPU device creation.\n> \n> On hot plug we:\n> - calculate the default values for the topology for drawers,\n>   books and sockets in the case they are not specified.\n> - verify the CPU attributes\n> - check that we have still room on the desired socket\n> \n> The possibility to insert a CPU in a mask is dependent on the\n> number of cores allowed in a socket, a book or a drawer, the\n> checking is done during the hot plug of the CPU to have an\n> immediate answer.\n> \n> If the complete topology is not specified, the core is added\n> in the physical topology based on its core ID and it gets\n> defaults values for the modifier attributes.\n> \n> This way, starting QEMU without specifying the topology can\n> still get some advantage of the CPU topology.\n> \n> Signed-off-by: Pierre Morel <pmorel@linux.ibm.com>\n> Reviewed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>\n> Co-developed-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>\n> Reviewed-by: Thomas Huth <thuth@redhat.com>\n> Signed-off-by: Nina Schoetterl-Glausch <nsg@linux.ibm.com>\n> Message-ID: <20231016183925.2384704-4-nsg@linux.ibm.com>\n> Signed-off-by: Thomas Huth <thuth@redhat.com>\n> ---\n>  MAINTAINERS                     |   6 +\n>  include/hw/s390x/cpu-topology.h |  54 +++++++\n>  hw/s390x/cpu-topology.c         | 259 ++++++++++++++++++++++++++++++++\n>  hw/s390x/s390-virtio-ccw.c      |  22 ++-\n>  hw/s390x/meson.build            |   1 +\n>  5 files changed, 340 insertions(+), 2 deletions(-)\n>  create mode 100644 include/hw/s390x/cpu-topology.h\n>  create mode 100644 hw/s390x/cpu-topology.c\n\n[...]\n\n> --- /dev/null\n> +++ b/include/hw/s390x/cpu-topology.h\n> @@ -0,0 +1,54 @@\n> +/* SPDX-License-Identifier: GPL-2.0-or-later */\n> +/*\n> + * CPU Topology\n> + *\n> + * Copyright IBM Corp. 2022, 2023\n> + * Author(s): Pierre Morel <pmorel@linux.ibm.com>\n> + *\n> + */\n> +#ifndef HW_S390X_CPU_TOPOLOGY_H\n> +#define HW_S390X_CPU_TOPOLOGY_H\n> +\n> +#ifndef CONFIG_USER_ONLY\n> +\n> +#include \"qemu/queue.h\"\n> +#include \"hw/boards.h\"\n> +#include \"qapi/qapi-types-machine-target.h\"\n> +\n> +typedef struct S390Topology {\n> +    uint8_t *cores_per_socket;\n> +} S390Topology;\n> +\n> +#ifdef CONFIG_KVM\n> +bool s390_has_topology(void);\n> +void s390_topology_setup_cpu(MachineState *ms, S390CPU *cpu, Error **errp);\n> +#else\n> +static inline bool s390_has_topology(void)\n> +{\n> +       return false;\n\nJust noticed that the indent is off here :(\n\n> +}\n\n[...]","headers":{"Return-Path":"<qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org>","X-Original-To":"incoming@patchwork.ozlabs.org","Delivered-To":"patchwork-incoming@legolas.ozlabs.org","Authentication-Results":["legolas.ozlabs.org;\n\tdkim=pass (2048-bit key;\n unprotected) header.d=ibm.com header.i=@ibm.com header.a=rsa-sha256\n header.s=pp1 header.b=GPHNkzFn;\n\tdkim-atps=neutral","legolas.ozlabs.org;\n spf=pass (sender SPF authorized) smtp.mailfrom=nongnu.org\n (client-ip=209.51.188.17; helo=lists.gnu.org;\n envelope-from=qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org;\n receiver=patchwork.ozlabs.org)"],"Received":["from lists.gnu.org (lists.gnu.org [209.51.188.17])\n\t(using TLSv1.2 with cipher ECDHE-ECDSA-AES256-GCM-SHA384 (256/256 bits))\n\t(No client certificate requested)\n\tby legolas.ozlabs.org (Postfix) with ESMTPS id 4SBFnj67LDz23jP\n\tfor <incoming@patchwork.ozlabs.org>; Fri, 20 Oct 2023 04:58:33 +1100 (AEDT)","from localhost ([::1] helo=lists1p.gnu.org)\n\tby lists.gnu.org with esmtp (Exim 4.90_1)\n\t(envelope-from <qemu-devel-bounces@nongnu.org>)\n\tid 1qtXHV-0000dy-Oa; Thu, 19 Oct 2023 13:58:01 -0400","from eggs.gnu.org ([2001:470:142:3::10])\n by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <nsg@linux.ibm.com>)\n id 1qtXHT-0000da-Fq; Thu, 19 Oct 2023 13:57:59 -0400","from mx0a-001b2d01.pphosted.com ([148.163.156.1])\n by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256)\n (Exim 4.90_1) (envelope-from <nsg@linux.ibm.com>)\n id 1qtXHR-0001Pp-Av; Thu, 19 Oct 2023 13:57:59 -0400","from pps.filterd (m0353726.ppops.net [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id\n 39JHtYla006435; Thu, 19 Oct 2023 17:57:55 GMT","from pps.reinject (localhost [127.0.0.1])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tu95qgb0h-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 19 Oct 2023 17:57:54 +0000","from m0353726.ppops.net (m0353726.ppops.net [127.0.0.1])\n by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39JHuhV5017730;\n Thu, 19 Oct 2023 17:57:54 GMT","from ppma12.dal12v.mail.ibm.com\n (dc.9e.1632.ip4.static.sl-reverse.com [50.22.158.220])\n by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tu95qgays-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 19 Oct 2023 17:57:54 +0000","from pps.filterd (ppma12.dal12v.mail.ibm.com [127.0.0.1])\n by ppma12.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id\n 39JFxaCw026875; Thu, 19 Oct 2023 17:57:53 GMT","from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225])\n by ppma12.dal12v.mail.ibm.com (PPS) with ESMTPS id 3tr5astu3a-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT);\n Thu, 19 Oct 2023 17:57:53 +0000","from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com\n [10.20.54.103])\n by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id\n 39JHvpBh55837038\n (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK);\n Thu, 19 Oct 2023 17:57:51 GMT","from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id C6FD720043;\n Thu, 19 Oct 2023 17:57:51 +0000 (GMT)","from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1])\n by IMSVA (Postfix) with ESMTP id 7167320040;\n Thu, 19 Oct 2023 17:57:51 +0000 (GMT)","from li-978a334c-2cba-11b2-a85c-a0743a31b510.ibm.com (unknown\n [9.171.84.173]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP;\n Thu, 19 Oct 2023 17:57:51 +0000 (GMT)"],"DKIM-Signature":"v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com;\n h=message-id : subject :\n from : to : cc : date : in-reply-to : references : content-type :\n content-transfer-encoding : mime-version; s=pp1;\n bh=E/DIS1uampXHFe66MjXnmkpMkRQERnxg1SM+gciCpeM=;\n b=GPHNkzFnyt5U35HUeq13nWCtuKvSNuFZLkmKoptldGPl1wQEVPvGTCcRzeRI5fdMLcQj\n 5qbu0ABiJcPPP3G6BcnC5F/aWWl29+W93HLLNjSf4ECfo8WYsyf70bytuQYjZQRcgUH0\n KTrKkVWwuwAkitv6wJ8hQJtdpWN9KruROyFN6jx2v8CUwuRWYflFJMYtCtPWL0WoSKdb\n LGcBfYBviDYQ/hgCdD9fiHCrZZT9z+uK3jt0lLEgrnk6bpFGH4AhUvV4s9ttfWHVRBPk\n UR1nmYS2qYEEe+3I5aCL22b0fDSbjVLUUsEb4VMb13pahq+rvdXnSwspICHFy2ZKZtB7 YA==","Message-ID":"<05b66fe93ec995d48b8c8fbfbd5f9c6098199851.camel@linux.ibm.com>","Subject":"Re: [PULL 03/25] s390x/cpu topology: add topology entries on CPU\n hotplug","From":"Nina Schoetterl-Glausch <nsg@linux.ibm.com>","To":"Thomas Huth <thuth@redhat.com>, qemu-devel@nongnu.org","Cc":"Stefan Hajnoczi <stefanha@redhat.com>, qemu-s390x@nongnu.org","Date":"Thu, 19 Oct 2023 19:57:51 +0200","In-Reply-To":"<20231018130716.286638-4-thuth@redhat.com>","References":"<20231018130716.286638-1-thuth@redhat.com>\n <20231018130716.286638-4-thuth@redhat.com>","Content-Type":"text/plain; charset=\"UTF-8\"","Content-Transfer-Encoding":"quoted-printable","User-Agent":"Evolution 3.48.4 (3.48.4-1.fc38) ","MIME-Version":"1.0","X-TM-AS-GCONF":"00","X-Proofpoint-GUID":"SfgIz4mfhw8r6PiJtuCqktRnwvXcXiM6","X-Proofpoint-ORIG-GUID":"hGzhrjaqhv57rh8f4Nuri-parExlHlN7","X-Proofpoint-Virus-Version":"vendor=baseguard\n engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26\n definitions=2023-10-19_17,2023-10-19_01,2023-05-22_02","X-Proofpoint-Spam-Details":"rule=outbound_notspam policy=outbound score=0\n suspectscore=0 phishscore=0\n malwarescore=0 adultscore=0 priorityscore=1501 mlxscore=0 bulkscore=0\n mlxlogscore=999 impostorscore=0 lowpriorityscore=0 clxscore=1015\n spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1\n engine=8.12.0-2309180000 definitions=main-2310190152","Received-SPF":"pass client-ip=148.163.156.1; envelope-from=nsg@linux.ibm.com;\n helo=mx0a-001b2d01.pphosted.com","X-Spam_score_int":"-19","X-Spam_score":"-2.0","X-Spam_bar":"--","X-Spam_report":"(-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1,\n DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_MSPIKE_H4=0.001,\n RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001,\n SPF_PASS=-0.001 autolearn=ham autolearn_force=no","X-Spam_action":"no action","X-BeenThere":"qemu-devel@nongnu.org","X-Mailman-Version":"2.1.29","Precedence":"list","List-Id":"<qemu-devel.nongnu.org>","List-Unsubscribe":"<https://lists.nongnu.org/mailman/options/qemu-devel>,\n <mailto:qemu-devel-request@nongnu.org?subject=unsubscribe>","List-Archive":"<https://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 <mailto:qemu-devel-request@nongnu.org?subject=subscribe>","Errors-To":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org","Sender":"qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org"}}]