From mboxrd@z Thu Jan 1 00:00:00 1970 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 6D503C32771 for ; Wed, 28 Sep 2022 09:07:32 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233120AbiI1JHb (ORCPT ); Wed, 28 Sep 2022 05:07:31 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37478 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233051AbiI1JHa (ORCPT ); Wed, 28 Sep 2022 05:07:30 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id C327E116B for ; Wed, 28 Sep 2022 02:07:27 -0700 (PDT) Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 28S8brg4031942; Wed, 28 Sep 2022 09:07:21 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=yuJPmHRZxA8fQt+K95Yy0XM34UQeBUnrfW3Lg5869jM=; b=s7h5DtA14N+hHjBLOs5C7JI2W2IoXpoibtidqumpWjYW/k/gGT43wLaOX4Ns0ISEtuL/ +bl7qOCCZNio+PxsgxHHS7QwIdL3y90TT6io+qpl16ngzctsqoHUFA40j16z9RiilS6L qepWvQ919ymmaEFKePmGOVabGFyYbbCKhLCt3OdP6TWUGjU5Sa+E2uR+W74yTSXybQYU 7sDEd9QDgTxj7r6RVqZ6DQlfuqeoRXBNydnp4jboxhRb2ocWva9S86Q8Xgir0HE72CV4 bX17zNnLK8mWlkNCvSgGKRs90z+E7ZtfDfU+702h0zrbu4IJB6ukLotkbvWTrHYtzh8y 3Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jvgkmdaft-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Sep 2022 09:07:21 +0000 Received: from m0098409.ppops.net (m0098409.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 28S7h0EF028434; Wed, 28 Sep 2022 09:07:20 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3jvgkmdaea-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Sep 2022 09:07:20 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 28S95YFs025116; Wed, 28 Sep 2022 09:07:18 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma06ams.nl.ibm.com with ESMTP id 3jss5j504y-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 28 Sep 2022 09:07:17 +0000 Received: from d06av22.portsmouth.uk.ibm.com (d06av22.portsmouth.uk.ibm.com [9.149.105.58]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 28S97EeU28181144 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 28 Sep 2022 09:07:14 GMT Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AB7804C044; Wed, 28 Sep 2022 09:07:14 +0000 (GMT) Received: from d06av22.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CA0514C040; Wed, 28 Sep 2022 09:07:13 +0000 (GMT) Received: from [9.171.31.212] (unknown [9.171.31.212]) by d06av22.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 28 Sep 2022 09:07:13 +0000 (GMT) Message-ID: <0237eabf-7e11-e48a-b463-08df22ea3024@linux.ibm.com> Date: Wed, 28 Sep 2022 11:07:13 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.2.1 Subject: Re: [PATCH v9 03/10] s390x/cpu topology: reporting the CPU topology to the guest Content-Language: en-US To: Janis Schoetterl-Glausch , 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, frankja@linux.ibm.com References: <20220902075531.188916-1-pmorel@linux.ibm.com> <20220902075531.188916-4-pmorel@linux.ibm.com> <683c1c82673c065a9ab679fd019774365677a619.camel@linux.ibm.com> From: Pierre Morel In-Reply-To: <683c1c82673c065a9ab679fd019774365677a619.camel@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Iwh9aA-GAS81B9qK6Yi2ha7HsDF76YeF X-Proofpoint-ORIG-GUID: 6FYwSso6JcudDZvQ7B-XdLv_SSDZtwzY X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.528,FMLib:17.11.122.1 definitions=2022-09-28_03,2022-09-27_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxlogscore=999 clxscore=1015 impostorscore=0 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 priorityscore=1501 phishscore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2209280055 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 9/7/22 12:26, Janis Schoetterl-Glausch wrote: > On Fri, 2022-09-02 at 09:55 +0200, Pierre Morel wrote: >> The guest can use the STSI instruction to get a buffer filled >> with the CPU topology description. >> >> Let us implement the STSI instruction for the basis CPU topology >> level, level 2. >> >> Signed-off-by: Pierre Morel >> --- >> hw/s390x/cpu-topology.c | 4 ++ >> include/hw/s390x/cpu-topology.h | 5 ++ >> target/s390x/cpu.h | 49 +++++++++++++++ >> target/s390x/cpu_topology.c | 108 ++++++++++++++++++++++++++++++++ >> target/s390x/kvm/kvm.c | 6 +- >> target/s390x/meson.build | 1 + >> 6 files changed, 172 insertions(+), 1 deletion(-) >> create mode 100644 target/s390x/cpu_topology.c >> > [...] > >> diff --git a/target/s390x/cpu_topology.c b/target/s390x/cpu_topology.c > > [...] > >> +static char *fill_tle_cpu(char *p, uint64_t mask, int origin) >> +{ >> + SysIBTl_cpu *tle = (SysIBTl_cpu *)p; >> + >> + tle->nl = 0; >> + tle->dedicated = 1; >> + tle->polarity = S390_TOPOLOGY_POLARITY_H; >> + tle->type = S390_TOPOLOGY_CPU_TYPE; >> + tle->origin = origin * 64; > > origin is a multibyte field too, so needs a conversion too. right, Thanks, Pierre > >> + tle->mask = be64_to_cpu(mask); >> + return p + sizeof(*tle); >> +} >> + > [...] -- Pierre Morel IBM Lab Boeblingen