From patchwork Thu Jun 22 07:50:50 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13288359 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 C7C02EB64DA for ; Thu, 22 Jun 2023 07:53:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230304AbjFVHxQ (ORCPT ); Thu, 22 Jun 2023 03:53:16 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52390 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230283AbjFVHxO (ORCPT ); Thu, 22 Jun 2023 03:53:14 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id DF9F71FEF; Thu, 22 Jun 2023 00:53:01 -0700 (PDT) Received: from pps.filterd (m0356517.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35M7n0Xq026252; Thu, 22 Jun 2023 07:52:58 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=xWXCOLTLmvwhytTTEKRq+qUB8Mpxif6XHEiNSuMb8X0=; b=IWPeZ6QbkE3Y92f76vvytdNXv+NtAvKl4eW7mr8iK32K8IaLpP3pAA+yCVn3edwA0dHf i5Yxphxg80EgkYgVWWimcrVW+Al/vLP37Qs+8IaR1BCXow5t9JVKJsDYVu9ICl8948D6 FMuqGIAmILPY9sAEqOZ0UXGW9l9SmBvAjrOCcEUFpO98AIpV1lM4KsJi2Igcytpj8oDE oNavI2hCdWuqZpZ0+hKOOl1GQYV7wGuFZGVUhHi3K6eqIGlVywI3ksaIvjs0KeJ8cxjm PkZ3oqxw8cqEULgA9qTlxG/MXlZ3rCsSw7xY70lhxefHnkwjSf3S+TzCTSfkHP3+GH/X ZQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rchyj8kax-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jun 2023 07:52:57 +0000 Received: from m0356517.ppops.net (m0356517.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35M7VF18022209; Thu, 22 Jun 2023 07:52:57 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 3rchyj8ka3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jun 2023 07:52:57 +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 35M4mn94025143; Thu, 22 Jun 2023 07:52:07 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3r94f5baqy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Jun 2023 07:52:07 +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 35M7q37f18481856 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Jun 2023 07:52:03 GMT Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AA5A72004E; Thu, 22 Jun 2023 07:52:03 +0000 (GMT) Received: from smtpav03.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D76E02004D; Thu, 22 Jun 2023 07:52:02 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav03.fra02v.mail.ibm.com (Postfix) with ESMTP; Thu, 22 Jun 2023 07:52:02 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, nsg@linux.ibm.com, nrb@linux.ibm.com Subject: [kvm-unit-tests PATCH v4 4/8] s390x: uv-host: Add cpu number check to test_init Date: Thu, 22 Jun 2023 07:50:50 +0000 Message-Id: <20230622075054.3190-5-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230622075054.3190-1-frankja@linux.ibm.com> References: <20230622075054.3190-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: gAOhkFEU43sbuoHNasFkIZIa-OLS7aZC X-Proofpoint-ORIG-GUID: -4U5pqfesjUUDXi8I0YgwY9SoUvOrGw0 X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.254,Aquarius:18.0.957,Hydra:6.0.591,FMLib:17.11.176.26 definitions=2023-06-22_04,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 priorityscore=1501 mlxscore=0 mlxlogscore=999 bulkscore=0 adultscore=0 suspectscore=0 phishscore=0 impostorscore=0 clxscore=1015 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306220062 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 08ef266a..c04cdd73 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -550,11 +550,15 @@ static void test_init(void) "storage below 2GB"); uvcb_init.stor_origin = tmp; - 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");