From patchwork Wed Feb 1 13:20:49 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Morel X-Patchwork-Id: 13124265 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 18244C636CD for ; Wed, 1 Feb 2023 13:21:30 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232068AbjBANV3 (ORCPT ); Wed, 1 Feb 2023 08:21:29 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47186 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231835AbjBANV0 (ORCPT ); Wed, 1 Feb 2023 08:21:26 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C10AE43475 for ; Wed, 1 Feb 2023 05:21:22 -0800 (PST) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 311DDnm2032990; Wed, 1 Feb 2023 13:21:15 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=VAdg3XqGhSgAl6+Ag+TOciEbg4tAAoOJnuiiN7YQGMw=; b=OQw2w7XWnXNX8xB2inunGJDiKwaY/xZLnCWIjnZwlvbTj3EvHKwHqVO91EfYg1pRRU1c 4O1qDzvZNltqrEHxuPyZgWeuNmU/K+7Eg1oUKl8YmE7UOQl17gQPab+ZkEwp0o4q+gSj HQ5GxuOw/PrMgeNylx2VZPN/XR2anx9ELDsqiqxOJdrA+j0Q9CA9RW8MBTsomC9u8WYy 2NObx6JoLk35MqlH0nWAt73E/rct+njBos5E76BWZ9gLgFzD3oaaF1F5EZS1F+vU9+Pn 053PSKhP+r3VU8JXn+Ki9FELue9dnxKp/Pj8/OTV1PjVANc7rsR7vtd/U9WqtK7G5h0k LA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nfrscr68w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Feb 2023 13:21:15 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 311DIln3013810; Wed, 1 Feb 2023 13:21:14 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3nfrscr686-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Feb 2023 13:21:14 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 311A4ws4026038; Wed, 1 Feb 2023 13:21:12 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3ndn6uas5k-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 01 Feb 2023 13:21:12 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 311DL9aB43385282 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 1 Feb 2023 13:21:09 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4037820043; Wed, 1 Feb 2023 13:21:09 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DDBC220040; Wed, 1 Feb 2023 13:21:07 +0000 (GMT) Received: from li-c6ac47cc-293c-11b2-a85c-d421c8e4747b.ibm.com.com (unknown [9.179.4.198]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Wed, 1 Feb 2023 13:21:07 +0000 (GMT) From: Pierre Morel To: qemu-s390x@nongnu.org Cc: qemu-devel@nongnu.org, borntraeger@de.ibm.com, pasic@linux.ibm.com, richard.henderson@linaro.org, david@redhat.com, thuth@redhat.com, cohuck@redhat.com, mst@redhat.com, pbonzini@redhat.com, kvm@vger.kernel.org, ehabkost@redhat.com, marcel.apfelbaum@gmail.com, eblake@redhat.com, armbru@redhat.com, seiden@linux.ibm.com, nrb@linux.ibm.com, nsg@linux.ibm.com, frankja@linux.ibm.com, berrange@redhat.com, clg@kaod.org Subject: [PATCH v15 09/11] machine: adding s390 topology to query-cpu-fast Date: Wed, 1 Feb 2023 14:20:49 +0100 Message-Id: <20230201132051.126868-10-pmorel@linux.ibm.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20230201132051.126868-1-pmorel@linux.ibm.com> References: <20230201132051.126868-1-pmorel@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 7zvOXTXUplLM8fi2a2M0FEGBs613bN7i X-Proofpoint-GUID: Q6VWJMsvsAkRlK9Xtpg5KrwB4tPCJuDF X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.930,Hydra:6.0.562,FMLib:17.11.122.1 definitions=2023-02-01_04,2023-01-31_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 clxscore=1015 malwarescore=0 bulkscore=0 mlxlogscore=999 phishscore=0 priorityscore=1501 mlxscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2302010112 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org S390x provides two more topology containers above the sockets, books and drawers. Let's add these CPU attributes to the QAPI command query-cpu-fast. Signed-off-by: Pierre Morel Reviewed-by: Nina Schoetterl-Glausch if you fix the issues in Thomas' first reply. --- qapi/machine.json | 13 ++++++++++--- hw/core/machine-qmp-cmds.c | 2 ++ 2 files changed, 12 insertions(+), 3 deletions(-) diff --git a/qapi/machine.json b/qapi/machine.json index 3036117059..e36c39e258 100644 --- a/qapi/machine.json +++ b/qapi/machine.json @@ -53,11 +53,18 @@ # # Additional information about a virtual S390 CPU # -# @cpu-state: the virtual CPU's state +# @cpu-state: the virtual CPU's state (since 2.12) +# @dedicated: the virtual CPU's dedication (since 8.0) +# @polarity: the virtual CPU's polarity (since 8.0) # # Since: 2.12 ## -{ 'struct': 'CpuInfoS390', 'data': { 'cpu-state': 'CpuS390State' } } +{ 'struct': 'CpuInfoS390', + 'data': { 'cpu-state': 'CpuS390State', + 'dedicated': 'bool', + 'polarity': 'int' + } +} ## # @CpuInfoFast: @@ -70,7 +77,7 @@ # # @thread-id: ID of the underlying host thread # -# @props: properties describing to which node/socket/core/thread +# @props: properties describing to which node/drawer/book/socket/core/thread # virtual CPU belongs to, provided if supported by board # # @target: the QEMU system emulation target, which determines which diff --git a/hw/core/machine-qmp-cmds.c b/hw/core/machine-qmp-cmds.c index 80d5e59651..e6d93cf2a0 100644 --- a/hw/core/machine-qmp-cmds.c +++ b/hw/core/machine-qmp-cmds.c @@ -30,6 +30,8 @@ static void cpustate_to_cpuinfo_s390(CpuInfoS390 *info, const CPUState *cpu) CPUS390XState *env = &s390_cpu->env; info->cpu_state = env->cpu_state; + info->dedicated = env->dedicated; + info->polarity = env->entitlement; #else abort(); #endif