From patchwork Thu Mar 23 10:39:06 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13185487 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 2D197C6FD1D for ; Thu, 23 Mar 2023 10:43:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231637AbjCWKnr (ORCPT ); Thu, 23 Mar 2023 06:43:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46940 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231305AbjCWKnY (ORCPT ); Thu, 23 Mar 2023 06:43:24 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0A8733B21E for ; Thu, 23 Mar 2023 03:40:26 -0700 (PDT) Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32N9HA6Z027998 for ; Thu, 23 Mar 2023 10:40:23 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=DZ2WKu/ZGtOVl08v8Cef4c6EUiWjemU5CgUJlq9DuoQ=; b=df6f7Eu3d9VaZJOkpHTcDkiswMpYoxF+k+pp4JrF+iRv1vBxMpWnib7T7lJMLlM1z6PK PdROdYialK8Ao+TAacYQjZi9MeIlBo5XGbbbUl2vm3Bm2aYqJ/5im1sLPdfC2/QKuOZP PCDWkBqKWWi2Vv1GE2oAjWeVJ9gq50u1W2d+En3s88sTBCWNdz1uOLSCslSOgI/+ZN9P ahFl2YFxOK9YQngtotKvW4bsMrtROrtR2WAKMjUCathQeXctzKwDRTaixI/NeOpbuI8w Y7lHp7WO6phImcOwFBiIlip0EWbF1xrUvCbDhCpv5H6OtlcWJEClCRIjSmzKh6VOlAPt xA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pghqsnfdj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Mar 2023 10:40:22 +0000 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32NAUQAk001605 for ; Thu, 23 Mar 2023 10:40:22 GMT Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pghqsnfc7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:22 +0000 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32N89gxR022502; Thu, 23 Mar 2023 10:40:19 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3pd4x6f80j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:19 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32NAeFbr64815514 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Mar 2023 10:40:15 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 15FB320096; Thu, 23 Mar 2023 10:40:15 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 663E62008E; Thu, 23 Mar 2023 10:40:14 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 23 Mar 2023 10:40:14 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org, nrb@linux.ibm.com Cc: thuth@redhat.com, imbrenda@linux.ibm.com Subject: [kvm-unit-tests PATCH 1/8] s390x: uv-host: Fix UV init test memory allocation Date: Thu, 23 Mar 2023 10:39:06 +0000 Message-Id: <20230323103913.40720-2-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230323103913.40720-1-frankja@linux.ibm.com> References: <20230323103913.40720-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: YM7oDrgSJXRN7eo8PniGt_OZRc1MAU_N X-Proofpoint-ORIG-GUID: -4KnSRdwsXaFDqNa-9eoEs3VsbTwWUiW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_21,2023-03-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 adultscore=0 suspectscore=0 clxscore=1015 mlxscore=0 impostorscore=0 spamscore=0 bulkscore=0 mlxlogscore=880 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303230080 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The init memory has to be above 2G and 1M aligned but we're currently aligning on 2G which means the allocations need a lot of unused memory. Let's fix that. Signed-off-by: Janosch Frank --- s390x/uv-host.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/s390x/uv-host.c b/s390x/uv-host.c index 33e6eec6..68de47e7 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -555,7 +555,7 @@ static void test_init(void) rc = uv_call(0, (uint64_t)&uvcb_init); report(rc == 0 && uvcb_init.header.rc == UVC_RC_EXECUTED, "successful"); - mem = (uint64_t)memalign(1UL << 31, uvcb_qui.uv_base_stor_len); + mem = (uint64_t)memalign_pages_flags(HPAGE_SIZE, uvcb_qui.uv_base_stor_len, AREA_NORMAL); rc = uv_call(0, (uint64_t)&uvcb_init); report(rc == 1 && uvcb_init.header.rc == 0x101, "double init"); free((void *)mem); From patchwork Thu Mar 23 10:39:07 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13185488 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 C6078C76195 for ; Thu, 23 Mar 2023 10:43:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231640AbjCWKnt (ORCPT ); Thu, 23 Mar 2023 06:43:49 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45412 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230021AbjCWKnZ (ORCPT ); Thu, 23 Mar 2023 06:43:25 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7A75E3B3F5 for ; Thu, 23 Mar 2023 03:40:26 -0700 (PDT) Received: from pps.filterd (m0098416.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32N9DlIt005463 for ; Thu, 23 Mar 2023 10:40:23 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=vJPipkO1S/+VzvZm4zDnIhoEA9gh+lR9TdcD9EFzy4I=; b=l/fNn+t7zhhbx1Wdowy0/gQfRGblKsxxMV9UqVfC6ISgrTadGwjGKHlLTGASV9ZxFAHv zsTvS0R7P/HaSeEimMJdqYi0xQnNOVjkjacWIHQew1NvAqltG1uwpS1h+N1XkgAMR4rV vXguW1X22/HktNs9m2+aXtrK7VydzhQe8iNig5XPqyv6fHmYfi3oo4pXGWBOz7/y6Vc9 Ix8ma6yiuD1jER34T2M4Tac/Ji/3RN7PBg8U5taNrOGJfIKFAjjyCl1f4B/ZHK742RyK Vfw/pavtiUdCo6/ksVbPhZO9ecL8LuxvoD7bOrrDkKn9YhM54oZ7q8hW8VS9dmG1K4lE 1g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgkxusyre-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Mar 2023 10:40:22 +0000 Received: from m0098416.ppops.net (m0098416.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32NAB2l4008840 for ; Thu, 23 Mar 2023 10:40:21 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgkxusyqs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:21 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32MKq8rq001485; Thu, 23 Mar 2023 10:40:19 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3pd4x6e1xn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:19 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32NAeFvx23462516 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Mar 2023 10:40:16 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CEC3F2007C; Thu, 23 Mar 2023 10:40:15 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 349672006E; Thu, 23 Mar 2023 10:40:15 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 23 Mar 2023 10:40:15 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org, nrb@linux.ibm.com Cc: thuth@redhat.com, imbrenda@linux.ibm.com Subject: [kvm-unit-tests PATCH 2/8] s390x: uv-host: Check for sufficient amount of memory Date: Thu, 23 Mar 2023 10:39:07 +0000 Message-Id: <20230323103913.40720-3-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230323103913.40720-1-frankja@linux.ibm.com> References: <20230323103913.40720-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: t3BQYrLahqT0NBJUzTrmpdQH02nqO6dH X-Proofpoint-ORIG-GUID: c8bPZ91r_hMy7O-9ogANbunNXwRYXFJJ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_21,2023-03-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 mlxlogscore=999 adultscore=0 lowpriorityscore=0 spamscore=0 mlxscore=0 phishscore=0 impostorscore=0 priorityscore=1501 malwarescore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303230080 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The UV init storage needs to be above 2G so we need a little over 2G of memory when running the test. Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- s390x/uv-host.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/s390x/uv-host.c b/s390x/uv-host.c index 68de47e7..e38a9913 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -715,6 +715,17 @@ int main(void) test_invalid(); test_uv_uninitialized(); test_query(); + + /* + * Some of the UV memory needs to be allocated with >31 bit + * addresses which means we need a lot more memory than other + * tests. + */ + if (get_ram_size() < (SZ_1M * 2200UL)) { + report_skip("Not enough memory. This test needs about 2200MB of memory"); + goto done; + } + test_init(); setup_vmem(); From patchwork Thu Mar 23 10:39:08 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13185489 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 095E8C6FD1C for ; Thu, 23 Mar 2023 10:43:52 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229893AbjCWKnv (ORCPT ); Thu, 23 Mar 2023 06:43:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43170 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231308AbjCWKnZ (ORCPT ); Thu, 23 Mar 2023 06:43:25 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 799DE3B225 for ; Thu, 23 Mar 2023 03:40:26 -0700 (PDT) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32N9oLfC026383 for ; Thu, 23 Mar 2023 10:40:22 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=rtCY4I7SvwV7gwcvS8+/0eSIAaukeb5hvVetA2z2dNY=; b=ikZUr/PdOga2DRy7jhRv+YdXSfqcv9sDkD0h5ftIS7/XTyRLtgwrbUlkB2hkM8SoBO2Q HMEunxjOwyALl2Q5i/EbOZ22PLKb0WLjyj24WYABdmLtw3Am3QjkTaEsG0ITk1Tq4XfR MquV6C6YTNnJA1vxDKIuugBwBZ32JeuEjV7A2ZDsaS0eJY0yrzZDFU82H0AEe/UruhFO ykj1PINFcy5AmVvYTwcQ63VmdaIzw+mQ+rCQWTvzueUe35kUXxVwu9/FmHm/SBAmQ230 QtIiNSe2rx8toI2rpwsNS0sGRrN1DenHh6T97V79onAtPWI3em8VZXTiJbjURaUfswc6 8A== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgmg6h5yn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Mar 2023 10:40:22 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32N9raG6004021 for ; Thu, 23 Mar 2023 10:40:22 GMT Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgmg6h5xw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:22 +0000 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32MIGfeC018062; Thu, 23 Mar 2023 10:40:20 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3pd4jfe2ry-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:20 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32NAeGSb14680708 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Mar 2023 10:40:16 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9FF332004F; Thu, 23 Mar 2023 10:40:16 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0416B20071; Thu, 23 Mar 2023 10:40:16 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 23 Mar 2023 10:40:15 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org, nrb@linux.ibm.com Cc: thuth@redhat.com, imbrenda@linux.ibm.com Subject: [kvm-unit-tests PATCH 3/8] s390x: Add PV tests to unittests.cfg Date: Thu, 23 Mar 2023 10:39:08 +0000 Message-Id: <20230323103913.40720-4-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230323103913.40720-1-frankja@linux.ibm.com> References: <20230323103913.40720-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 6lHl3TdI6l9ccEEbVWjbhZgobazLVQIJ X-Proofpoint-ORIG-GUID: 5t4zCydDde8VCsK7Q3DbEr9EApYd7sTc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_21,2023-03-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 mlxlogscore=809 adultscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303230080 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Even if the first thing those tests do is skipping they should still be run to make sure the tests boots and the skipping works. --- s390x/unittests.cfg | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg index 96977f2b..c9d341ea 100644 --- a/s390x/unittests.cfg +++ b/s390x/unittests.cfg @@ -222,3 +222,19 @@ file = migration-cmm.elf groups = migration smp = 2 extra_params = -append '--parallel' + +[pv-diags] +file = pv-diags.elf +extra_params = -m 2200 + +[pv-icptcode] +file = pv-icptcode.elf +extra_params = -m 2200 -smp 3 + +[pv-ipl] +file = pv-ipl.elf +extra_params = -m 2200 + +[uv-host] +file = uv-host.elf +extra_params = -m 2200 -smp 2 From patchwork Thu Mar 23 10:39:09 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13185490 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 B03D8C6FD1D for ; Thu, 23 Mar 2023 10:43:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229864AbjCWKnw (ORCPT ); Thu, 23 Mar 2023 06:43:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45456 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231610AbjCWKn0 (ORCPT ); Thu, 23 Mar 2023 06:43:26 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F38293B3C5 for ; Thu, 23 Mar 2023 03:40:26 -0700 (PDT) Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32NAEJBM024860 for ; Thu, 23 Mar 2023 10:40:23 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=dbD4RfrtcBN5iu5DvE3DWaW2qw7Uu4kEAYEwFGjoj4U=; b=hgbU15bvQqdNIM0u0X94HTajVsHFwaunnpIAEe8eZcJ26WWgSatZq4t+btolVekU0dFT ebOaRC63PIDzOHBGwzJrc9c9Xp1eSPXnAVxQD4WWxCtHAALiijA7wp/CDguJHE1gUdxA gde7PcJTJmoLzxVem+UYUZDhPPbWlZurpbxxDLYi0nhjYzCBKmMj9INCnuBCM9LyZJv9 wwlXtfj7iiwOCQ56e6OsbtTtRHoP4E6Rn7vVzHdZL/u+av/ND+WVQOv83oYjnguz14UI mqU8FSepCLwPZMWbUZxNisY13M7YGzE9d/OlExsrVIvBACeRSs7V3Cci73fRqVfhoIPn 4g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgmu78mdd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Mar 2023 10:40:23 +0000 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32NAGQPF031643 for ; Thu, 23 Mar 2023 10:40:23 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgmu78mck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:22 +0000 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32NAFJXK017094; Thu, 23 Mar 2023 10:40:21 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3pd4x6f6k8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:21 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32NAeHAv16581334 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Mar 2023 10:40:17 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6B83D20040; Thu, 23 Mar 2023 10:40:17 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C7D1420063; Thu, 23 Mar 2023 10:40:16 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 23 Mar 2023 10:40:16 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org, nrb@linux.ibm.com Cc: thuth@redhat.com, imbrenda@linux.ibm.com Subject: [kvm-unit-tests PATCH 4/8] s390x: uv-host: Beautify code Date: Thu, 23 Mar 2023 10:39:09 +0000 Message-Id: <20230323103913.40720-5-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230323103913.40720-1-frankja@linux.ibm.com> References: <20230323103913.40720-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: pAfKZEQZTF7FV3HypI1kfRntSlox3WqE X-Proofpoint-GUID: 5YhjKizspWnciLNt8Dfv_4wju_EKXDAR X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_21,2023-03-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 mlxscore=0 malwarescore=0 suspectscore=0 adultscore=0 bulkscore=0 impostorscore=0 mlxlogscore=999 phishscore=0 priorityscore=1501 spamscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303230080 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Fixup top comment and add missing space. Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- s390x/uv-host.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s390x/uv-host.c b/s390x/uv-host.c index e38a9913..0f550415 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -1,6 +1,6 @@ /* SPDX-License-Identifier: GPL-2.0-only */ /* - * Guest Ultravisor Call tests + * Host Ultravisor Call tests * * Copyright (c) 2021 IBM Corp * @@ -33,7 +33,7 @@ static struct uv_cb_csc uvcb_csc; extern int diag308_load_reset(u64 code); -struct cmd_list{ +struct cmd_list { const char *name; uint16_t cmd; uint16_t len; From patchwork Thu Mar 23 10:39:10 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13185493 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 2E355C7619A for ; Thu, 23 Mar 2023 10:44:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231644AbjCWKn6 (ORCPT ); Thu, 23 Mar 2023 06:43:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45824 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231206AbjCWKn1 (ORCPT ); Thu, 23 Mar 2023 06:43:27 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 128073B642 for ; Thu, 23 Mar 2023 03:40:26 -0700 (PDT) Received: from pps.filterd (m0098421.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32N8KjBD028264 for ; Thu, 23 Mar 2023 10:40: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=c2Xsngf+B0AUlm9d260xy2SJteEiX0O1Q/5pzAQL44g=; b=cuFB7Loi9GneW8b7cspX1GraFKgtCOe1VUvGXUnfUADk1uAT55IvxUVsN8krDlZej6by 69Vr0ekqXTz/4xbwvnHdl154ZTJ3wMnCag3lzPUwwxgvzoI/ZzKzEC3KrRCb+hMmqb1l ydsRAuTIzNJG79u4UNTI87ObjHnzMD9CNFaJWHXKtKHqkFF/mknpeeldFHnqI1kMaIE3 6yMZT6Ji5lIShG3XTuJPummPxKzBVDX3spg3SpqP1cw0rn4sh6DD/IsTZhM6xvPOtjiU dTRqNf0+t/ic96Cy223gaBT+h8ITln/FvncK/cboJCcy7biSpwv2EHMK6StMqbqSiRqT aA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgk65k4cb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Mar 2023 10:40:24 +0000 Received: from m0098421.ppops.net (m0098421.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32N8uaHV028839 for ; Thu, 23 Mar 2023 10:40:23 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgk65k4bt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:23 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32N93SWC003592; Thu, 23 Mar 2023 10:40:22 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma02fra.de.ibm.com (PPS) with ESMTPS id 3pd4x6e3es-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:21 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32NAeIL227394738 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Mar 2023 10:40:18 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3B2FD20040; Thu, 23 Mar 2023 10:40:18 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 975652004D; Thu, 23 Mar 2023 10:40:17 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 23 Mar 2023 10:40:17 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org, nrb@linux.ibm.com Cc: thuth@redhat.com, imbrenda@linux.ibm.com Subject: [kvm-unit-tests PATCH 5/8] s390x: uv-host: Add cpu number check Date: Thu, 23 Mar 2023 10:39:10 +0000 Message-Id: <20230323103913.40720-6-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230323103913.40720-1-frankja@linux.ibm.com> References: <20230323103913.40720-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 3fSZ070LbHiYQBWRBcS4n6OMZ7_DEF4e X-Proofpoint-GUID: M94QFlLQHLM02kzXqYes5lq0to7dUkMM X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_21,2023-03-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 suspectscore=0 adultscore=0 phishscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303230080 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org We should only run a test that needs more than one cpu if a sufficient number of cpus are available. Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- s390x/uv-host.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/s390x/uv-host.c b/s390x/uv-host.c index 0f550415..42ea2a53 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -546,11 +546,15 @@ static void test_init(void) "storage below 2GB"); uvcb_init.stor_origin = mem; - smp_cpu_setup(1, PSW_WITH_CUR_MASK(cpu_loop)); - rc = uv_call(0, (uint64_t)&uvcb_init); - report(rc == 1 && uvcb_init.header.rc == 0x102, - "too many running cpus"); - smp_cpu_stop(1); + if (smp_query_num_cpus() > 1) { + smp_cpu_setup(1, PSW_WITH_CUR_MASK(cpu_loop)); + rc = uv_call(0, (uint64_t)&uvcb_init); + report(rc == 1 && uvcb_init.header.rc == 0x102, + "too many running cpus"); + smp_cpu_stop(1); + } else { + report_skip("Not enough cpus for 0x102 test"); + } rc = uv_call(0, (uint64_t)&uvcb_init); report(rc == 0 && uvcb_init.header.rc == UVC_RC_EXECUTED, "successful"); From patchwork Thu Mar 23 10:39:11 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13185491 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 710E3C6FD1C for ; Thu, 23 Mar 2023 10:43:56 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231454AbjCWKnz (ORCPT ); Thu, 23 Mar 2023 06:43:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45678 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230370AbjCWKn1 (ORCPT ); Thu, 23 Mar 2023 06:43:27 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 08BAE3B3FE for ; Thu, 23 Mar 2023 03:40:27 -0700 (PDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32N9fgQ8012435 for ; Thu, 23 Mar 2023 10:40: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=W2XHJOQ7JrGTJF8+kIvW5eHutaHGZlOxepo0llJ+Sfk=; b=kBKEfw15JZDc8lkLEzQ8iweScNDwG1W9X1eBj8FDFYEgIHvAUG2quLF0dQSRigIUZQLl 3pjEg7wmJoGvIrzKK6IuoWbrb1DeOtlO2/edE1wTEmfH8yfv4LpLFrnGMnhWhaDdWtjq wHKqvgR3zr4PMrwQUH/Wclg/cJL7cnQM9VpoIubTZ7ttufjpIAdI2xkN/5xtnFppVKUX +IVrwmWw4Mpwie4nLJZkUDBlH5JDZBjYa7DcEDt3cKvw6tlUtMNYAwidFErtfxZVyUJb VD9y7NT9QY9xinmqoHm4MgXx7oI7nhy02cLR9TLgE0Yf3+eyi2YvzQzPqEUYQUHZlsmp PA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgmc2hah8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Mar 2023 10:40:25 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32N9hvdm023491 for ; Thu, 23 Mar 2023 10:40:25 GMT Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgmc2hagf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:25 +0000 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32MNx1S7006800; Thu, 23 Mar 2023 10:40:22 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma03fra.de.ibm.com (PPS) with ESMTPS id 3pd4x662fq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:22 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32NAeJ0x44302640 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Mar 2023 10:40:19 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0A97F2004D; Thu, 23 Mar 2023 10:40:19 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 66EC320043; Thu, 23 Mar 2023 10:40:18 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 23 Mar 2023 10:40:18 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org, nrb@linux.ibm.com Cc: thuth@redhat.com, imbrenda@linux.ibm.com Subject: [kvm-unit-tests PATCH 6/8] s390x: uv-host: Fix create guest variable storage prefix check Date: Thu, 23 Mar 2023 10:39:11 +0000 Message-Id: <20230323103913.40720-7-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230323103913.40720-1-frankja@linux.ibm.com> References: <20230323103913.40720-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: zyTJ1Wh8Q3dRD0HAtuEnk8BJwdHGCSei X-Proofpoint-ORIG-GUID: yX-bgqXSyRgI8WKW8KbPQ2mDtjOfTvP- X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_21,2023-03-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 bulkscore=0 impostorscore=0 mlxscore=0 spamscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=999 phishscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303230080 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org We want more than one cpu and the rc is 10B, not 109. Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- s390x/uv-host.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/s390x/uv-host.c b/s390x/uv-host.c index 42ea2a53..d92571b5 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -434,11 +434,15 @@ static void test_config_create(void) "base storage origin contains lowcore"); uvcb_cgc.conf_base_stor_origin = tmp; - if (smp_query_num_cpus() == 1) { + /* + * Let's not make it too easy and use a second cpu to set a + * non-zero prefix. + */ + if (smp_query_num_cpus() > 1) { sigp_retry(1, SIGP_SET_PREFIX, uvcb_cgc.conf_var_stor_origin + PAGE_SIZE, NULL); rc = uv_call(0, (uint64_t)&uvcb_cgc); - report(uvcb_cgc.header.rc == 0x10e && rc == 1 && + report(uvcb_cgc.header.rc == 0x10b && rc == 1 && !uvcb_cgc.guest_handle, "variable storage area contains lowcore"); sigp_retry(1, SIGP_SET_PREFIX, 0x0, NULL); } From patchwork Thu Mar 23 10:39:12 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13185494 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 9E277C6FD1D for ; Thu, 23 Mar 2023 10:44:02 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231605AbjCWKoA (ORCPT ); Thu, 23 Mar 2023 06:44:00 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45776 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230402AbjCWKn1 (ORCPT ); Thu, 23 Mar 2023 06:43:27 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 169803B3C3 for ; Thu, 23 Mar 2023 03:40:28 -0700 (PDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32N9fqFl012681 for ; Thu, 23 Mar 2023 10:40:26 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=kEhPInzXBW0DTQjpzewSkyE6jdXSAatAYTYhUtMOGJ4=; b=lE3b4BWxbhyjjFeScApkx+L6ohTqHe/KbHqziUkbct9DfTGmj2miCK6DA6KP3OVipgb9 hflaoVSfMNIC86evP9dBqOif/KytL+C7fdBucVlFlZGQcVBarzmGUGa0J82BgzeLxeAB GdY2oK7ufzEXJtswazyel7JRhX70BZI30lUzMNlLcWaZtRkg5x0XRSFvvowy00RVwLDA 4AAIss++gyt34t+JAj3yROYUXClMypi7527dn6ylPrv4YnyKUAm7CcO01ESXnMqVPO8D dZZjWZCKhDX7jC9LZyvQtGB1HhcD4dJYM1+9EKLLCkWu+cfKz9CsNg0Sidk6fK1MxLoi 4w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgmc2hahj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Mar 2023 10:40:26 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32NAXGRU019057 for ; Thu, 23 Mar 2023 10:40:26 GMT Received: from ppma01fra.de.ibm.com (46.49.7a9f.ip4.static.sl-reverse.com [159.122.73.70]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgmc2hagt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:25 +0000 Received: from pps.filterd (ppma01fra.de.ibm.com [127.0.0.1]) by ppma01fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32MKG9nJ014689; Thu, 23 Mar 2023 10:40:23 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3pd4x6e1xq-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:23 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32NAeJcg28902012 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Mar 2023 10:40:19 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C50CA2004E; Thu, 23 Mar 2023 10:40:19 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3679620043; Thu, 23 Mar 2023 10:40:19 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 23 Mar 2023 10:40:19 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org, nrb@linux.ibm.com Cc: thuth@redhat.com, imbrenda@linux.ibm.com Subject: [kvm-unit-tests PATCH 7/8] s390x: uv-host: Properly handle config creation errors Date: Thu, 23 Mar 2023 10:39:12 +0000 Message-Id: <20230323103913.40720-8-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230323103913.40720-1-frankja@linux.ibm.com> References: <20230323103913.40720-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: LHUb_V1LqkX2I8uFuIgXCNsnVbZPJyZW X-Proofpoint-ORIG-GUID: T2vskfYMpEmBrJHh3pgajcvuR2YUWmlw X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_21,2023-03-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 adultscore=0 bulkscore=0 impostorscore=0 mlxscore=0 spamscore=0 malwarescore=0 priorityscore=1501 mlxlogscore=999 phishscore=0 suspectscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303230080 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org If the first bit is set on a error rc, the hypervisor will need to destroy the config before trying again. Let's properly handle those cases so we're not usign stale data. Signed-off-by: Janosch Frank --- lib/s390x/asm/uv.h | 1 + s390x/uv-host.c | 52 ++++++++++++++++++++++++++++++++++++++-------- 2 files changed, 44 insertions(+), 9 deletions(-) diff --git a/lib/s390x/asm/uv.h b/lib/s390x/asm/uv.h index 38920461..e9fb19af 100644 --- a/lib/s390x/asm/uv.h +++ b/lib/s390x/asm/uv.h @@ -24,6 +24,7 @@ #define UVC_RC_NO_RESUME 0x0007 #define UVC_RC_INV_GHANDLE 0x0020 #define UVC_RC_INV_CHANDLE 0x0021 +#define UVC_RC_DSTR_NEEDED_FLG 0x8000 #define UVC_CMD_QUI 0x0001 #define UVC_CMD_INIT_UV 0x000f diff --git a/s390x/uv-host.c b/s390x/uv-host.c index d92571b5..b23d51c9 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -370,6 +370,38 @@ static void test_cpu_create(void) report_prefix_pop(); } +/* + * If the first bit of the rc is set we need to destroy the + * configuration before testing other create config errors. + */ +static void cgc_destroy_if_needed(struct uv_cb_cgc *uvcb) +{ + uint16_t rc, rrc; + + if (!(uvcb->header.rc & UVC_RC_DSTR_NEEDED_FLG)) + return; + + assert(uvcb->guest_handle); + + assert(!uv_cmd_nodata(uvcb->guest_handle, UVC_CMD_DESTROY_SEC_CONF, + &rc, &rrc)); +} + +/* This function expects errors, not successes */ +static bool cgc_check_data(struct uv_cb_cgc *uvcb, uint16_t rc_expected) +{ + cgc_destroy_if_needed(uvcb); + /* + * We should only receive a handle when the rc is 1 or the + * first bit is set. + */ + if (!(uvcb->header.rc & UVC_RC_DSTR_NEEDED_FLG) && uvcb->guest_handle) + return false; + /* Now that we checked the handle, we need to zero it for the next test */ + uvcb->guest_handle = 0; + return (uvcb->header.rc & ~UVC_RC_DSTR_NEEDED_FLG) == rc_expected; +} + static void test_config_create(void) { int rc; @@ -398,40 +430,40 @@ static void test_config_create(void) uvcb_cgc.guest_stor_origin = uvcb_qui.max_guest_stor_addr + (1UL << 20) * 2 + 1; rc = uv_call(0, (uint64_t)&uvcb_cgc); - report(uvcb_cgc.header.rc == 0x101 && rc == 1, + report(cgc_check_data(&uvcb_cgc, 0x101) && rc == 1, "MSO > max guest addr"); uvcb_cgc.guest_stor_origin = 0; uvcb_cgc.guest_stor_origin = uvcb_qui.max_guest_stor_addr - (1UL << 20); rc = uv_call(0, (uint64_t)&uvcb_cgc); - report(uvcb_cgc.header.rc == 0x102 && rc == 1, + report(cgc_check_data(&uvcb_cgc, 0x102) && rc == 1, "MSO + MSL > max guest addr"); uvcb_cgc.guest_stor_origin = 0; uvcb_cgc.guest_asce &= ~ASCE_P; rc = uv_call(0, (uint64_t)&uvcb_cgc); - report(uvcb_cgc.header.rc == 0x105 && rc == 1, + report(cgc_check_data(&uvcb_cgc, 0x105) && rc == 1, "ASCE private bit missing"); uvcb_cgc.guest_asce |= ASCE_P; uvcb_cgc.guest_asce |= 0x20; rc = uv_call(0, (uint64_t)&uvcb_cgc); - report(uvcb_cgc.header.rc == 0x105 && rc == 1, + report(cgc_check_data(&uvcb_cgc, 0x105) && rc == 1, "ASCE bit 58 set"); uvcb_cgc.guest_asce &= ~0x20; tmp = uvcb_cgc.conf_base_stor_origin; uvcb_cgc.conf_base_stor_origin = get_max_ram_size() + 8; rc = uv_call(0, (uint64_t)&uvcb_cgc); - report(uvcb_cgc.header.rc == 0x108 && rc == 1, + report(cgc_check_data(&uvcb_cgc, 0x108) && rc == 1, "base storage origin > available memory"); uvcb_cgc.conf_base_stor_origin = tmp; tmp = uvcb_cgc.conf_base_stor_origin; uvcb_cgc.conf_base_stor_origin = 0x1000; rc = uv_call(0, (uint64_t)&uvcb_cgc); - report(uvcb_cgc.header.rc == 0x109 && rc == 1, - "base storage origin contains lowcore"); + report(cgc_check_data(&uvcb_cgc, 0x109) && rc == 1, + "base storage origin contains lowcore %x", uvcb_cgc.header.rc); uvcb_cgc.conf_base_stor_origin = tmp; /* @@ -450,14 +482,14 @@ static void test_config_create(void) tmp = uvcb_cgc.guest_sca; uvcb_cgc.guest_sca = 0; rc = uv_call(0, (uint64_t)&uvcb_cgc); - report(uvcb_cgc.header.rc == 0x10c && rc == 1, + report(cgc_check_data(&uvcb_cgc, 0x10c) && rc == 1, "sca == 0"); uvcb_cgc.guest_sca = tmp; tmp = uvcb_cgc.guest_sca; uvcb_cgc.guest_sca = get_max_ram_size() + PAGE_SIZE * 4; rc = uv_call(0, (uint64_t)&uvcb_cgc); - report(uvcb_cgc.header.rc == 0x10d && rc == 1, + report(cgc_check_data(&uvcb_cgc, 0x10d) && rc == 1, "sca inaccessible"); uvcb_cgc.guest_sca = tmp; @@ -477,6 +509,7 @@ static void test_config_create(void) uvcb_cgc.guest_handle = 0; rc = uv_call(0, (uint64_t)&uvcb_cgc); report(uvcb_cgc.header.rc >= 0x100 && rc == 1, "reuse uvcb"); + cgc_destroy_if_needed(&uvcb_cgc); uvcb_cgc.guest_handle = tmp; /* Copy over most data from uvcb_cgc, so we have the ASCE that was used. */ @@ -494,6 +527,7 @@ static void test_config_create(void) rc = uv_call(0, (uint64_t)&uvcb); report(uvcb.header.rc >= 0x104 && rc == 1 && !uvcb.guest_handle, "reuse ASCE"); + cgc_destroy_if_needed(&uvcb); free((void *)uvcb.conf_base_stor_origin); free((void *)uvcb.conf_var_stor_origin); From patchwork Thu Mar 23 10:39:13 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13185492 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 258C5C76195 for ; Thu, 23 Mar 2023 10:43:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231397AbjCWKn4 (ORCPT ); Thu, 23 Mar 2023 06:43:56 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45630 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231201AbjCWKn1 (ORCPT ); Thu, 23 Mar 2023 06:43:27 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D2C0159F4 for ; Thu, 23 Mar 2023 03:40:28 -0700 (PDT) Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 32N9oNnS026483 for ; Thu, 23 Mar 2023 10:40:26 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=BqwhAQtD8u7fdukYUz6qnkSPf+czkiCxB6OsRDwqtkU=; b=PoGNp9g/d/JMzGRMvFH7Yjr6K75/lhWLEyd/y1tUyoaunxat8v1mLpyeN8YKtkNzg70x F6H1ffcZBASO/9RPvHL8CBMUvYSA6skEeRmOKrUVuLeuEHuMYnOPfLnGgKLvaOgHuYGT dhCeMhdzrJR/lj7Eql5whD2ve/3FzJKIVZuFBDDSdbWS7eLzIk1k3lg2il3ezkiRFvUV LbnsxKWFgHCSUE3zXAyGHqsCpnCmpMN3AsEpFfC7xTxOEqmNRuHtEXLAy90wf6SqxPWn OrJr2k5zEM+Q89O3hMjrjChb3QNhpvfoZPjSlXfgmlwp9cIYBmv3zLkkrB88Z7GBQeKy gg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3pgmg6h60t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 23 Mar 2023 10:40:26 +0000 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 32NAQN9q009490 for ; Thu, 23 Mar 2023 10:40:26 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 3pgmg6h60e-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:26 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 32N8aKEl015024; Thu, 23 Mar 2023 10:40:24 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3pd4jff7nn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 23 Mar 2023 10:40:24 +0000 Received: from smtpav03.fra02v.mail.ibm.com (smtpav03.fra02v.mail.ibm.com [10.20.54.102]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 32NAeKpI14680784 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 23 Mar 2023 10:40:20 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 93CA72004B; Thu, 23 Mar 2023 10:40:20 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id F05C720043; Thu, 23 Mar 2023 10:40:19 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 23 Mar 2023 10:40:19 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org, nrb@linux.ibm.com Cc: thuth@redhat.com, imbrenda@linux.ibm.com Subject: [kvm-unit-tests PATCH 8/8] s390x: uv-host: Fence access checks when UV debug is enabled Date: Thu, 23 Mar 2023 10:39:13 +0000 Message-Id: <20230323103913.40720-9-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230323103913.40720-1-frankja@linux.ibm.com> References: <20230323103913.40720-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: p42JaA6WmrbTAh0ZXzswzka31cdgrIt5 X-Proofpoint-ORIG-GUID: ob3tDpE3qk5yePHQLBWRboOzI322ASdZ X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.942,Hydra:6.0.573,FMLib:17.11.170.22 definitions=2023-03-22_21,2023-03-22_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 mlxlogscore=999 adultscore=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 spamscore=0 phishscore=0 bulkscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303150002 definitions=main-2303230080 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The debug print directly accesses the UV header which will result in a second accesses exception which will abort the test. Let's fence the access tests instead. Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- s390x/uv-host.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/s390x/uv-host.c b/s390x/uv-host.c index b23d51c9..1f73034f 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -164,6 +164,15 @@ static void test_access(void) report_prefix_push("access"); + /* + * If debug is enabled info from the uv header is printed + * which would lead to a second exception and a test abort. + */ + if (UVC_ERR_DEBUG) { + report_skip("Debug doesn't work with access tests"); + goto out; + } + report_prefix_push("non-crossing"); protect_page(uvcb, PAGE_ENTRY_I); for (i = 0; cmds[i].name; i++) { @@ -196,6 +205,7 @@ static void test_access(void) uvcb += 1; unprotect_page(uvcb, PAGE_ENTRY_I); +out: free_pages(pages); report_prefix_pop(); }