From patchwork Fri Oct 20 14:48:51 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nina Schoetterl-Glausch X-Patchwork-Id: 13430822 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 EA599C001DF for ; Fri, 20 Oct 2023 14:49:22 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377554AbjJTOtW (ORCPT ); Fri, 20 Oct 2023 10:49:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40188 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377239AbjJTOtW (ORCPT ); Fri, 20 Oct 2023 10:49:22 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 868B6CF; Fri, 20 Oct 2023 07:49:20 -0700 (PDT) Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KEiUKN017421; Fri, 20 Oct 2023 14:49:09 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=FBU0jEH+CVW+vsZZRGYN0d0LaP3FyhG2Nym9IxQsdNU=; b=j1AxkgxV0op6c1g2lRDkzTba6oYgouy/4CkDXmYpTUPyOCwAOeAuoJm0LpzwfrNOmz1i ZbOg7W+N4vU5j7+mEN1654XlXceptuzLMLo6x+qr9C1/qFjXi8kc+26tM2ahp9BCbwi3 2tYxgfJSEZaD1HYNz0MpGA4op3LbIgVR9vOctMpm5KucKV0fE7df6Vib92fS5jKeNjXF rTEs+m1fOheb4SV3xotMojHl1rlg0CgIR6OV9axU06XpuIG0+HpUvYk5ph61JLvXl7T5 7ICMp3IdUU2dm6h3TN3qE1X06HucGIZz6y1Xq6+j2ILUGqR4p3hL5wLNET1EoHzdzeND Ng== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuuk086n9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:08 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KEixD1019370; Fri, 20 Oct 2023 14:49:08 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuuk086mb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:08 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KCLSNB029895; Fri, 20 Oct 2023 14:49:07 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tuc47n67e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:07 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39KEn47Y25494154 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 14:49:04 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 13E9320040; Fri, 20 Oct 2023 14:49:04 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD3A720043; Fri, 20 Oct 2023 14:49:03 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Oct 2023 14:49:03 +0000 (GMT) From: Nina Schoetterl-Glausch To: Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , Janosch Frank Cc: Nina Schoetterl-Glausch , David Hildenbrand , Nikos Nikoleris , linux-s390@vger.kernel.org, Shaoqin Huang , Sean Christopherson , kvm@vger.kernel.org, Andrew Jones , Ricardo Koller , Colton Lewis , Thomas Huth Subject: [kvm-unit-tests PATCH 01/10] s390x: topology: Introduce enums for polarization & cpu type Date: Fri, 20 Oct 2023 16:48:51 +0200 Message-Id: <20231020144900.2213398-2-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020144900.2213398-1-nsg@linux.ibm.com> References: <20231020144900.2213398-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: UBY9aPhk0Ju7FnjBelXIEmat90q1AOCK X-Proofpoint-ORIG-GUID: 6zk7NlwVBMCK-YxdXD85tnbentjUakDn X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 mlxscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200121 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Thereby get rid of magic values. Signed-off-by: Nina Schoetterl-Glausch Reviewed-by: Nico Boehr Reviewed-by: Janosch Frank --- lib/s390x/stsi.h | 11 +++++++++++ s390x/topology.c | 6 ++++-- 2 files changed, 15 insertions(+), 2 deletions(-) diff --git a/lib/s390x/stsi.h b/lib/s390x/stsi.h index 1351a6f3..2f6182c1 100644 --- a/lib/s390x/stsi.h +++ b/lib/s390x/stsi.h @@ -41,6 +41,17 @@ struct topology_core { uint64_t mask; }; +enum topology_polarization { + POLARIZATION_HORIZONTAL = 0, + POLARIZATION_VERTICAL_LOW = 1, + POLARIZATION_VERTICAL_MEDIUM = 2, + POLARIZATION_VERTICAL_HIGH = 3, +}; + +enum cpu_type { + CPU_TYPE_IFL = 3, +}; + #define CONTAINER_TLE_RES_BITS 0x00ffffffffffff00UL struct topology_container { uint8_t nl; diff --git a/s390x/topology.c b/s390x/topology.c index 69558236..6ab8c8d4 100644 --- a/s390x/topology.c +++ b/s390x/topology.c @@ -261,7 +261,7 @@ static uint8_t *check_tle(void *tc) report(!(*(uint64_t *)tc & CPUS_TLE_RES_BITS), "reserved bits %016lx", *(uint64_t *)tc & CPUS_TLE_RES_BITS); - report(cpus->type == 0x03, "type IFL"); + report(cpus->type == CPU_TYPE_IFL, "type IFL"); report_info("origin: %d", cpus->origin); report_info("mask: %016lx", cpus->mask); @@ -275,7 +275,9 @@ static uint8_t *check_tle(void *tc) if (!cpus->d) report_skip("Not dedicated"); else - report(cpus->pp == 3 || cpus->pp == 0, "Dedicated CPUs are either vertically polarized or have high entitlement"); + report(cpus->pp == POLARIZATION_VERTICAL_HIGH || + cpus->pp == POLARIZATION_HORIZONTAL, + "Dedicated CPUs are either vertically polarized or have high entitlement"); return tc + sizeof(*cpus); } From patchwork Fri Oct 20 14:48:52 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nina Schoetterl-Glausch X-Patchwork-Id: 13430832 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 5176FCDB474 for ; Fri, 20 Oct 2023 14:54:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377590AbjJTOyN (ORCPT ); Fri, 20 Oct 2023 10:54:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52302 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377577AbjJTOyM (ORCPT ); Fri, 20 Oct 2023 10:54:12 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6C346D53; Fri, 20 Oct 2023 07:54:10 -0700 (PDT) Received: from pps.filterd (m0353723.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KErnaZ018625; Fri, 20 Oct 2023 14:53:57 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=0ASHlJFdv8G/sS6P0d8ondxMWAsOoXwjkIOG6iAObHQ=; b=lQmVB8qBY3pJIddNAUvmAXLsKr4fqB7Q9r6bgsDkUzmuF0EUgyADNLagCasjoyEPguj2 BZa1xG/Tn42q6Y19G6nsEoErr1217H/ysEm7WMtOBBu2x96RX2DsqCgvtMlCKE9jDZBU Ipi9+GdQGK9QHKOSZ/IluJdwlnHmjEUjVqlAIoWOuozrD6OUrUhx/7XGgTmnfdfjrYEr 98ofJKnoh/TPcsu6YM3Y7Uq1tA/LkEOTAZ3YNj7KR+7xiDudz8N2vWaUf5saN0jkkugR i3/FHZuG+lVel91yp4rlXoFdP8p4vePwyqX9AGiZg4tuPw5mvUm4kmvJ5AK5l+htKwcc Mw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuuk586wb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:53:56 +0000 Received: from m0353723.ppops.net (m0353723.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KErriq018995; Fri, 20 Oct 2023 14:53:55 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuuk585fp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:53:53 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KC6vKg032125; Fri, 20 Oct 2023 14:49:07 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tuc35n6gs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:07 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39KEn4jL25494156 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 14:49:04 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A47120040; Fri, 20 Oct 2023 14:49:04 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2659520043; Fri, 20 Oct 2023 14:49:04 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Oct 2023 14:49:04 +0000 (GMT) From: Nina Schoetterl-Glausch To: Janosch Frank , Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= Cc: Nina Schoetterl-Glausch , Colton Lewis , Ricardo Koller , Sean Christopherson , Thomas Huth , Nikos Nikoleris , David Hildenbrand , linux-s390@vger.kernel.org, Andrew Jones , kvm@vger.kernel.org, Shaoqin Huang Subject: [kvm-unit-tests PATCH 02/10] s390x: topology: Fix report message Date: Fri, 20 Oct 2023 16:48:52 +0200 Message-Id: <20231020144900.2213398-3-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020144900.2213398-1-nsg@linux.ibm.com> References: <20231020144900.2213398-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: HcvyIEdyZY6cz5PhniMSVUTZht13nA4C X-Proofpoint-ORIG-GUID: MEbykT_jxZIliWpdHXrdy7e-LWiJep1m X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 mlxlogscore=999 priorityscore=1501 mlxscore=0 bulkscore=0 lowpriorityscore=0 suspectscore=0 adultscore=0 malwarescore=0 clxscore=1015 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200123 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org A polarization value of 0 means horizontal polarization. Reviewed-by: Nico Boehr Signed-off-by: Nina Schoetterl-Glausch Reviewed-by: Janosch Frank --- s390x/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s390x/topology.c b/s390x/topology.c index 6ab8c8d4..1c4a86fe 100644 --- a/s390x/topology.c +++ b/s390x/topology.c @@ -277,7 +277,7 @@ static uint8_t *check_tle(void *tc) else report(cpus->pp == POLARIZATION_VERTICAL_HIGH || cpus->pp == POLARIZATION_HORIZONTAL, - "Dedicated CPUs are either vertically polarized or have high entitlement"); + "Dedicated CPUs are either horizontally polarized or have high entitlement"); return tc + sizeof(*cpus); } From patchwork Fri Oct 20 14:48:53 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nina Schoetterl-Glausch X-Patchwork-Id: 13430833 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 2E502C001DF for ; Fri, 20 Oct 2023 14:54:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377601AbjJTOyj (ORCPT ); Fri, 20 Oct 2023 10:54:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44808 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377572AbjJTOyh (ORCPT ); Fri, 20 Oct 2023 10:54:37 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8414A19E; Fri, 20 Oct 2023 07:54:36 -0700 (PDT) Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KEqJHA029235; Fri, 20 Oct 2023 14:54:24 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=DxwOxLTaVIOxqj5rHYlkclCvDezNc43Dr8HDZdxQzik=; b=pYu8CDELwEGHvNKsDedNrVigB8nnmPH3LcmpjvmySKM0GTB/4K1TL23SoPvcUrYWrGCp W36Su0VkPsNhZjzR0AYrwwFppP8osyzGAaE1YU1sWEcuEUFbY0/pukd+nseqefDuuKMv Qw4T/8KY4QkQ7KvQ2Klb/EwoA0Wjb6pZiUBxG6aymwv7Tj/lAAyjUaE6CiynGyHtJZ3f 5/tEqspxfTlH/Y66+3twmQK27o+DlEKevzzdEv11Buo15AV6ysionx8LFVYdlg6XSN/J 4gg+VMSKAuFBEjmwWkNFcxnQ7NYk5lM9MfLgU3p22PyoJpPLsmTLHvCWpReWIAiGp24y hQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuupp83yt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:54:20 +0000 Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KEqb8n031132; Fri, 20 Oct 2023 14:54:17 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuupp83jw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:54:17 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KCE5rV024173; Fri, 20 Oct 2023 14:49:08 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tuc295746-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:07 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39KEn4D125494158 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 14:49:04 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C037320040; Fri, 20 Oct 2023 14:49:04 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7D59220043; Fri, 20 Oct 2023 14:49:04 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Oct 2023 14:49:04 +0000 (GMT) From: Nina Schoetterl-Glausch To: Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , Janosch Frank Cc: Nina Schoetterl-Glausch , Sean Christopherson , David Hildenbrand , Shaoqin Huang , Colton Lewis , Andrew Jones , Nikos Nikoleris , linux-s390@vger.kernel.org, Thomas Huth , kvm@vger.kernel.org, Ricardo Koller Subject: [kvm-unit-tests PATCH 03/10] s390x: topology: Use function parameter in stsi_get_sysib Date: Fri, 20 Oct 2023 16:48:53 +0200 Message-Id: <20231020144900.2213398-4-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020144900.2213398-1-nsg@linux.ibm.com> References: <20231020144900.2213398-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: JzZtiTbeqGieTsQ50I2Ige68RD5EedKo X-Proofpoint-GUID: qOdgj06jT2O6LRGD8M2XexLOPcU-rien X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 mlxlogscore=984 spamscore=0 priorityscore=1501 clxscore=1015 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200123 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Actually use the function parameter we're give instead of a hardcoded access to the static variable pagebuf. Reviewed-by: Janosch Frank Reviewed-by: Nico Boehr Signed-off-by: Nina Schoetterl-Glausch --- s390x/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s390x/topology.c b/s390x/topology.c index 1c4a86fe..032e80dc 100644 --- a/s390x/topology.c +++ b/s390x/topology.c @@ -324,7 +324,7 @@ static int stsi_get_sysib(struct sysinfo_15_1_x *info, int sel2) report_prefix_pushf("SYSIB"); - ret = stsi(pagebuf, 15, 1, sel2); + ret = stsi(info, 15, 1, sel2); if (max_nested_lvl >= sel2) { report(!ret, "Valid instruction"); From patchwork Fri Oct 20 14:48:54 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nina Schoetterl-Glausch X-Patchwork-Id: 13430857 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 B0A6CC07480 for ; Fri, 20 Oct 2023 15:03:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377590AbjJTPDR (ORCPT ); Fri, 20 Oct 2023 11:03:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35014 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377607AbjJTPDP (ORCPT ); Fri, 20 Oct 2023 11:03:15 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 63480D53; Fri, 20 Oct 2023 08:03:14 -0700 (PDT) Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KEtV3D019439; Fri, 20 Oct 2023 15:03:10 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=+0NkxCqHEVgJad9TgLdnvKFXtu8mkbnKwCThHDwLjXM=; b=W2rYqIOrFbz2WKAEUFfDjtrLCQ09b0oFT2MUt3222HIowvDujUK3IZRdU1tyAw9++UVA vsP+wiuZQfNa2nbfzyzu8Z04nwPSbyQpJA/cFDdh5xum6DJh6GDEHKVwOsIWyhAYnpiV NMzMEPAl56RiwXK/gkCtG8R1p/mqvI5MD+EbsofL5vQoQ25jw82lkVQjflvRV2TlvmJ3 K0YGekbQXsj1XpU3QG3dnQgt8MThHWRjrAHhvI467Cr5aevvFTnXF9n/Mhyihotp3H/I jCn83vf3rcPATCibEiaMID8GyIH47NpKuGQozXqOWceRAVD6JsmvOXdseLUFZpa9ZNEU jQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuur5rer8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 15:03:09 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KEtnjv020669; Fri, 20 Oct 2023 15:03:08 GMT Received: from ppma13.dal12v.mail.ibm.com (dd.9e.1632.ip4.static.sl-reverse.com [50.22.158.221]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuur5rdj1-18 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 15:03:08 +0000 Received: from pps.filterd (ppma13.dal12v.mail.ibm.com [127.0.0.1]) by ppma13.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KCKV8K007107; Fri, 20 Oct 2023 14:49:08 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma13.dal12v.mail.ibm.com (PPS) with ESMTPS id 3tuc27n6sn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:08 +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 39KEn5MF16646846 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 14:49:05 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 227EE20040; Fri, 20 Oct 2023 14:49:05 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D2D5B20043; Fri, 20 Oct 2023 14:49:04 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Oct 2023 14:49:04 +0000 (GMT) From: Nina Schoetterl-Glausch To: Claudio Imbrenda , Janosch Frank , =?utf-8?q?Nico_B=C3=B6hr?= Cc: Nina Schoetterl-Glausch , Thomas Huth , linux-s390@vger.kernel.org, kvm@vger.kernel.org, Colton Lewis , Shaoqin Huang , Nikos Nikoleris , David Hildenbrand , Ricardo Koller , Sean Christopherson , Andrew Jones Subject: [kvm-unit-tests PATCH 04/10] s390x: topology: Fix parsing loop Date: Fri, 20 Oct 2023 16:48:54 +0200 Message-Id: <20231020144900.2213398-5-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020144900.2213398-1-nsg@linux.ibm.com> References: <20231020144900.2213398-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: tLtx3vDJIYe2HB-zUyMeYCE8ZiZpxO5S X-Proofpoint-ORIG-GUID: NTEHENZgmIyBsKl_moBJRmP-gnB-nh5j X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxlogscore=875 impostorscore=0 phishscore=0 mlxscore=0 adultscore=0 suspectscore=0 priorityscore=1501 malwarescore=0 spamscore=0 clxscore=1015 bulkscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200124 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Without a comparison the loop is infinite. Reviewed-by: Nico Boehr Signed-off-by: Nina Schoetterl-Glausch Reviewed-by: Janosch Frank --- s390x/topology.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s390x/topology.c b/s390x/topology.c index 032e80dc..c8ad4bcb 100644 --- a/s390x/topology.c +++ b/s390x/topology.c @@ -468,7 +468,7 @@ static void parse_topology_args(int argc, char **argv) if (flag[0] != '-') report_abort("Argument is expected to begin with '-'"); flag++; - for (level = 0; ARRAY_SIZE(levels); level++) { + for (level = 0; level < ARRAY_SIZE(levels); level++) { if (!strcmp(levels[level], flag)) break; } From patchwork Fri Oct 20 14:48:55 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nina Schoetterl-Glausch X-Patchwork-Id: 13430841 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 8B11ECDB474 for ; Fri, 20 Oct 2023 14:57:39 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377605AbjJTO5j (ORCPT ); Fri, 20 Oct 2023 10:57:39 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377598AbjJTO5i (ORCPT ); Fri, 20 Oct 2023 10:57:38 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6E777D66; Fri, 20 Oct 2023 07:57:36 -0700 (PDT) Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KEvF88009684; Fri, 20 Oct 2023 14:57:25 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=dttwXisVRQW6VzItWqEiNWuRVXRaQhE+f7ItKyxseDU=; b=Z2PlJBgL247MDuApmoIeMNI1p/pHQEEFeR6E7yWdfl/wRGZnQ1vDjovu1JE4mkAzBSxf 3fMKPzzIX3NurceLy5ThdmD7cUE+j6YwJ8LKhqEGNEV8i/e5K1uxseqndAiuF7s+2zDu nd0j/zRKGbgjouVWPNMLq5VKPFvVRFg8wUWRoVztmo6PGFywrjXdE8zTMAvuyUvekxMD NoZB3dZ3g0dmvv08GwSEVHKTalb0FEKvt6JcE6kz3T/+3bDWXFvvdHy9wpGuVv6pwsDo y9obfRzsFKVG8OQ4EAo5aaFgEUNK+bAtFMAOPaoibvkbpMo5Y4csUxFa4LOI98fDwYui FQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuus0g002-13 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:57:25 +0000 Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KElltR006936; Fri, 20 Oct 2023 14:50:11 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuum787wu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:50:05 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KC8YGj029813; Fri, 20 Oct 2023 14:49:08 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tuc47n67f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:08 +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 39KEn5b416646848 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 14:49:05 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6E70C20040; Fri, 20 Oct 2023 14:49:05 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 355CA20043; Fri, 20 Oct 2023 14:49:05 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Oct 2023 14:49:05 +0000 (GMT) From: Nina Schoetterl-Glausch To: Claudio Imbrenda , Janosch Frank , =?utf-8?q?Nico_B=C3=B6hr?= Cc: Nina Schoetterl-Glausch , Thomas Huth , linux-s390@vger.kernel.org, Sean Christopherson , Shaoqin Huang , Nikos Nikoleris , Ricardo Koller , kvm@vger.kernel.org, Colton Lewis , David Hildenbrand , Andrew Jones Subject: [kvm-unit-tests PATCH 05/10] s390x: topology: Make some report messages unique Date: Fri, 20 Oct 2023 16:48:55 +0200 Message-Id: <20231020144900.2213398-6-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020144900.2213398-1-nsg@linux.ibm.com> References: <20231020144900.2213398-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: J0a7Z3LHGNVHhkIF9cZ_9LjfADaoea4Y X-Proofpoint-ORIG-GUID: OKakRvNBPpQ_lDIL4XUzboBuwLTV6ywa X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 mlxscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200124 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org When we test something, i.e. do a report() we want unique messages, otherwise, from the test output, it will appear as if the same test was run multiple times, possible with different PASS/FAIL values. Convert some reports that don't actually test anything topology specific into asserts. Refine the report message for others. Reviewed-by: Janosch Frank Reviewed-by: Nico Boehr Signed-off-by: Nina Schoetterl-Glausch --- s390x/topology.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/s390x/topology.c b/s390x/topology.c index c8ad4bcb..03bc3d3b 100644 --- a/s390x/topology.c +++ b/s390x/topology.c @@ -114,7 +114,7 @@ static void check_polarization_change(void) report_prefix_push("Polarization change"); /* We expect a clean state through reset */ - report(diag308_load_reset(1), "load normal reset done"); + assert(diag308_load_reset(1)); /* * Set vertical polarization to verify that RESET sets @@ -123,7 +123,7 @@ static void check_polarization_change(void) cc = ptf(PTF_REQ_VERTICAL, &rc); report(cc == 0, "Set vertical polarization."); - report(diag308_load_reset(1), "load normal reset done"); + assert(diag308_load_reset(1)); cc = ptf(PTF_CHECK, &rc); report(cc == 0, "Reset should clear topology report"); @@ -137,25 +137,25 @@ static void check_polarization_change(void) report(cc == 0, "Change to vertical"); cc = ptf(PTF_CHECK, &rc); - report(cc == 1, "Should report"); + report(cc == 1, "Should report change after horizontal -> vertical"); cc = ptf(PTF_REQ_VERTICAL, &rc); report(cc == 2 && rc == PTF_ERR_ALRDY_POLARIZED, "Double change to vertical"); cc = ptf(PTF_CHECK, &rc); - report(cc == 0, "Should not report"); + report(cc == 0, "Should not report change after vertical -> vertical"); cc = ptf(PTF_REQ_HORIZONTAL, &rc); report(cc == 0, "Change to horizontal"); cc = ptf(PTF_CHECK, &rc); - report(cc == 1, "Should Report"); + report(cc == 1, "Should report change after vertical -> horizontal"); cc = ptf(PTF_REQ_HORIZONTAL, &rc); report(cc == 2 && rc == PTF_ERR_ALRDY_POLARIZED, "Double change to horizontal"); cc = ptf(PTF_CHECK, &rc); - report(cc == 0, "Should not report"); + report(cc == 0, "Should not report change after horizontal -> horizontal"); report_prefix_pop(); } From patchwork Fri Oct 20 14:48:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nina Schoetterl-Glausch X-Patchwork-Id: 13430843 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 73DCDC00A98 for ; Fri, 20 Oct 2023 14:58:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377629AbjJTO6Y (ORCPT ); Fri, 20 Oct 2023 10:58:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41462 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377620AbjJTO6W (ORCPT ); Fri, 20 Oct 2023 10:58:22 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 106D7D46; Fri, 20 Oct 2023 07:58:20 -0700 (PDT) Received: from pps.filterd (m0353729.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KEvF9K009684; Fri, 20 Oct 2023 14:58:09 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=H1oIdVhw4GTc1pze6YXGuHLOiPcpY3V7hJUZ/hOL9G0=; b=JM0SQ14oxPp6MPfQNehVQaTiVQVj/e8QHIiuxkdOwppmCQWk1nnFZiHX3keCTgEgrDea XgUbRbWYn7Shwxb9xZoINHSZHGigj3MDIZL+eTc60NciSiiPAsbzrifY2+/pCefnGB4M DMRAwHdZq1xEyfLvSQQzyvcfg05yEfJB2ZnxXm03DPBtfCN5wtxDvWOTpgR3K841++Vv 3YFlOhE6+o3L9LJQNpuwfRz3LT9w9U/uZqqItp4PbjgHyihBCREx3mQ2FNP36j+M+JNf zJJWOtp7VBKTsKvWXbgClNEy2tPZjgGAMgS7irMvpHUp1EcvDHyNBWV+YM63lmp8M5Z6 xg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuus0g002-68 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:58:08 +0000 Received: from m0353729.ppops.net (m0353729.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KElltU006936; Fri, 20 Oct 2023 14:50:14 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuum787xw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:50:12 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KC94sY032108; Fri, 20 Oct 2023 14:49:09 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tuc35n6gw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:08 +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 39KEn5rs16646850 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 14:49:05 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BA5B620040; Fri, 20 Oct 2023 14:49:05 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 810FF20043; Fri, 20 Oct 2023 14:49:05 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Oct 2023 14:49:05 +0000 (GMT) From: Nina Schoetterl-Glausch To: =?utf-8?q?Nico_B=C3=B6hr?= , Claudio Imbrenda , Janosch Frank Cc: Nina Schoetterl-Glausch , Andrew Jones , Ricardo Koller , Thomas Huth , Sean Christopherson , David Hildenbrand , kvm@vger.kernel.org, Shaoqin Huang , Colton Lewis , Nikos Nikoleris , linux-s390@vger.kernel.org Subject: [kvm-unit-tests PATCH 06/10] s390x: topology: Refine stsi header test Date: Fri, 20 Oct 2023 16:48:56 +0200 Message-Id: <20231020144900.2213398-7-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020144900.2213398-1-nsg@linux.ibm.com> References: <20231020144900.2213398-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: i8FppOVT79tGnsHud1gkTWMDEHJZ2KAj X-Proofpoint-ORIG-GUID: wQ5dn4RwMgIApBGIE77ZTim1U3Xb0viV X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 spamscore=0 mlxscore=0 bulkscore=0 adultscore=0 mlxlogscore=999 impostorscore=0 lowpriorityscore=0 phishscore=0 suspectscore=0 priorityscore=1501 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200124 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Add checks for length field. Also minor refactor. Reviewed-by: Nico Boehr Signed-off-by: Nina Schoetterl-Glausch Reviewed-by: Janosch Frank --- s390x/topology.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/s390x/topology.c b/s390x/topology.c index 03bc3d3b..6a5f100e 100644 --- a/s390x/topology.c +++ b/s390x/topology.c @@ -187,18 +187,23 @@ static void stsi_check_maxcpus(struct sysinfo_15_1_x *info) } /* - * stsi_check_mag + * stsi_check_header * @info: Pointer to the stsi information + * @sel2: stsi selector 2 value * * MAG field should match the architecture defined containers * when MNEST as returned by SCLP matches MNEST of the SYSIB. */ -static void stsi_check_mag(struct sysinfo_15_1_x *info) +static void stsi_check_header(struct sysinfo_15_1_x *info, int sel2) { int i; - report_prefix_push("MAG"); + report_prefix_push("Header"); + /* Header is 16 bytes, each TLE 8 or 16, therefore alignment must be 8 at least */ + report(IS_ALIGNED(info->length, 8), "Length %d multiple of 8", info->length); + report(info->length < PAGE_SIZE, "Length %d in bounds", info->length); + report(sel2 == info->mnest, "Valid mnest"); stsi_check_maxcpus(info); /* @@ -328,7 +333,6 @@ static int stsi_get_sysib(struct sysinfo_15_1_x *info, int sel2) if (max_nested_lvl >= sel2) { report(!ret, "Valid instruction"); - report(sel2 == info->mnest, "Valid mnest"); } else { report(ret, "Invalid instruction"); } @@ -367,7 +371,7 @@ static void check_sysinfo_15_1_x(struct sysinfo_15_1_x *info, int sel2) goto vertical; } - stsi_check_mag(info); + stsi_check_header(info, sel2); stsi_check_tle_coherency(info); vertical: @@ -380,7 +384,7 @@ vertical: goto end; } - stsi_check_mag(info); + stsi_check_header(info, sel2); stsi_check_tle_coherency(info); report_prefix_pop(); From patchwork Fri Oct 20 14:48:57 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nina Schoetterl-Glausch X-Patchwork-Id: 13430823 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 6544DC07480 for ; Fri, 20 Oct 2023 14:49:24 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377588AbjJTOtY (ORCPT ); Fri, 20 Oct 2023 10:49:24 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40204 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377239AbjJTOtX (ORCPT ); Fri, 20 Oct 2023 10:49:23 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DAB31CF; Fri, 20 Oct 2023 07:49:21 -0700 (PDT) Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KEiWpw017498; Fri, 20 Oct 2023 14:49:12 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=Kaz1ZAB6nK3IbptVY/pEWTU37xKrHWxpq8e63wCzV4I=; b=WGNsDkuSofvIDCr/dBBHwgDBWbbY3rKbSC8Mo6KNro3ikh03TU7f+vDdm4Z1ZFrDmSPm qg+0j59o17YRQsKvFooIqES/O83AYWqXDDfQ0RdRVyD7C+JdNZLcFnn80+HTCpSEtUwr c0rpc3FNkKoNgFmfly+FPPoetJmOAZOmKN2pa7IIv2wvhzpU+8+sqxcWF8NGFs+EVU6D j54MCoFptsUX7uffCUQpGcRvNGvUSwUX5ZiJPdX/SJ4POotyiij/HOkl0PXSzzSlMTrS HFVW3kC2+XsdiZdrNg1ATtno9OsEkwN2gaJ8BwZTG/aEAYJZU8dFB9rSMDD9P+jEoqgu xg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuuk086qu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:11 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KEii4T018229; Fri, 20 Oct 2023 14:49:11 GMT Received: from ppma21.wdc07v.mail.ibm.com (5b.69.3da9.ip4.static.sl-reverse.com [169.61.105.91]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuuk086pc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:11 +0000 Received: from pps.filterd (ppma21.wdc07v.mail.ibm.com [127.0.0.1]) by ppma21.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KC9npr024179; Fri, 20 Oct 2023 14:49:09 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma21.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tuc29574a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:09 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39KEn6ZA37093980 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 14:49:06 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1CDEC20040; Fri, 20 Oct 2023 14:49:06 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CD2A720043; Fri, 20 Oct 2023 14:49:05 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Oct 2023 14:49:05 +0000 (GMT) From: Nina Schoetterl-Glausch To: =?utf-8?q?Nico_B=C3=B6hr?= , Janosch Frank , Claudio Imbrenda Cc: Nina Schoetterl-Glausch , David Hildenbrand , Nikos Nikoleris , Ricardo Koller , Sean Christopherson , kvm@vger.kernel.org, Colton Lewis , Shaoqin Huang , Thomas Huth , linux-s390@vger.kernel.org, Andrew Jones Subject: [kvm-unit-tests PATCH 07/10] s390x: topology: Rename topology_core to topology_cpu Date: Fri, 20 Oct 2023 16:48:57 +0200 Message-Id: <20231020144900.2213398-8-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020144900.2213398-1-nsg@linux.ibm.com> References: <20231020144900.2213398-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: QQTtwBGXh5npQ9eY6IyLK3ADLXvEFfoi X-Proofpoint-ORIG-GUID: NtdHXMbeEaDizn-TAEqkb3mwnEm3Lu5j X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 mlxscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 impostorscore=0 bulkscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200121 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org This is more in line with the nomenclature in the PoP. Reviewed-by: Janosch Frank Reviewed-by: Nico Boehr Signed-off-by: Nina Schoetterl-Glausch --- lib/s390x/stsi.h | 4 ++-- s390x/topology.c | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/s390x/stsi.h b/lib/s390x/stsi.h index 2f6182c1..1e9d0958 100644 --- a/lib/s390x/stsi.h +++ b/lib/s390x/stsi.h @@ -30,7 +30,7 @@ struct sysinfo_3_2_2 { }; #define CPUS_TLE_RES_BITS 0x00fffffff8000000UL -struct topology_core { +struct topology_cpu { uint8_t nl; uint8_t reserved1[3]; uint8_t reserved4:5; @@ -61,7 +61,7 @@ struct topology_container { union topology_entry { uint8_t nl; - struct topology_core cpu; + struct topology_cpu cpu; struct topology_container container; }; diff --git a/s390x/topology.c b/s390x/topology.c index 6a5f100e..df158aef 100644 --- a/s390x/topology.c +++ b/s390x/topology.c @@ -247,7 +247,7 @@ done: static uint8_t *check_tle(void *tc) { struct topology_container *container = tc; - struct topology_core *cpus; + struct topology_cpu *cpus; int n; if (container->nl) { From patchwork Fri Oct 20 14:48:58 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nina Schoetterl-Glausch X-Patchwork-Id: 13430855 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 35EBAC0032E for ; Fri, 20 Oct 2023 15:03:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377617AbjJTPDI (ORCPT ); Fri, 20 Oct 2023 11:03:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34948 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377588AbjJTPDH (ORCPT ); Fri, 20 Oct 2023 11:03:07 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10FB4D46; Fri, 20 Oct 2023 08:03:05 -0700 (PDT) Received: from pps.filterd (m0360072.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KF0PJE012628; Fri, 20 Oct 2023 15:02:54 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=I3YkIsPQpDoE7Qz/xMlqA1jM26BOKVO6YCbX1uvPmnw=; b=Dpm9DeQQhZiIYmmNZlx/15z47RlvYwCU3YtQE+173OmD6ANxfJdhOe5gdk4kndtBWZCp RvmSs6gmiBf/NuLW4Jpacl4qAkozLqpH4IG1igmw+3iPaN2khGCNsnma4sx5RvptApSI rhzgqmTF2R227lt+NpR8M97lr0N1hXaRgK0Nw9YQsn7tjKzS4A9ZS5d3QEc50zShuMW9 PS8qYO01pmFiguXMctmAzf9oHaKO+9OwJVbh1BrsldspEwzGJKu1cujTPMFPj9aOvvYO /jjQbVAUq1YEWx6i3XnAyLA1nDapf/3NEd4l9TrNqPbj4zVeKATvNV8gtdqGqth3HQBH /w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuut9r6fx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 15:02:53 +0000 Received: from m0360072.ppops.net (m0360072.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KF0StO013204; Fri, 20 Oct 2023 15:02:53 GMT Received: from ppma22.wdc07v.mail.ibm.com (5c.69.3da9.ip4.static.sl-reverse.com [169.61.105.92]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuut9r5n4-12 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 15:02:53 +0000 Received: from pps.filterd (ppma22.wdc07v.mail.ibm.com [127.0.0.1]) by ppma22.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KCAoYX029822; Fri, 20 Oct 2023 14:49:09 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma22.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tuc47n67g-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:09 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39KEn65n37814638 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 14:49:06 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6FE4A20040; Fri, 20 Oct 2023 14:49:06 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2FC2120043; Fri, 20 Oct 2023 14:49:06 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Oct 2023 14:49:06 +0000 (GMT) From: Nina Schoetterl-Glausch To: Claudio Imbrenda , =?utf-8?q?Nico_B=C3=B6hr?= , Janosch Frank Cc: Nina Schoetterl-Glausch , Andrew Jones , Ricardo Koller , Thomas Huth , Nikos Nikoleris , Colton Lewis , Sean Christopherson , Shaoqin Huang , kvm@vger.kernel.org, linux-s390@vger.kernel.org, David Hildenbrand Subject: [kvm-unit-tests PATCH 08/10] s390x: topology: Rewrite topology list test Date: Fri, 20 Oct 2023 16:48:58 +0200 Message-Id: <20231020144900.2213398-9-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020144900.2213398-1-nsg@linux.ibm.com> References: <20231020144900.2213398-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: cmCWlPWlGE7aojBkcjDJXmVI0LrtlFfy X-Proofpoint-GUID: CshJMbFz2rDsen-_5rMFn5gAEayZo3UM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 phishscore=0 clxscore=1015 mlxscore=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 adultscore=0 suspectscore=0 mlxlogscore=999 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200124 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Rewrite recursion with separate functions for checking containers, containers containing CPUs and CPUs. This improves comprehension and allows for more tests. We now also test for ordering of CPU TLEs and number of child entries. Signed-off-by: Nina Schoetterl-Glausch --- lib/s390x/stsi.h | 36 +++++---- s390x/topology.c | 201 ++++++++++++++++++++++++++++------------------- 2 files changed, 142 insertions(+), 95 deletions(-) diff --git a/lib/s390x/stsi.h b/lib/s390x/stsi.h index 1e9d0958..f2290ca7 100644 --- a/lib/s390x/stsi.h +++ b/lib/s390x/stsi.h @@ -30,15 +30,18 @@ struct sysinfo_3_2_2 { }; #define CPUS_TLE_RES_BITS 0x00fffffff8000000UL -struct topology_cpu { - uint8_t nl; - uint8_t reserved1[3]; - uint8_t reserved4:5; - uint8_t d:1; - uint8_t pp:2; - uint8_t type; - uint16_t origin; - uint64_t mask; +union topology_cpu { + uint64_t raw[2]; + struct { + uint8_t nl; + uint8_t reserved1[3]; + uint8_t reserved4:5; + uint8_t d:1; + uint8_t pp:2; + uint8_t type; + uint16_t origin; + uint64_t mask; + }; }; enum topology_polarization { @@ -53,16 +56,19 @@ enum cpu_type { }; #define CONTAINER_TLE_RES_BITS 0x00ffffffffffff00UL -struct topology_container { - uint8_t nl; - uint8_t reserved[6]; - uint8_t id; +union topology_container { + uint64_t raw; + struct { + uint8_t nl; + uint8_t reserved[6]; + uint8_t id; + }; }; union topology_entry { uint8_t nl; - struct topology_cpu cpu; - struct topology_container container; + union topology_cpu cpu; + union topology_container container; }; #define CPU_TOPOLOGY_MAX_LEVEL 6 diff --git a/s390x/topology.c b/s390x/topology.c index df158aef..037d22cd 100644 --- a/s390x/topology.c +++ b/s390x/topology.c @@ -2,7 +2,7 @@ /* * CPU Topology * - * Copyright IBM Corp. 2022 + * Copyright IBM Corp. 2022, 2023 * * Authors: * Pierre Morel @@ -23,7 +23,6 @@ static uint8_t pagebuf[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE))); static int max_nested_lvl; static int number_of_cpus; -static int cpus_in_masks; static int max_cpus; /* @@ -237,82 +236,6 @@ done: report_prefix_pop(); } -/** - * check_tle: - * @tc: pointer to first TLE - * - * Recursively check the containers TLEs until we - * find a CPU TLE. - */ -static uint8_t *check_tle(void *tc) -{ - struct topology_container *container = tc; - struct topology_cpu *cpus; - int n; - - if (container->nl) { - report_info("NL: %d id: %d", container->nl, container->id); - - report(!(*(uint64_t *)tc & CONTAINER_TLE_RES_BITS), - "reserved bits %016lx", - *(uint64_t *)tc & CONTAINER_TLE_RES_BITS); - - return check_tle(tc + sizeof(*container)); - } - - report_info("NL: %d", container->nl); - cpus = tc; - - report(!(*(uint64_t *)tc & CPUS_TLE_RES_BITS), "reserved bits %016lx", - *(uint64_t *)tc & CPUS_TLE_RES_BITS); - - report(cpus->type == CPU_TYPE_IFL, "type IFL"); - - report_info("origin: %d", cpus->origin); - report_info("mask: %016lx", cpus->mask); - report_info("dedicated: %d entitlement: %d", cpus->d, cpus->pp); - - n = __builtin_popcountl(cpus->mask); - report(n <= expected_topo_lvl[0], "CPUs per mask: %d out of max %d", - n, expected_topo_lvl[0]); - cpus_in_masks += n; - - if (!cpus->d) - report_skip("Not dedicated"); - else - report(cpus->pp == POLARIZATION_VERTICAL_HIGH || - cpus->pp == POLARIZATION_HORIZONTAL, - "Dedicated CPUs are either horizontally polarized or have high entitlement"); - - return tc + sizeof(*cpus); -} - -/** - * stsi_check_tle_coherency: - * @info: Pointer to the stsi information - * - * We verify that we get the expected number of Topology List Entry - * containers for a specific level. - */ -static void stsi_check_tle_coherency(struct sysinfo_15_1_x *info) -{ - void *tc, *end; - - report_prefix_push("TLE"); - cpus_in_masks = 0; - - tc = info->tle; - end = (void *)info + info->length; - - while (tc < end) - tc = check_tle(tc); - - report(cpus_in_masks == number_of_cpus, "CPUs in mask %d", - cpus_in_masks); - - report_prefix_pop(); -} - /** * stsi_get_sysib: * @info: pointer to the STSI info structure @@ -342,6 +265,124 @@ static int stsi_get_sysib(struct sysinfo_15_1_x *info, int sel2) return ret; } +static int check_cpu(union topology_cpu *cpu, + union topology_container *parent) +{ + report_prefix_pushf("%d:%d:%d:%d", cpu->d, cpu->pp, cpu->type, cpu->origin); + + report(!(cpu->raw[0] & CPUS_TLE_RES_BITS), "reserved bits %016lx", + cpu->raw[0] & CPUS_TLE_RES_BITS); + + report(cpu->type == CPU_TYPE_IFL, "type IFL"); + + if (cpu->d) + report(cpu->pp == POLARIZATION_VERTICAL_HIGH || + cpu->pp == POLARIZATION_HORIZONTAL, + "Dedicated CPUs are either horizontally polarized or have high entitlement"); + else + report_skip("Not dedicated"); + + report_prefix_pop(); + + return __builtin_popcountl(cpu->mask); +} + +static union topology_container *check_child_cpus(struct sysinfo_15_1_x *info, + union topology_container *cont, + union topology_cpu *child, + unsigned int *cpus_in_masks) +{ + void *last = ((void *)info) + info->length; + union topology_cpu *prev_cpu = NULL; + unsigned int cpus = 0; + int i; + + for (i = 0; (void *)&child[i] < last && child[i].nl == 0; i++) { + cpus += check_cpu(&child[i], cont); + if (prev_cpu) { + report(prev_cpu->type <= child[i].type, "Correct ordering wrt type"); + if (prev_cpu->type < child[i].type) + continue; + report(prev_cpu->pp >= child[i].pp, "Correct ordering wrt polarization"); + if (prev_cpu->pp > child[i].pp) + continue; + report(prev_cpu->d || !child[i].d, "Correct ordering wrt dedication"); + if (prev_cpu->d && !child[i].d) + continue; + report(prev_cpu->origin <= child[i].origin, "Correct ordering wrt origin"); + } + prev_cpu = &child[i]; + } + report(cpus <= expected_topo_lvl[0], "%d children <= max of %d", + cpus, expected_topo_lvl[0]); + *cpus_in_masks += cpus; + + return (union topology_container *)&child[i]; +} + +static union topology_container *check_container(struct sysinfo_15_1_x *info, + union topology_container *cont, + union topology_entry *child, + unsigned int *cpus_in_masks); + +static union topology_container *check_child_containers(struct sysinfo_15_1_x *info, + union topology_container *cont, + union topology_container *child, + unsigned int *cpus_in_masks) +{ + void *last = ((void *)info) + info->length; + union topology_container *entry; + int i; + + for (i = 0, entry = child; (void *)entry < last && entry->nl == cont->nl - 1; i++) { + entry = check_container(info, entry, (union topology_entry *)(entry + 1), + cpus_in_masks); + } + if (max_nested_lvl == info->mnest) + report(i <= expected_topo_lvl[cont->nl - 1], "%d children <= max of %d", + i, expected_topo_lvl[cont->nl - 1]); + + return entry; +} + +static union topology_container *check_container(struct sysinfo_15_1_x *info, + union topology_container *cont, + union topology_entry *child, + unsigned int *cpus_in_masks) +{ + union topology_container *entry; + + report_prefix_pushf("%d", cont->id); + + report(cont->nl - 1 == child->nl, "Level %d one above child level %d", + cont->nl, child->nl); + report(!(cont->raw & CONTAINER_TLE_RES_BITS), "reserved bits %016lx", + cont->raw & CONTAINER_TLE_RES_BITS); + + if (cont->nl > 1) + entry = check_child_containers(info, cont, &child->container, cpus_in_masks); + else + entry = check_child_cpus(info, cont, &child->cpu, cpus_in_masks); + + report_prefix_pop(); + return entry; +} + +static void check_topology_list(struct sysinfo_15_1_x *info, int sel2) +{ + union topology_container dummy = { .nl = sel2, .id = 0 }; + unsigned int cpus_in_masks = 0; + + report_prefix_push("TLE"); + + check_container(info, &dummy, info->tle, &cpus_in_masks); + report(cpus_in_masks == number_of_cpus, + "Number of CPUs %d equals %d CPUs in masks", + number_of_cpus, cpus_in_masks); + + report_prefix_pop(); +} + /** * check_sysinfo_15_1_x: * @info: pointer to the STSI info structure @@ -372,7 +413,7 @@ static void check_sysinfo_15_1_x(struct sysinfo_15_1_x *info, int sel2) } stsi_check_header(info, sel2); - stsi_check_tle_coherency(info); + check_topology_list(info, sel2); vertical: report_prefix_pop(); @@ -385,7 +426,7 @@ vertical: } stsi_check_header(info, sel2); - stsi_check_tle_coherency(info); + check_topology_list(info, sel2); report_prefix_pop(); end: From patchwork Fri Oct 20 14:48:59 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nina Schoetterl-Glausch X-Patchwork-Id: 13430899 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 17EB3C0032E for ; Fri, 20 Oct 2023 15:32:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377717AbjJTPcy (ORCPT ); Fri, 20 Oct 2023 11:32:54 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377725AbjJTPcw (ORCPT ); Fri, 20 Oct 2023 11:32:52 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3E4F9D6E; Fri, 20 Oct 2023 08:32:48 -0700 (PDT) Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KFEXYS006326; Fri, 20 Oct 2023 15:32:44 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=s9EX2lIAtk9uao5McAdt1Ddbm+myB+BjqVbx+TMyoXA=; b=j8E/0fyL1CHn832cATMu4G7DyNqhEotu9/CADmqwTY1NC2KNAuNM1X3mw+SOVLHY2uzO RLMd36k5uin4QRz7Ix94atiU6lkBH4hi6JShGBy7uk392fX13Yl0u2FEI5esdgwYISob oVWloGaw2AHtlojJhBajYhHIrrzi5ukOklTh+AO8Gd93AYPIwHbb+JPST6M9uackWEy2 c88F9c5pSgtiIeB48EQNTZX2NB+Hmc78Tea2zs3QR8oSafSNOP/eAFHZ1sui6p7kXj6H md37KNyRSuZYYG1hww+WbkI5YM5RMJePkgvYUKDLs1DQLnoC3y3+RNf2AyNwKM6sy+Fm IQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuv120skv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 15:32:43 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KFEXOX006341; Fri, 20 Oct 2023 15:32:43 GMT Received: from ppma11.dal12v.mail.ibm.com (db.9e.1632.ip4.static.sl-reverse.com [50.22.158.219]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuv120sc9-14 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 15:32:43 +0000 Received: from pps.filterd (ppma11.dal12v.mail.ibm.com [127.0.0.1]) by ppma11.dal12v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KCCgCB019392; Fri, 20 Oct 2023 14:49:09 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma11.dal12v.mail.ibm.com (PPS) with ESMTPS id 3tuc4556ek-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:09 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39KEn6mc37093984 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 14:49:06 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BBCF520040; Fri, 20 Oct 2023 14:49:06 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 82BED2004B; Fri, 20 Oct 2023 14:49:06 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Oct 2023 14:49:06 +0000 (GMT) From: Nina Schoetterl-Glausch To: Nico Boehr , Nikos Nikoleris , Shaoqin Huang , Andrew Jones , Nina Schoetterl-Glausch , Thomas Huth , Sean Christopherson , Colton Lewis Cc: David Hildenbrand , Ricardo Koller , Janosch Frank , linux-s390@vger.kernel.org, Claudio Imbrenda , kvm@vger.kernel.org Subject: [kvm-unit-tests PATCH 09/10] scripts: Implement multiline strings for extra_params Date: Fri, 20 Oct 2023 16:48:59 +0200 Message-Id: <20231020144900.2213398-10-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020144900.2213398-1-nsg@linux.ibm.com> References: <20231020144900.2213398-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: JZk7ZdMXW1IxR-YNLazzMXQDcp0A-OmC X-Proofpoint-ORIG-GUID: 298pfpG1O1wftfqKStlZAurirNHaqWwh X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 bulkscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 suspectscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 phishscore=0 malwarescore=0 priorityscore=1501 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200128 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Implement a rudimentary form only. extra_params can get long when passing a lot of arguments to qemu. Multiline strings help with readability of the .cfg file. Multiline strings begin and end with """, which must occur on separate lines. For example: extra_params = """-cpu max,ctop=on -smp cpus=1,cores=16,maxcpus=128 \ -append '-drawers 2 -books 2 -sockets 2 -cores 16' \ -device max-s390x-cpu,core-id=31,drawer-id=0,book-id=0,socket-id=0""" The command string built with extra_params is eval'ed by the runtime script, so the newlines need to be escaped with \. Signed-off-by: Nina Schoetterl-Glausch Reviewed-by: Thomas Huth --- scripts/common.bash | 16 ++++++++++++++++ scripts/runtime.bash | 4 ++-- 2 files changed, 18 insertions(+), 2 deletions(-) diff --git a/scripts/common.bash b/scripts/common.bash index 7b983f7d..b9413d68 100644 --- a/scripts/common.bash +++ b/scripts/common.bash @@ -36,6 +36,22 @@ function for_each_unittest() kernel=$TEST_DIR/${BASH_REMATCH[1]} elif [[ $line =~ ^smp\ *=\ *(.*)$ ]]; then smp=${BASH_REMATCH[1]} + elif [[ $line =~ ^extra_params\ *=\ *'"""'(.*)$ ]]; then + opts=${BASH_REMATCH[1]}$'\n' + while read -r -u $fd; do + #escape backslash newline, but not double backslash + if [[ $opts =~ [^\\]*(\\*)$'\n'$ ]]; then + if (( ${#BASH_REMATCH[1]} % 2 == 1 )); then + opts=${opts%\\$'\n'} + fi + fi + if [[ "$REPLY" =~ ^(.*)'"""'[:blank:]*$ ]]; then + opts+=${BASH_REMATCH[1]} + break + else + opts+=$REPLY$'\n' + fi + done elif [[ $line =~ ^extra_params\ *=\ *(.*)$ ]]; then opts=${BASH_REMATCH[1]} elif [[ $line =~ ^groups\ *=\ *(.*)$ ]]; then diff --git a/scripts/runtime.bash b/scripts/runtime.bash index ada8ffd7..fc156f2f 100644 --- a/scripts/runtime.bash +++ b/scripts/runtime.bash @@ -15,7 +15,7 @@ extract_summary() # We assume that QEMU is going to work if it tried to load the kernel premature_failure() { - local log="$(eval $(get_cmdline _NO_FILE_4Uhere_) 2>&1)" + local log="$(eval "$(get_cmdline _NO_FILE_4Uhere_)" 2>&1)" echo "$log" | grep "_NO_FILE_4Uhere_" | grep -q -e "could not \(load\|open\) kernel" -e "error loading" && @@ -168,7 +168,7 @@ function run() # extra_params in the config file may contain backticks that need to be # expanded, so use eval to start qemu. Use "> >(foo)" instead of a pipe to # preserve the exit status. - summary=$(eval $cmdline 2> >(RUNTIME_log_stderr $testname) \ + summary=$(eval "$cmdline" 2> >(RUNTIME_log_stderr $testname) \ > >(tee >(RUNTIME_log_stdout $testname $kernel) | extract_summary)) ret=$? [ "$KUT_STANDALONE" != "yes" ] && echo > >(RUNTIME_log_stdout $testname $kernel) From patchwork Fri Oct 20 14:49:00 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nina Schoetterl-Glausch X-Patchwork-Id: 13430856 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 2E417C07480 for ; Fri, 20 Oct 2023 15:03:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1377621AbjJTPDK (ORCPT ); Fri, 20 Oct 2023 11:03:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34960 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1377616AbjJTPDI (ORCPT ); Fri, 20 Oct 2023 11:03:08 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3EDF8A3; Fri, 20 Oct 2023 08:03:06 -0700 (PDT) Received: from pps.filterd (m0353728.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 39KF1LKd026901; Fri, 20 Oct 2023 15:02:55 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=vfy2BbXPZ3GBSfZP8lhNLksdq2mP+G/GRk1P80/4JL8=; b=PF8LwiS3wjQBZC/8SK7gVJ/0gd/zgs6NORfBPVYzDSxC7xw8C6/CWGL8hU4Cm0mkGZRm uF0MABs8TOq4oV3JwljGzfZ7DmSRWWEqmDVP4dPaN6rkk9zixjvXfqnATqUiLu37LSxf CYItyqWgi3Sd3/Sv112dViav7cjVsQh5yE0pNIwzyaktHY8mUMu5815pHqgqvWyx8sXz DIf1hlZBoSMYUrXyqQJRf3leEsDW+PTACgLHW+e9sV/nkk0sSSeqMxJj/PoLASY5JMjs wiI+QABz7lyjI4e3X0e8ZriMOw/lGDIgu1JJnKTxtw97YGj917ASCIhhNvSh8wDwggaZ hQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuupp8b81-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 15:02:53 +0000 Received: from m0353728.ppops.net (m0353728.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 39KF2Kkq001575; Fri, 20 Oct 2023 15:02:52 GMT Received: from ppma23.wdc07v.mail.ibm.com (5d.69.3da9.ip4.static.sl-reverse.com [169.61.105.93]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3tuupp8b1a-3 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 15:02:52 +0000 Received: from pps.filterd (ppma23.wdc07v.mail.ibm.com [127.0.0.1]) by ppma23.wdc07v.mail.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 39KC0UiJ032066; Fri, 20 Oct 2023 14:49:10 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma23.wdc07v.mail.ibm.com (PPS) with ESMTPS id 3tuc35n6h1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 20 Oct 2023 14:49:10 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 39KEn73s16908946 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Fri, 20 Oct 2023 14:49:07 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1B2D120040; Fri, 20 Oct 2023 14:49:07 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CEAC420043; Fri, 20 Oct 2023 14:49:06 +0000 (GMT) Received: from tuxmaker.boeblingen.de.ibm.com (unknown [9.152.85.9]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Fri, 20 Oct 2023 14:49:06 +0000 (GMT) From: Nina Schoetterl-Glausch To: =?utf-8?q?Nico_B=C3=B6hr?= , Claudio Imbrenda , Janosch Frank Cc: Nina Schoetterl-Glausch , Sean Christopherson , David Hildenbrand , Nikos Nikoleris , Colton Lewis , kvm@vger.kernel.org, Ricardo Koller , Andrew Jones , Shaoqin Huang , linux-s390@vger.kernel.org, Thomas Huth Subject: [kvm-unit-tests PATCH 10/10] s390x: topology: Add complex topology test Date: Fri, 20 Oct 2023 16:49:00 +0200 Message-Id: <20231020144900.2213398-11-nsg@linux.ibm.com> X-Mailer: git-send-email 2.39.2 In-Reply-To: <20231020144900.2213398-1-nsg@linux.ibm.com> References: <20231020144900.2213398-1-nsg@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: WwuMV6V4Vs3NfekM9balOy-TckyosR2W X-Proofpoint-GUID: _wqwSnBb2f8qB71n3DQZlq_yRVMPMRBt X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.272,Aquarius:18.0.980,Hydra:6.0.619,FMLib:17.11.176.26 definitions=2023-10-20_10,2023-10-19_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 mlxscore=0 spamscore=0 lowpriorityscore=0 bulkscore=0 adultscore=0 phishscore=0 suspectscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2310170001 definitions=main-2310200124 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Run the topology test case with a complex topology configuration. Randomly generated with: python -c 'import random ds=bs=ss=2 cs=16 cids=list(range(1,ds*bs*ss*cs)) random.shuffle(cids) i = 0 for d in range(ds): for b in range(bs): for s in range(ss): for c in range(cs): if (d,b,s,c) != (0,0,0,0): ded=["false","true"][random.randrange(0,2)] ent="high" if ded == "true" else ["low", "medium", "high"][random.randrange(0,3)] print(f"-device max-s390x-cpu,core-id={cids[i]},drawer-id={d},book-id={b},socket-id={s},entitlement={ent},dedicated={ded}") i+=1' Signed-off-by: Nina Schoetterl-Glausch --- s390x/unittests.cfg | 133 ++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 133 insertions(+) diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg index 68e119e4..b08b0fb1 100644 --- a/s390x/unittests.cfg +++ b/s390x/unittests.cfg @@ -247,3 +247,136 @@ file = topology.elf [topology-2] file = topology.elf extra_params = -cpu max,ctop=on -smp sockets=31,cores=8,maxcpus=248 -append '-sockets 31 -cores 8' + +[topology-3] +file = topology.elf +extra_params = """-cpu max,ctop=on -smp cpus=1,drawers=2,books=2,sockets=2,cores=16,maxcpus=128 \ +-append '-drawers 2 -books 2 -sockets 2 -cores 16' \ +-device max-s390x-cpu,core-id=31,drawer-id=0,book-id=0,socket-id=0,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=11,drawer-id=0,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=95,drawer-id=0,book-id=0,socket-id=0,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=73,drawer-id=0,book-id=0,socket-id=0,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=78,drawer-id=0,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=13,drawer-id=0,book-id=0,socket-id=0,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=40,drawer-id=0,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=101,drawer-id=0,book-id=0,socket-id=0,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=29,drawer-id=0,book-id=0,socket-id=0,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=56,drawer-id=0,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=92,drawer-id=0,book-id=0,socket-id=0,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=30,drawer-id=0,book-id=0,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=118,drawer-id=0,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=71,drawer-id=0,book-id=0,socket-id=0,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=93,drawer-id=0,book-id=0,socket-id=0,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=16,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=5,drawer-id=0,book-id=0,socket-id=1,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=42,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=98,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=44,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=23,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=65,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=102,drawer-id=0,book-id=0,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=57,drawer-id=0,book-id=0,socket-id=1,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=125,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=127,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=82,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=14,drawer-id=0,book-id=0,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=91,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=12,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=8,drawer-id=0,book-id=0,socket-id=1,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=112,drawer-id=0,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=109,drawer-id=0,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=19,drawer-id=0,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=96,drawer-id=0,book-id=1,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=67,drawer-id=0,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=80,drawer-id=0,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=108,drawer-id=0,book-id=1,socket-id=0,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=34,drawer-id=0,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=18,drawer-id=0,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=39,drawer-id=0,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=53,drawer-id=0,book-id=1,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=46,drawer-id=0,book-id=1,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=3,drawer-id=0,book-id=1,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=76,drawer-id=0,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=15,drawer-id=0,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=7,drawer-id=0,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=81,drawer-id=0,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=1,drawer-id=0,book-id=1,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=113,drawer-id=0,book-id=1,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=38,drawer-id=0,book-id=1,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=90,drawer-id=0,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=117,drawer-id=0,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=62,drawer-id=0,book-id=1,socket-id=1,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=85,drawer-id=0,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=49,drawer-id=0,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=24,drawer-id=0,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=107,drawer-id=0,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=103,drawer-id=0,book-id=1,socket-id=1,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=33,drawer-id=0,book-id=1,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=51,drawer-id=0,book-id=1,socket-id=1,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=21,drawer-id=0,book-id=1,socket-id=1,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=72,drawer-id=0,book-id=1,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=63,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=105,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=74,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=50,drawer-id=1,book-id=0,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=60,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=22,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=43,drawer-id=1,book-id=0,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=48,drawer-id=1,book-id=0,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=35,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=58,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=106,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=123,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=122,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=9,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=10,drawer-id=1,book-id=0,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=25,drawer-id=1,book-id=0,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=116,drawer-id=1,book-id=0,socket-id=1,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=26,drawer-id=1,book-id=0,socket-id=1,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=17,drawer-id=1,book-id=0,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=20,drawer-id=1,book-id=0,socket-id=1,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=59,drawer-id=1,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=54,drawer-id=1,book-id=0,socket-id=1,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=70,drawer-id=1,book-id=0,socket-id=1,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=88,drawer-id=1,book-id=0,socket-id=1,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=6,drawer-id=1,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=52,drawer-id=1,book-id=0,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=55,drawer-id=1,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=124,drawer-id=1,book-id=0,socket-id=1,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=61,drawer-id=1,book-id=0,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=84,drawer-id=1,book-id=0,socket-id=1,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=68,drawer-id=1,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=86,drawer-id=1,book-id=0,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=4,drawer-id=1,book-id=1,socket-id=0,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=75,drawer-id=1,book-id=1,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=115,drawer-id=1,book-id=1,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=28,drawer-id=1,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=120,drawer-id=1,book-id=1,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=41,drawer-id=1,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=87,drawer-id=1,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=119,drawer-id=1,book-id=1,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=114,drawer-id=1,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=104,drawer-id=1,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=27,drawer-id=1,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=121,drawer-id=1,book-id=1,socket-id=0,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=126,drawer-id=1,book-id=1,socket-id=0,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=37,drawer-id=1,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=32,drawer-id=1,book-id=1,socket-id=0,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=94,drawer-id=1,book-id=1,socket-id=0,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=110,drawer-id=1,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=77,drawer-id=1,book-id=1,socket-id=1,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=36,drawer-id=1,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=66,drawer-id=1,book-id=1,socket-id=1,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=83,drawer-id=1,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=47,drawer-id=1,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=99,drawer-id=1,book-id=1,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=79,drawer-id=1,book-id=1,socket-id=1,entitlement=low,dedicated=false \ +-device max-s390x-cpu,core-id=100,drawer-id=1,book-id=1,socket-id=1,entitlement=medium,dedicated=false \ +-device max-s390x-cpu,core-id=89,drawer-id=1,book-id=1,socket-id=1,entitlement=high,dedicated=false \ +-device max-s390x-cpu,core-id=2,drawer-id=1,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=45,drawer-id=1,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=69,drawer-id=1,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=64,drawer-id=1,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=97,drawer-id=1,book-id=1,socket-id=1,entitlement=high,dedicated=true \ +-device max-s390x-cpu,core-id=111,drawer-id=1,book-id=1,socket-id=1,entitlement=medium,dedicated=false \ +"""