Received: by 2002:a05:6358:f14:b0:e5:3b68:ec04 with SMTP id b20csp2768140rwj; Mon, 19 Dec 2022 08:37:01 -0800 (PST) X-Google-Smtp-Source: AA0mqf4VtMQatebCIgoT2YbLZNGv2ryeztntN8aa7dWJz+Zj4Z2Bv+/B0EE+GOnUTA4tv0Qn3uJF X-Received: by 2002:a17:902:cf07:b0:186:8c44:1718 with SMTP id i7-20020a170902cf0700b001868c441718mr49269349plg.52.1671467821178; Mon, 19 Dec 2022 08:37:01 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1671467821; cv=none; d=google.com; s=arc-20160816; b=MQIpSdqu8+YwB7lznORiXRhDhBq7x0KMHbx3aAq5TQ+7R3lRapWPZPijEu12bjjtnI zeOpDQv056oHoLhVf3cgJVBcOs+vOf+LkZ9VOhDZ75xC0rLnZju+lslQMFPERpKtugJo 1UDczzR0eKPMh9jOkR/yuWG36HApnDmdl59CD1kjsZ0AWlsFx/dMw28BWK4hzwx1I7+H /R3jBFyp5duwtZghLf0xj5KOCWYrfE/jOl2KxLsAtS88r33O0rGdoydytQuGSh31hV17 w7zMq1n+iiEsmV0IqL0ptxVTg3s5GDR8An0jxjKrMNjDl0QZa1jtUqSfprPneZAe6BZF WjBA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:user-agent :content-transfer-encoding:references:in-reply-to:date:cc:to:from :subject:message-id:dkim-signature; bh=ZsydaWwORy2lc4YtcUfyBIIbjUIfDmjxIjEgD4QMMpg=; b=uH2h4mMHkNEsEJK7yU5XZkXzFAqOo7NPggLVF3fsbWiJ/U69n5VPcp9587ooJdH9t3 em4gry47+PuIhzKg9qo3/5aaHzlX8g9GDTjE6WPu5oe/I1eiiD8i+sJkQhU0XI81ALAI kGHPCM6DbMOT5ISDbqx8YjrdHvkYC3yKUOCjcPh0KKEKL9Aw4NU3CqYQALhrPnCipJXn NB52OwCmOPMaOrWn8CQ5AvaTxYAA6UoTAFJWNcAy2yw6Nz+TOT7b593uvyYGSjRr34qq RKlCJiFQaepl3Jkj2CFUcyiPfhHeyvDtN9ck5pHP3WpFj82zLQ5yJ1WSRiFtGaWqGhm0 Hoaw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=tZCi6XA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i3-20020a170902e48300b0018659963cdcsi10301437ple.514.2022.12.19.08.36.49; Mon, 19 Dec 2022 08:37:01 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=tZCi6XA9; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231783AbiLSQOU (ORCPT + 70 others); Mon, 19 Dec 2022 11:14:20 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49150 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231812AbiLSQOC (ORCPT ); Mon, 19 Dec 2022 11:14:02 -0500 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A6EE2DF46; Mon, 19 Dec 2022 08:14:01 -0800 (PST) Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2BJGD177026411; Mon, 19 Dec 2022 16:13:51 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : content-transfer-encoding : mime-version; s=pp1; bh=ZsydaWwORy2lc4YtcUfyBIIbjUIfDmjxIjEgD4QMMpg=; b=tZCi6XA9crFra2SZQSW+VcfqM0OcrCkWB6INgwJR3EUetKUUt/meawuj7CrJsz2uzmNE tRYyXu269XALwp6F8eil82lFFGqkZt4zJdWlseSurxzuLZIlCV86/2x9MyshgU1LWprp wI7RM42L4ZP5BEyq/wN5rttLFdRdnbvc4hL5tNsWaOStGRQdrVUUdVSsPmSM5Tj9/Hrr 36wmTP7o2GDIiAM0yImHilpZClgnAGhkRZ1IZ7chXyFnzfvOoZvPRr4aClFrlgFQSU68 YVyLv3C9KSybNlKHNpJjhMq5dmzCtfJcGINV+tn6gdYqYmZjgrbp0IfH/knZs3VqNky6 /g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mju9eg3fu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Dec 2022 16:13:47 +0000 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2BJGDBA9028467; Mon, 19 Dec 2022 16:13:42 GMT Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3mju9eg2u0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Dec 2022 16:13:42 +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 2BJE7c6s024486; Mon, 19 Dec 2022 16:13:24 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3mh6ywjsym-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Dec 2022 16:13:24 +0000 Received: from smtpav07.fra02v.mail.ibm.com (smtpav07.fra02v.mail.ibm.com [10.20.54.106]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2BJGDLrK25559646 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Dec 2022 16:13:21 GMT Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 051062004E; Mon, 19 Dec 2022 16:13:21 +0000 (GMT) Received: from smtpav07.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9ACC620040; Mon, 19 Dec 2022 16:13:20 +0000 (GMT) Received: from li-7e0de7cc-2d9d-11b2-a85c-de26c016e5ad.ibm.com (unknown [9.171.170.124]) by smtpav07.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 19 Dec 2022 16:13:20 +0000 (GMT) Message-ID: Subject: Re: [PATCH v4 5/9] KVM: s390: selftest: memop: Move testlist into main From: Janis Schoetterl-Glausch To: Christian Borntraeger , Janosch Frank , Claudio Imbrenda , Heiko Carstens , Vasily Gorbik , Alexander Gordeev Cc: David Hildenbrand , Jonathan Corbet , kvm@vger.kernel.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-s390@vger.kernel.org, Paolo Bonzini , Shuah Khan , Sven Schnelle , Thomas Huth Date: Mon, 19 Dec 2022 17:13:20 +0100 In-Reply-To: <20221213165405.2953539-6-scgl@linux.ibm.com> References: <20221213165405.2953539-1-scgl@linux.ibm.com> <20221213165405.2953539-6-scgl@linux.ibm.com> Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable User-Agent: Evolution 3.46.2 (3.46.2-1.fc37) MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: NATjA8NPGe-CT4G3UaXDW_WsM-6vcUjA X-Proofpoint-GUID: LZKs_1CA8sNAPc1PXH-HZy3FrXVqtTCy X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.923,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-12-19_01,2022-12-15_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 mlxscore=0 bulkscore=0 clxscore=1015 suspectscore=0 priorityscore=1501 phishscore=0 spamscore=0 mlxlogscore=999 adultscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2212070000 definitions=main-2212190142 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, 2022-12-13 at 17:54 +0100, Janis Schoetterl-Glausch wrote: > This allows checking if the necessary requirements for a test case are > met via an arbitrary expression. In particular, it is easy to check if > certain bits are set in the memop extension capability. >=20 > Signed-off-by: Janis Schoetterl-Glausch > Reviewed-by: Thomas Huth > --- > tools/testing/selftests/kvm/s390x/memop.c | 132 +++++++++++----------- > 1 file changed, 66 insertions(+), 66 deletions(-) >=20 > diff --git a/tools/testing/selftests/kvm/s390x/memop.c b/tools/testing/se= lftests/kvm/s390x/memop.c > index 286185a59238..10f34c629cac 100644 > --- a/tools/testing/selftests/kvm/s390x/memop.c > +++ b/tools/testing/selftests/kvm/s390x/memop.c > @@ -690,87 +690,87 @@ static void test_errors(void) > kvm_vm_free(t.kvm_vm); > } > =20 [...] > =20 > int main(int argc, char *argv[]) > { > int extension_cap, idx; > =20 > + setbuf(stdout, NULL); /* Tell stdout not to buffer its content */ > TEST_REQUIRE(kvm_has_cap(KVM_CAP_S390_MEM_OP)); > + extension_cap =3D kvm_check_cap(KVM_CAP_S390_MEM_OP_EXTENSION); > =20 [...] > =20 > ksft_print_header(); > - > ksft_set_plan(ARRAY_SIZE(testlist)); > =20 > - extension_cap =3D kvm_check_cap(KVM_CAP_S390_MEM_OP_EXTENSION); > for (idx =3D 0; idx < ARRAY_SIZE(testlist); idx++) { > - if (extension_cap >=3D testlist[idx].extension) { > + if (testlist[idx].requirements_met) { > testlist[idx].test(); > ksft_test_result_pass("%s\n", testlist[idx].name); > } else { > - ksft_test_result_skip("%s - extension level %d not supported\n", > - testlist[idx].name, > - testlist[idx].extension); > + ksft_test_result_skip("%s - requirements not met (kernel has extensio= n cap %#x\n)", = oops, should be )\n ofc ^ > + testlist[idx].name, extension_cap); > } > } > =20