From patchwork Tue May 2 13:07:24 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13228921 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 C29C6C77B7E for ; Tue, 2 May 2023 13:22:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233994AbjEBNWq (ORCPT ); Tue, 2 May 2023 09:22:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55264 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbjEBNWp (ORCPT ); Tue, 2 May 2023 09:22:45 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2F2645FC2; Tue, 2 May 2023 06:22:44 -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 342DJfSG013512; Tue, 2 May 2023 13:22:43 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=GPj7esa3htFjLmzvuBdpb5S4onKRLFu5wCFEevGTd0A=; b=NPTUNrDSmIEqWtBjBAiu6fhdlny/nS20vsdwwU2h8apUn3v/NFMw0aLaPVvW+xcdOsvd E7L30eB8d63E7/5UXGa0HqTij9mzHzx3eGVC1mrO8O4fYd3PRbXMmFmwbznlpg4avphb m6l6okDWKyd1A1siY4cr9GI4ch0kphlkA/caZq1rmSRiksZRk7BfUrnYUzpy2kTZ66Zt YBBYF5Mrb2Ni9IHk/En73+/YVUuHBibXbrLRSJNGXX485hyyceMHXP9FAkNydjIK1Ql/ zZFhfIoyRpUfSUQYr+4co41FhK6yF6/BdLnH4Si8dXvh1dIt1Lih60UYsyYcmHiEemAS zw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2ge1wwc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:22:42 +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 342DJoYC014335; Tue, 2 May 2023 13:22:03 GMT Received: from ppma04fra.de.ibm.com (6a.4a.5195.ip4.static.sl-reverse.com [149.81.74.106]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2ge1vvf-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:22:03 +0000 Received: from pps.filterd (ppma04fra.de.ibm.com [127.0.0.1]) by ppma04fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3427bGlO024730; Tue, 2 May 2023 13:09:23 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma04fra.de.ibm.com (PPS) with ESMTPS id 3q8tv6hatn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:22 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 342D9JHv58851762 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 May 2023 13:09:19 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 419862004D; Tue, 2 May 2023 13:09:19 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 71F6D20040; Tue, 2 May 2023 13:09:18 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 2 May 2023 13:09:18 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, nrb@linux.ibm.com, david@redhat.com Subject: [kvm-unit-tests PATCH v3 1/9] s390x: uv-host: Fix UV init test memory allocation Date: Tue, 2 May 2023 13:07:24 +0000 Message-Id: <20230502130732.147210-2-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230502130732.147210-1-frankja@linux.ibm.com> References: <20230502130732.147210-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Gi210xGjbPHUgpGwgc7XPk_ziicMLjtP X-Proofpoint-ORIG-GUID: CRSPEuYmyYS2c69laUW7YQmgflcnUSIN 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-05-02_08,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 suspectscore=0 lowpriorityscore=0 impostorscore=0 mlxlogscore=999 malwarescore=0 clxscore=1015 priorityscore=1501 mlxscore=0 adultscore=0 phishscore=0 bulkscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305020111 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. Also the second block of memory was never actually used for the double init test since its address is never put into the uvcb. Let's fix that. Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- s390x/uv-host.c | 23 ++++++++++++++--------- 1 file changed, 14 insertions(+), 9 deletions(-) diff --git a/s390x/uv-host.c b/s390x/uv-host.c index 33e6eec6..9dfaebd7 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -500,14 +500,17 @@ static void test_config_create(void) static void test_init(void) { int rc; - uint64_t mem; + uint64_t tmp; - /* Donated storage needs to be over 2GB */ - mem = (uint64_t)memalign_pages_flags(SZ_1M, uvcb_qui.uv_base_stor_len, AREA_NORMAL); + /* + * Donated storage needs to be over 2GB, AREA_NORMAL does that + * on s390x. + */ + tmp = (uint64_t)memalign_pages_flags(SZ_1M, uvcb_qui.uv_base_stor_len, AREA_NORMAL); uvcb_init.header.len = sizeof(uvcb_init); uvcb_init.header.cmd = UVC_CMD_INIT_UV; - uvcb_init.stor_origin = mem; + uvcb_init.stor_origin = tmp; uvcb_init.stor_len = uvcb_qui.uv_base_stor_len; report_prefix_push("init"); @@ -528,14 +531,14 @@ static void test_init(void) rc = uv_call(0, (uint64_t)&uvcb_init); report(rc == 1 && (uvcb_init.header.rc == 0x104 || uvcb_init.header.rc == 0x105), "storage origin invalid"); - uvcb_init.stor_origin = mem; + uvcb_init.stor_origin = tmp; if (uvcb_init.stor_len >= HPAGE_SIZE) { uvcb_init.stor_origin = get_max_ram_size() - HPAGE_SIZE; rc = uv_call(0, (uint64_t)&uvcb_init); report(rc == 1 && uvcb_init.header.rc == 0x105, "storage + length invalid"); - uvcb_init.stor_origin = mem; + uvcb_init.stor_origin = tmp; } else { report_skip("storage + length invalid, stor_len < HPAGE_SIZE"); } @@ -544,7 +547,7 @@ static void test_init(void) rc = uv_call(0, (uint64_t)&uvcb_init); report(rc == 1 && uvcb_init.header.rc == 0x108, "storage below 2GB"); - uvcb_init.stor_origin = mem; + uvcb_init.stor_origin = tmp; smp_cpu_setup(1, PSW_WITH_CUR_MASK(cpu_loop)); rc = uv_call(0, (uint64_t)&uvcb_init); @@ -555,10 +558,12 @@ 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); + tmp = uvcb_init.stor_origin; + uvcb_init.stor_origin = (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); + free((void *)uvcb_init.stor_origin); + uvcb_init.stor_origin = tmp; report_prefix_pop(); } From patchwork Tue May 2 13:07:25 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13228917 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 E8253C77B73 for ; Tue, 2 May 2023 13:14:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234023AbjEBNO6 (ORCPT ); Tue, 2 May 2023 09:14:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52232 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233018AbjEBNO4 (ORCPT ); Tue, 2 May 2023 09:14:56 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AD0CBE4D; Tue, 2 May 2023 06:14:55 -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 342D8WLf011697; Tue, 2 May 2023 13:14: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=YRyBzNqnnynE+z107Ep0FeJ+iML5TzKShPDIZWT8ouI=; b=JUNFadRJQjo7Sd91cxGEkaKOnChcOt32j91XihFdD5etl79OkdCTaPcMbx1UP2WwZvTe 5yvzpoO7QfgEzcY4CAkq5FpCZCs+aeImMJxZdIJ5NAJSlcoGHO5REAy3IRcOpiIvAKgX H00ScV6fPXgARiQpB64DqttTyc1m/kST6JEzg6IZTG+3WCx2iyOfWsq0+UdyZI8ELw9E 9jyxCSNCsBWBZWn5WzS4/W3anjh+yRnNayFvlDtaxJLWQ3CaOpsq2QcJ4K+bK1VuMs1U 1lsPqnQwwE09X0PO0lJGf0dC3/fkUhHRBgnvOJRFj1ihtnHIvKSf08ZaMulub3liaYR5 UQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2s394nd-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:14:54 +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 342D8d7P011990; Tue, 2 May 2023 13:14:32 GMT Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2s394gp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:14:32 +0000 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.17.1.19/8.17.1.19) with ESMTP id 3427Ybht001893; Tue, 2 May 2023 13:09:24 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma05fra.de.ibm.com (PPS) with ESMTPS id 3q8tv6har6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:23 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 342D9KOL34341296 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 May 2023 13:09:20 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 48E2D20040; Tue, 2 May 2023 13:09:20 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6F8D520049; Tue, 2 May 2023 13:09:19 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 2 May 2023 13:09:19 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, nrb@linux.ibm.com, david@redhat.com Subject: [kvm-unit-tests PATCH v3 2/9] s390x: uv-host: Check for sufficient amount of memory Date: Tue, 2 May 2023 13:07:25 +0000 Message-Id: <20230502130732.147210-3-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230502130732.147210-1-frankja@linux.ibm.com> References: <20230502130732.147210-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: Vl1fyEUE3i1a7yLLW3A0w6U92Dyo26GZ X-Proofpoint-GUID: s-MoTJPofgXyjwoQsjDj2UtjYtvVZ8oi 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-05-02_08,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 suspectscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305020111 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 | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/s390x/uv-host.c b/s390x/uv-host.c index 9dfaebd7..34ca7148 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -15,6 +15,7 @@ #include #include #include +#include #include #include #include @@ -720,6 +721,13 @@ int main(void) test_invalid(); test_uv_uninitialized(); test_query(); + + if (get_ram_size() < SNIPPET_PV_MIN_MEM_SIZE) { + report_skip("Not enough memory. This test needs about %ld MB of memory", + SNIPPET_PV_MIN_MEM_SIZE / 1024 / 1024); + goto done; + } + test_init(); setup_vmem(); From patchwork Tue May 2 13:07:26 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13228911 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 A795FC77B73 for ; Tue, 2 May 2023 13:10:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234036AbjEBNKD (ORCPT ); Tue, 2 May 2023 09:10:03 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234179AbjEBNJp (ORCPT ); Tue, 2 May 2023 09:09:45 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3612655AE; Tue, 2 May 2023 06:09:44 -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 342D8pTN018242; Tue, 2 May 2023 13:09: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=33YtdrKs9YjiCF3eXFJd5sVjCUC7Qew+md1A2eAteLc=; b=WLyJyS7TicNk6Ex8DZviBEgRrjUfZTA0SNkG+vLFBZVI/B9qtylhFkKt8uvruxmBmBOb 3cip+oq+6+cTcsILYh6ELLbIbBncLHru7alwRGi+TzLCGA9jnbB0m/VaQ8SafUbrDhvr DYmj6L/til0Jgx/G5hmK6AfJ8pkF64fYzeGwCUIZ2O9ueG3DP7v95M89srd3xuZYfQ/O PkfHpZ+lQBXRfoM9g7GeADDaCoSBcArZVW+bxUzUqS9ofLV6DZFu46Wr/QNb/rh/RtwL W8oENUTjbSIOSg7dMxJd2SHyYjwGS7+0bqJyiHyhWsJV8QrvVIuw0UojPxagd/EOLLoq tA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2xv8bwy-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:42 +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 342D9aVd026343; Tue, 2 May 2023 13:09:36 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 3qb2xv8baa-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:35 +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 3427ahQ0004301; Tue, 2 May 2023 13:09:25 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3q8tv6sajc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:24 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 342D9LI554722854 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 May 2023 13:09:21 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 4FB4A2004D; Tue, 2 May 2023 13:09:21 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 76DE020040; Tue, 2 May 2023 13:09:20 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 2 May 2023 13:09:20 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, nrb@linux.ibm.com, david@redhat.com Subject: [kvm-unit-tests PATCH v3 3/9] s390x: uv-host: Beautify code Date: Tue, 2 May 2023 13:07:26 +0000 Message-Id: <20230502130732.147210-4-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230502130732.147210-1-frankja@linux.ibm.com> References: <20230502130732.147210-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: fl01rQCWM9LWCFVBEfF1oT69Q6dYStmO X-Proofpoint-ORIG-GUID: APwxQ_-dwITK90o8Upkq5n4YoqbWGekM 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-05-02_08,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 phishscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305020111 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 34ca7148..1c04d8ef 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 * @@ -34,7 +34,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 Tue May 2 13:07:27 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13228920 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 EEDD6C77B7E for ; Tue, 2 May 2023 13:21:26 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233998AbjEBNVZ (ORCPT ); Tue, 2 May 2023 09:21:25 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54760 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229533AbjEBNVX (ORCPT ); Tue, 2 May 2023 09:21:23 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EBB195B87; Tue, 2 May 2023 06:21:22 -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 342DL3Rd017183; Tue, 2 May 2023 13:21: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=BeuSG80lhZzAxm+xgPSCu6jB8z0XOAYkfECOi77WbmE=; b=Xnx0YFRjXkUEVxuApD3uhHGHZv1VR22bwQ+vCrR8qgrQ8FAA9+d3JlLNkGuuKDMQ54Av EakoaaWtv5inPuwx0zBO5f57N/WNPVEjiKXR+2IeFjP+VuKzssYsq4Nll8B1bCynCpbu jmTV+4LvmmKiyPM5NENJIuGpNj0ciOkOfcK4NeSyl1CUTkUYDBc1Ab10sAgwhz+ZwxWS B8QBPdYDXWUM3k7rjOo+FXAkMBhJDJ9+nYoJ1mo0vuCzyGYXSneYyC8DFjsIoPn+Hvr5 pCO7cHpThuvEJZk1aAv6jWIeCd4/rIENmlxBxmgAHaDUj5SSZyaBdC8LkjmSHRnZerj8 6Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2gpsrvn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:21:20 +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 342DHc6C029300; Tue, 2 May 2023 13:21:18 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 3qb2gpsrq2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:21:18 +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 3424qtb1008357; Tue, 2 May 2023 13:09:26 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma02fra.de.ibm.com (PPS) with ESMTPS id 3q8tv6sb4q-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:25 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 342D9Msm22807080 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 May 2023 13:09:22 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 56CA02004E; Tue, 2 May 2023 13:09:22 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7DB9820040; Tue, 2 May 2023 13:09:21 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 2 May 2023 13:09:21 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, nrb@linux.ibm.com, david@redhat.com Subject: [kvm-unit-tests PATCH v3 4/9] s390x: uv-host: Add cpu number check Date: Tue, 2 May 2023 13:07:27 +0000 Message-Id: <20230502130732.147210-5-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230502130732.147210-1-frankja@linux.ibm.com> References: <20230502130732.147210-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: IP9y3BeLx-WkM5uJt01b58a2SHpWCfwr X-Proofpoint-ORIG-GUID: Sf7GsTMmiBNEonwemCFODnmksqHILicC 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-05-02_08,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 suspectscore=0 malwarescore=0 mlxscore=0 bulkscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 phishscore=0 adultscore=0 clxscore=1015 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305020111 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 1c04d8ef..ed13bc26 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"); From patchwork Tue May 2 13:07:28 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13228914 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 15A24C77B73 for ; Tue, 2 May 2023 13:10:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234238AbjEBNKI (ORCPT ); Tue, 2 May 2023 09:10:08 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48088 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234357AbjEBNJ4 (ORCPT ); Tue, 2 May 2023 09:09:56 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4F8A64C2B; Tue, 2 May 2023 06:09:51 -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 342D8WCZ011697; Tue, 2 May 2023 13:09:51 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=1OUmKs5VL52vbRfptALljcen1bdUL/RIBJZUc2nU2pM=; b=sqjSX0g7lF7uo92RITnJOR2xWgCz/mz7lYNACkd3zC6j5578nkYCuHVHt6VXbm1QqUO6 aVLWc5gB4GBiEVGkAUOhRzsolpiOHnS8SQwnBmyiskhjZOUg3GRg2BZI8zQA+ssNcc7c 5QTZp6UOlj5tub7lcoVnrLRr1/NFKE/g9kBcCS4TQkhpc3MzQc7SnllirxUsxLb+6Gzb U2+pmOxgWTHvf22h8/otQNr6svTF9tJ4R3iT4xck7NbVnzTwQ33t6biZTADX49qr+pQC 7BiytoV5ZnFXRyBA0pVubmSsmUxiFH4J3B3pWgWgyNQqu3ANjemDdn9nV9s5p4rZJJx5 Eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2s38vh7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:50 +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 342D8mlH013144; Tue, 2 May 2023 13:09:40 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 3qb2s38uyn-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:40 +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 3424iEl6021182; Tue, 2 May 2023 13:09:27 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3q8tgg1m22-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:26 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 342D9NoX31916518 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 May 2023 13:09:23 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5E53B20040; Tue, 2 May 2023 13:09:23 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8491F2004B; Tue, 2 May 2023 13:09:22 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 2 May 2023 13:09:22 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, nrb@linux.ibm.com, david@redhat.com Subject: [kvm-unit-tests PATCH v3 5/9] s390x: uv-host: Fix create guest variable storage prefix check Date: Tue, 2 May 2023 13:07:28 +0000 Message-Id: <20230502130732.147210-6-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230502130732.147210-1-frankja@linux.ibm.com> References: <20230502130732.147210-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: 9gqARtqhZZ2pC3UM7a6o0AuA9oRzZv6l X-Proofpoint-GUID: nX03fXNQC_kTccWBvIATnkodLLLjsYPP 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-05-02_08,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 lowpriorityscore=0 phishscore=0 priorityscore=1501 malwarescore=0 bulkscore=0 suspectscore=0 spamscore=0 clxscore=1015 mlxscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305020111 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 ed13bc26..0048a19f 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -435,11 +435,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 Tue May 2 13:07:29 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13228918 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 3C4A0C7EE24 for ; Tue, 2 May 2023 13:15:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233919AbjEBNO7 (ORCPT ); Tue, 2 May 2023 09:14:59 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52234 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230426AbjEBNO4 (ORCPT ); Tue, 2 May 2023 09:14:56 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D0ABA4C2B; Tue, 2 May 2023 06:14:55 -0700 (PDT) Received: from pps.filterd (m0353727.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 342DD4W9031070; Tue, 2 May 2023 13:14: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=RXcHrG7/krC9/ByvYXXiF32Ernx8UTybrzn8umTWjXM=; b=D8sKisfdmc5k7IMaBrAK5CdFPgbrLIoTiek8PPXXx1jJcl1ODqbA3Jv/BCnuFGpZQljB qsZFmlX2s8X/QNgJK52lJU19GTILnQqf5I35OlsVWk6SgzsYBPNYdDXudM5fnthnxB0F 3rh3a489okeHrXZkc3UPZ8JYPVIara+IYIuQplM/4E0EFTs12Hcz9YugtSlFTMVXmU5F 7t3N5HRsGbws527QNgPmO5b80PS9Tyzx9ZIjfhPHurF7zN//h+e251reIjIGE7pmuTQk pHiSrwVhpAAXHw7rqUpQmGVCaElvNeDL0ZirdgMc+9cdIw2Wb3jnSv8UH8jWDTJlqFxy uA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2ysrqby-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:14:55 +0000 Received: from m0353727.ppops.net (m0353727.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 342D7JXq016270; Tue, 2 May 2023 13:14:43 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 3qb2ysrq2u-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:14:43 +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 3420HgRF002522; Tue, 2 May 2023 13:09:28 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3q8tv6skjg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:27 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 342D9Odk33882536 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 May 2023 13:09:24 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 657AA20040; Tue, 2 May 2023 13:09:24 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8C0A420049; Tue, 2 May 2023 13:09:23 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 2 May 2023 13:09:23 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, nrb@linux.ibm.com, david@redhat.com Subject: [kvm-unit-tests PATCH v3 6/9] s390x: uv-host: Switch to smp_sigp Date: Tue, 2 May 2023 13:07:29 +0000 Message-Id: <20230502130732.147210-7-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230502130732.147210-1-frankja@linux.ibm.com> References: <20230502130732.147210-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: K-sZqrGB6MwKNSAlape9PkYQCKLWqk_u X-Proofpoint-ORIG-GUID: x8flgPhXrgnZvaYG9qFXJyfQ0U64OoKg 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-05-02_08,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 clxscore=1015 adultscore=0 mlxscore=0 mlxlogscore=999 spamscore=0 lowpriorityscore=0 phishscore=0 bulkscore=0 suspectscore=0 impostorscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305020111 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Let's move to the new smp_sigp() interface which abstracts cpu numbers. 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 0048a19f..a9543593 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -440,12 +440,12 @@ static void test_config_create(void) * non-zero prefix. */ if (smp_query_num_cpus() > 1) { - sigp_retry(1, SIGP_SET_PREFIX, + smp_sigp(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 == 0x10b && rc == 1 && !uvcb_cgc.guest_handle, "variable storage area contains lowcore"); - sigp_retry(1, SIGP_SET_PREFIX, 0x0, NULL); + smp_sigp(1, SIGP_SET_PREFIX, 0x0, NULL); } tmp = uvcb_cgc.guest_sca; From patchwork Tue May 2 13:07:30 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13228915 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 73452C77B73 for ; Tue, 2 May 2023 13:10:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234263AbjEBNKM (ORCPT ); Tue, 2 May 2023 09:10:12 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234264AbjEBNKK (ORCPT ); Tue, 2 May 2023 09:10:10 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7D00F5B87; Tue, 2 May 2023 06:10:06 -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 342D8peJ018280; Tue, 2 May 2023 13:10:06 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=v22rJkOfS5kLbFgBDQGFK2qjK/E3IfLjYFcJ4spaQ/Y=; b=pYr4XNamFvFfjAjovOpR4Xbxe0leWGLro3Z+Td7FURxPjX9BXK1Gvrx5448siXCemP0u uBOeyyNlAWkiD8IY2S58Vswe38jkfiJvtUNUbuTDokei1UReVBoW6kmXoilVng3jOuO0 yGYl25TvOzoawmZSBJtQ6qPyNcISUykav7fqtOwGHcYKq6j+Th3hGopxvTjx8aldndAo OTWy4ElW3CCICSDta1gXAysMoTQaKBfSeWEADq8jg+lnGCfgjeb6BuUyFFzlv9A5AowZ q8GH9eFE+0mQBMp7qdDpkJ/H6oHUXhhEPYjhfbaZKU48LfE/KN4Veffw1UiC3t19h8BW rg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2xv8d0s-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:10:05 +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 342D99FP022060; Tue, 2 May 2023 13:09:59 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 3qb2xv8bj5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:59 +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 3425MpQO031255; Tue, 2 May 2023 13:09:29 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3q8tv6skjh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:28 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 342D9Ppl14090694 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 May 2023 13:09:25 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 634B920040; Tue, 2 May 2023 13:09:25 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9357220043; Tue, 2 May 2023 13:09:24 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 2 May 2023 13:09:24 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, nrb@linux.ibm.com, david@redhat.com Subject: [kvm-unit-tests PATCH v3 7/9] s390x: uv-host: Properly handle config creation errors Date: Tue, 2 May 2023 13:07:30 +0000 Message-Id: <20230502130732.147210-8-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230502130732.147210-1-frankja@linux.ibm.com> References: <20230502130732.147210-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 93_TOOzizp_B5sBBhoeh3muHuns1fYN_ X-Proofpoint-ORIG-GUID: eiaLhTPEO5B5yecKB_Ly8FKEqQM82ApO 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-05-02_08,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 phishscore=0 impostorscore=0 mlxlogscore=927 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305020111 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 using stale data. Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- lib/s390x/asm/uv.h | 1 + s390x/uv-host.c | 66 +++++++++++++++++++++++++++++++++++++++------- 2 files changed, 58 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 a9543593..4418e9b9 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -371,6 +371,42 @@ 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_EXECUTED && + !(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)); + + /* We need to zero it for the next test */ + uvcb->guest_handle = 0; +} + +static bool cgc_check_data(struct uv_cb_cgc *uvcb, uint16_t rc_expected) +{ + /* This function purely checks for error rcs */ + if (uvcb->header.rc == UVC_RC_EXECUTED) + return false; + + /* + * 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) + report_abort("Received a handle when we didn't expect one"); + + return (uvcb->header.rc & ~UVC_RC_DSTR_NEEDED_FLG) == rc_expected; +} + static void test_config_create(void) { int rc; @@ -395,44 +431,51 @@ static void test_config_create(void) rc = uv_call(0, (uint64_t)&uvcb_cgc); report(uvcb_cgc.header.rc == UVC_RC_INV_LEN && rc == 1 && !uvcb_cgc.guest_handle, "hdr invalid length"); + cgc_destroy_if_needed(&uvcb_cgc); uvcb_cgc.header.len += 8; 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"); + cgc_destroy_if_needed(&uvcb_cgc); 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"); + cgc_destroy_if_needed(&uvcb_cgc); 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"); + cgc_destroy_if_needed(&uvcb_cgc); 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"); + cgc_destroy_if_needed(&uvcb_cgc); 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"); + cgc_destroy_if_needed(&uvcb_cgc); 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); + cgc_destroy_if_needed(&uvcb_cgc); uvcb_cgc.conf_base_stor_origin = tmp; /* @@ -445,21 +488,24 @@ static void test_config_create(void) rc = uv_call(0, (uint64_t)&uvcb_cgc); report(uvcb_cgc.header.rc == 0x10b && rc == 1 && !uvcb_cgc.guest_handle, "variable storage area contains lowcore"); + cgc_destroy_if_needed(&uvcb_cgc); smp_sigp(1, SIGP_SET_PREFIX, 0x0, NULL); } 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"); + cgc_destroy_if_needed(&uvcb_cgc); 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"); + cgc_destroy_if_needed(&uvcb_cgc); uvcb_cgc.guest_sca = tmp; rc = uv_call(0, (uint64_t)&uvcb_cgc); @@ -478,6 +524,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. */ @@ -495,6 +542,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 Tue May 2 13:07:31 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13228916 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 CF344C77B73 for ; Tue, 2 May 2023 13:12:10 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233961AbjEBNMJ (ORCPT ); Tue, 2 May 2023 09:12:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49668 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234264AbjEBNLt (ORCPT ); Tue, 2 May 2023 09:11:49 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 10BF45B92; Tue, 2 May 2023 06:11:48 -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 342D90g2020063; Tue, 2 May 2023 13:11:47 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=sX+Uu2kBa/nKhMbVw52BJMR0BOcBBUsfkM+dGmUk97k=; b=l4VmhpqMlq2F+l3+QNdTPtMb4b/T+5c9uHZPJ849xob9+gw4e+ZalJubeyfGZupHhHqY 6wvM/EO+bwpYgEKMuwWX+ueRrudGdpgGuky98XsVIlAGEJ5Wh6w/fqG55AzaT8PODEZ9 NlyhFK6e9acAbMfs5AY1BT5tfXoMzCri/1qsFj8YTNF9lcXjA+T1LPpYkGAB5JaDcg3W ilzJyyVfia/Jo2j8SrJiWG/MT1FFbVA/NjL9f+uL3WkkrNZ0LTjTpAGerzR7Ivk0KCPR riwcDvNS1TsCjpfde6RO6HjNPh2HwD8RUImdUpS2ey4G97W2L+W0IgDNJkDhuSggv0u6 nA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2xv8gd1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:11:47 +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 342D99FZ022060; Tue, 2 May 2023 13:11:40 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 3qb2xv8fp6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:11:40 +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 3420u9KV023433; Tue, 2 May 2023 13:09:30 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma06ams.nl.ibm.com (PPS) with ESMTPS id 3q8tgg1m24-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:30 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 342D9Q7I3408620 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 May 2023 13:09:26 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6A61D20049; Tue, 2 May 2023 13:09:26 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 913E720043; Tue, 2 May 2023 13:09:25 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 2 May 2023 13:09:25 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, nrb@linux.ibm.com, david@redhat.com Subject: [kvm-unit-tests PATCH v3 8/9] s390x: uv-host: Fence access checks when UV debug is enabled Date: Tue, 2 May 2023 13:07:31 +0000 Message-Id: <20230502130732.147210-9-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230502130732.147210-1-frankja@linux.ibm.com> References: <20230502130732.147210-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: Wz_bQ_4qfSvJkfO3BVIc0Dd5_jFsCWp5 X-Proofpoint-ORIG-GUID: jxL94lrs5gQ5fWB0o3pZk7uebH9kMzbD 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-05-02_08,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 phishscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305020111 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 4418e9b9..19bdd465 100644 --- a/s390x/uv-host.c +++ b/s390x/uv-host.c @@ -165,6 +165,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++) { @@ -197,6 +206,7 @@ static void test_access(void) uvcb += 1; unprotect_page(uvcb, PAGE_ENTRY_I); +out: free_pages(pages); report_prefix_pop(); } From patchwork Tue May 2 13:07:32 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13228912 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 0E60FC7EE29 for ; Tue, 2 May 2023 13:10:06 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234187AbjEBNKF (ORCPT ); Tue, 2 May 2023 09:10:05 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47952 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234248AbjEBNJt (ORCPT ); Tue, 2 May 2023 09:09:49 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2B4944C2B; Tue, 2 May 2023 06:09:46 -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 342D8uSW019525; Tue, 2 May 2023 13:09:46 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=e/kpUV/nb2d4/sqLJ0FfcM6Fj3qyHpPENr86u6AfUwY=; b=h7IB2wyLtfZf93UTEB3VHGK/wjZKkGhavcSAyf5/ks74SqSHdjlXWeILHx9UllB4Qs5/ 4v/vNiZxG1icgATRJuX2GAMxRPkppuXB+ECWdw7Fo9Ty65GNNa2zMbc+WZMdzn5gftDR 3Jcys/NYgtHk4aRS6136tvY/swuH//sWWJ05S4dloDJEGtxij8fxCiHtVCbzjb0jvg9V TXlOFCmM6rjPdIFqzuVODGWiYZQSg3d8zFyaWDEzaKp5C4pyES6z+NVONeapa1IFbGqU gpICp+GSVwluHxM3tp2oH8nAG9+TBNopHdKggduCACjA42PsX1opT20ju9Aqx+M2JoG2 LA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3qb2xv8c3f-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:45 +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 342D9YXH025933; Tue, 2 May 2023 13:09:39 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 3qb2xv8bp4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:38 +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 342437Kr027740; Tue, 2 May 2023 13:09:31 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma03ams.nl.ibm.com (PPS) with ESMTPS id 3q8tv6skjj-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 02 May 2023 13:09:30 +0000 Received: from smtpav06.fra02v.mail.ibm.com (smtpav06.fra02v.mail.ibm.com [10.20.54.105]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 342D9R3N4194920 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 2 May 2023 13:09:27 GMT Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 717192004E; Tue, 2 May 2023 13:09:27 +0000 (GMT) Received: from smtpav06.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 988C820049; Tue, 2 May 2023 13:09:26 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav06.fra02v.mail.ibm.com (Postfix) with ESMTP; Tue, 2 May 2023 13:09:26 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, nrb@linux.ibm.com, david@redhat.com Subject: [kvm-unit-tests PATCH v3 9/9] s390x: uv-host: Add the test to unittests.conf Date: Tue, 2 May 2023 13:07:32 +0000 Message-Id: <20230502130732.147210-10-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230502130732.147210-1-frankja@linux.ibm.com> References: <20230502130732.147210-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 7MHxtIJaFA9k1YaWtTysHJ_L1oDYU2xF X-Proofpoint-ORIG-GUID: NKz8KoBgYu2CsikhX3utmnuP4iYRJ7FZ 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-05-02_08,2023-04-27_01,2023-02-09_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 bulkscore=0 phishscore=0 impostorscore=0 mlxlogscore=999 spamscore=0 clxscore=1015 suspectscore=0 malwarescore=0 lowpriorityscore=0 mlxscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2303200000 definitions=main-2305020111 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Better to skip than to not run it at all. Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- s390x/unittests.cfg | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg index d6e7b170..3bba03ce 100644 --- a/s390x/unittests.cfg +++ b/s390x/unittests.cfg @@ -231,3 +231,8 @@ extra_params = -m 2200 [pv-diags] file = pv-diags.elf extra_params = -m 2200 + +[uv-host] +file = uv-host.elf +smp = 2 +extra_params = -m 2200