From patchwork Mon Jun 19 08:33:22 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13284131 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 2FA8AEB64DB for ; Mon, 19 Jun 2023 08:37:46 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231209AbjFSIhp (ORCPT ); Mon, 19 Jun 2023 04:37:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37386 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231166AbjFSIhW (ORCPT ); Mon, 19 Jun 2023 04:37:22 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 62B56170D; Mon, 19 Jun 2023 01:35:05 -0700 (PDT) Received: from pps.filterd (m0360083.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35J8FD8p026543; Mon, 19 Jun 2023 08:34:05 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=dO9kt/pdcE4GgRY6OJhIckivItRF9/Pi/KI3x77huZ8=; b=tE0Ly7P6lxxWs4iUQlbHik9EAgKI5NtLamHtnkI6TBEiUKeeooTtkiwGSWUw9lqccp7b NBxjg75C7agXMst2W312tRL8fkwNthLzo03EPkqwrf0Q4VTI/bmJbkXRzDDQ3b4RiC0V bFswLXcMX0Z4G3MBnQt0i+Ocj2C0DLaEMJlwasHbHvGln5Xu8FC3NDMtY+XFXWjAM00U ZhVCbGZ9KonhyhXCXZAptwbMPOnzH+ad+VHZLNhLlP9uKWhQdJNbbD5B88SWK58XKs8O 36NPaKVOD9kJsYfc/o2OIlCbQtAY/AtPYwLAoax8IDkYqK42nb/x7dAz+8sj6b/X7VHo qQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rak0g0yq5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:04 +0000 Received: from m0360083.ppops.net (m0360083.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35J7qXtI028356; Mon, 19 Jun 2023 08:34:04 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 3rak0g0ypg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:04 +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 35J6phYb008679; Mon, 19 Jun 2023 08:34:01 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma06fra.de.ibm.com (PPS) with ESMTPS id 3r943e0xnv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:01 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35J8XrCg6488668 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Jun 2023 08:33:53 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0F64F2004D; Mon, 19 Jun 2023 08:33:53 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 211CF20043; Mon, 19 Jun 2023 08:33:52 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 19 Jun 2023 08:33:52 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, david@redhat.com, nsg@linux.ibm.com, nrb@linux.ibm.com Subject: [kvm-unit-tests PATCH v5 1/8] lib: s390x: sie: Fix sie_get_validity() no validity handling Date: Mon, 19 Jun 2023 08:33:22 +0000 Message-Id: <20230619083329.22680-2-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619083329.22680-1-frankja@linux.ibm.com> References: <20230619083329.22680-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ItsohCvYQUYURtNlp_uN61Ba28G0YfpT X-Proofpoint-ORIG-GUID: 3vU9DRRFyxjsNspQ2Y00fACzOkGg3FZj 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-19_06,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 impostorscore=0 mlxscore=0 clxscore=1015 suspectscore=0 mlxlogscore=801 malwarescore=0 bulkscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 priorityscore=1501 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306190077 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Rather than asserting, we can return a value that's designated as a programming only value to indicate that there has been no validity. The SIE instruction will never write 0xffff as a validity code so let's just use that constant. Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- lib/s390x/sie.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/s390x/sie.c b/lib/s390x/sie.c index 9241b4b4..b44febde 100644 --- a/lib/s390x/sie.c +++ b/lib/s390x/sie.c @@ -23,7 +23,13 @@ void sie_expect_validity(struct vm *vm) uint16_t sie_get_validity(struct vm *vm) { - assert(vm->sblk->icptcode == ICPT_VALIDITY); + /* + * 0xffff will never be returned by SIE, so we can indicate a + * missing validity via this value. + */ + if (vm->sblk->icptcode != ICPT_VALIDITY) + return 0xffff; + return vm->sblk->ipb >> 16; } From patchwork Mon Jun 19 08:33:23 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 13284251 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 C9309EB64DB for ; Mon, 19 Jun 2023 09:36:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230435AbjFSJgN (ORCPT ); Mon, 19 Jun 2023 05:36:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59652 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230374AbjFSJgK (ORCPT ); Mon, 19 Jun 2023 05:36:10 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 93BF1B4; Mon, 19 Jun 2023 02:36:09 -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 35J8PgUf018126; Mon, 19 Jun 2023 08:34:00 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=J8MXHooEbZxLg10nF8GMHYpehdtFuKcjNFlsO2dpEmU=; b=HzU2JX4iXWoEVdQBTl8Y3FNfOti8R0+0Yo0XVFtDFBkNpQRge9lKUev1qW2vVcTdleip /ktFT6IBq23fwPTsrx9aHgeME308lTUtbkbUUrJvUU8gPLsx5to2/sDQovYgn6Y0q07i oBy/VB8rofritRAQAxttAst5dBicLfpwEfDpCtgUDii0DYGqwu3bXLWK5o3sh3/Dmcau yXk/6OV26bkIcarEnjR3wwI2yTrUCr1THwlw45U3GS197NeIpor5Ioriqkjwuz7tmF2f RbaJk+OsrwB6aU8i7GWj6ARbYhKUreRXdcEAQbWVWqPb5oSO+jTguSCwI+BhRwGxNqSX iw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rakgh05t9-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:00 +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 35J8PgJw018113; Mon, 19 Jun 2023 08:34:00 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 3rakgh05sk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:33:59 +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 35J5tT4g031967; Mon, 19 Jun 2023 08:33:57 GMT Received: from smtprelay03.fra02v.mail.ibm.com ([9.218.2.224]) by ppma03fra.de.ibm.com (PPS) with ESMTPS id 3r94f58xer-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:33:57 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay03.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35J8Xso318088532 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Jun 2023 08:33:54 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 2B4812004B; Mon, 19 Jun 2023 08:33:54 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3D26420043; Mon, 19 Jun 2023 08:33:53 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 19 Jun 2023 08:33:53 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, david@redhat.com, nsg@linux.ibm.com, nrb@linux.ibm.com Subject: [kvm-unit-tests PATCH v5 2/8] lib: s390x: uv: Introduce UV validity function Date: Mon, 19 Jun 2023 08:33:23 +0000 Message-Id: <20230619083329.22680-3-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619083329.22680-1-frankja@linux.ibm.com> References: <20230619083329.22680-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: vz_mNVkLet9UzVARGBCvp_iM691aoAGZ X-Proofpoint-GUID: BNF4hfUyp13HeWQebfQKHl9cJ4diPI9a 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-19_06,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 mlxlogscore=999 phishscore=0 bulkscore=0 adultscore=0 suspectscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 mlxscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306190077 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org PV related validities are in the 0x20** range but the last byte might be implementation specific, so everytime we check for a UV validity we need to mask the last byte. Let's add a function that checks for a UV validity and returns a boolean. Signed-off-by: Janosch Frank Reviewed-by: Claudio Imbrenda Reviewed-by: Nico Boehr --- lib/s390x/uv.h | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lib/s390x/uv.h b/lib/s390x/uv.h index 5fe29bda..78b979b7 100644 --- a/lib/s390x/uv.h +++ b/lib/s390x/uv.h @@ -35,4 +35,11 @@ static inline void uv_setup_asces(void) lctlg(13, asce); } +static inline bool uv_validity_check(struct vm *vm) +{ + uint16_t vir = sie_get_validity(vm); + + return vm->sblk->icptcode == ICPT_VALIDITY && (vir & 0xff00) == 0x2000; +} + #endif /* UV_H */ From patchwork Mon Jun 19 08:33: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: 13284130 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 369D4EB64DC for ; Mon, 19 Jun 2023 08:37:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231193AbjFSIhn (ORCPT ); Mon, 19 Jun 2023 04:37:43 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37038 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231152AbjFSIhV (ORCPT ); Mon, 19 Jun 2023 04:37:21 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 119BB171D; Mon, 19 Jun 2023 01:35:04 -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 35J8LsAF028457; Mon, 19 Jun 2023 08:34:02 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=huzk1GvlBydAsRnwcD+SkNYO/BWmYOhFKSb8WjIXIyE=; b=j5/steU706eNnCgWh0fG9v+UB+rfr+i+BbRiT9ga8DbYVJC52TcFFalwGL9d3Gq6SEnM 6NxN+9xzCYeI+7MlFoJeRrqR7iWsNFPbrjs9QRGD5CNKXjusUFfombgKTeUnl2VVnMBE ff3j25iaWm4RjHZCDfKW4SNMmDKVkh6KMlIFuwwr5U+7TTu2R/yy4s7Up7FA4gz2dqtd +fSDeu88sMfmFWidZfgSwf8oIYSqtm1wQdMWBeLAs/+wQOc4pqAohyrL6XqO9uZ3pW95 6oUlMuhOW//iiFttLPtAOYJEcwZmjG0kDFRnqZps5b5hJeast9fnByGEt5ds6YX3sY/5 QQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3raken06tx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:01 +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 35J8RR74018407; Mon, 19 Jun 2023 08:34:01 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 3raken06t5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:01 +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 35J8OqNO022366; Mon, 19 Jun 2023 08:33:58 GMT Received: from smtprelay04.fra02v.mail.ibm.com ([9.218.2.228]) by ppma05fra.de.ibm.com (PPS) with ESMTPS id 3r94f50x9m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:33:58 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay04.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35J8XtOb27329242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Jun 2023 08:33:55 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3E1A62004E; Mon, 19 Jun 2023 08:33:55 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5935820043; Mon, 19 Jun 2023 08:33:54 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 19 Jun 2023 08:33:54 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, david@redhat.com, nsg@linux.ibm.com, nrb@linux.ibm.com Subject: [kvm-unit-tests PATCH v5 3/8] lib: s390x: uv: Add intercept data check library function Date: Mon, 19 Jun 2023 08:33:24 +0000 Message-Id: <20230619083329.22680-4-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619083329.22680-1-frankja@linux.ibm.com> References: <20230619083329.22680-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: S_6IfGP8hTQrERt13EpzzBuDkD_BXExZ X-Proofpoint-GUID: qSl6X0YC-hb_Ce3lcanXHhSLEgvlBDcK 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-19_06,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 clxscore=1015 mlxscore=0 impostorscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306190077 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org When working with guests it's essential to check the SIE intercept data for the correct values. Fortunately on PV guests these values are constants so we can create check functions which test for the constants. While we're at it let's make pv-diags.c use this new function. Signed-off-by: Janosch Frank Reviewed-by: Claudio Imbrenda --- lib/s390x/pv_icptdata.h | 42 +++++++++++++++++++++++++++++++++++++++++ s390x/pv-diags.c | 14 ++++++-------- 2 files changed, 48 insertions(+), 8 deletions(-) create mode 100644 lib/s390x/pv_icptdata.h diff --git a/lib/s390x/pv_icptdata.h b/lib/s390x/pv_icptdata.h new file mode 100644 index 00000000..4746117e --- /dev/null +++ b/lib/s390x/pv_icptdata.h @@ -0,0 +1,42 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Commonly used checks for PV SIE intercept data + * + * Copyright IBM Corp. 2023 + * Author: Janosch Frank + */ + +#ifndef _S390X_PV_ICPTDATA_H_ +#define _S390X_PV_ICPTDATA_H_ + +#include + +/* + * Checks the diagnose instruction intercept data for consistency with + * the constants defined by the PV SIE architecture + * + * Supports: 0x44, 0x9c, 0x288, 0x308, 0x500 + */ +static bool pv_icptdata_check_diag(struct vm *vm, int diag) +{ + int icptcode; + + switch (diag) { + case 0x44: + case 0x9c: + case 0x288: + case 0x308: + icptcode = ICPT_PV_NOTIFY; + break; + case 0x500: + icptcode = ICPT_PV_INSTR; + break; + default: + /* If a new diag is introduced add it to the cases above! */ + assert(0); + } + + return vm->sblk->icptcode == icptcode && vm->sblk->ipa == 0x8302 && + vm->sblk->ipb == 0x50000000 && vm->save_area.guest.grs[5] == diag; +} +#endif diff --git a/s390x/pv-diags.c b/s390x/pv-diags.c index 5165937a..096ac61f 100644 --- a/s390x/pv-diags.c +++ b/s390x/pv-diags.c @@ -9,6 +9,7 @@ */ #include #include +#include #include #include #include @@ -31,8 +32,7 @@ static void test_diag_500(void) size_gbin, size_hdr, SNIPPET_UNPACK_OFF); sie(&vm); - report(vm.sblk->icptcode == ICPT_PV_INSTR && vm.sblk->ipa == 0x8302 && - vm.sblk->ipb == 0x50000000 && vm.save_area.guest.grs[5] == 0x500, + report(pv_icptdata_check_diag(&vm, 0x500), "intercept values"); report(vm.save_area.guest.grs[1] == 1 && vm.save_area.guest.grs[2] == 2 && @@ -45,9 +45,8 @@ static void test_diag_500(void) */ vm.sblk->iictl = IICTL_CODE_OPERAND; sie(&vm); - report(vm.sblk->icptcode == ICPT_PV_NOTIFY && vm.sblk->ipa == 0x8302 && - vm.sblk->ipb == 0x50000000 && vm.save_area.guest.grs[5] == 0x9c - && vm.save_area.guest.grs[0] == PGM_INT_CODE_OPERAND, + report(pv_icptdata_check_diag(&vm, 0x9c) && + vm.save_area.guest.grs[0] == PGM_INT_CODE_OPERAND, "operand exception"); /* @@ -58,9 +57,8 @@ static void test_diag_500(void) vm.sblk->iictl = IICTL_CODE_SPECIFICATION; /* Inject PGM, next exit should be 9c */ sie(&vm); - report(vm.sblk->icptcode == ICPT_PV_NOTIFY && vm.sblk->ipa == 0x8302 && - vm.sblk->ipb == 0x50000000 && vm.save_area.guest.grs[5] == 0x9c - && vm.save_area.guest.grs[0] == PGM_INT_CODE_SPECIFICATION, + report(pv_icptdata_check_diag(&vm, 0x9c) && + vm.save_area.guest.grs[0] == PGM_INT_CODE_SPECIFICATION, "specification exception"); /* No need for cleanup, just tear down the VM */ From patchwork Mon Jun 19 08:33: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: 13284132 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 3D9B6EB64D9 for ; Mon, 19 Jun 2023 08:37:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231214AbjFSIhq (ORCPT ); Mon, 19 Jun 2023 04:37:46 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230286AbjFSIhZ (ORCPT ); Mon, 19 Jun 2023 04:37:25 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A5B271718; Mon, 19 Jun 2023 01:35:06 -0700 (PDT) Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35J8H7qY029013; Mon, 19 Jun 2023 08:34:02 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=jEdA2/Knw/0wynKdIeM8WJn/SgRGQpUjAYdfunQ44Qw=; b=U00TcYj2276m1PomY7tWzJa4XOm4K9nuj/NOUTYDEcQOgYrrc4+aGhLlYSiersp5sR0a BdvzyUGXSQxVlnes98ES06+OYlqIb2dSJ6ZdX6pKuBk9YLdx+XAU7fP0iow3KfXvyR6Z gEYR6+Fb68G+b2e/XdZEIxMb2CGONZu4SegetLNKuhUZU3i/be3xC6gatNBaChXPmdwl sWoET5JeCMf83R644BWi505iLNhx2XX2IEczqoXAJDNSGzfXAznrA1zJgNpCp+mmcuuo iw4A6zaG/fgMSy4jPgIk0xxsoW9IEiAcMinhh3Zt8zrPrOKkLvYzHgXUWMHily6HLKqG 0g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rakcf8a6t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:02 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35J8HBG2029195; Mon, 19 Jun 2023 08:34:01 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 3rakcf8a65-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:01 +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 35J56e5J027760; Mon, 19 Jun 2023 08:33:59 GMT Received: from smtprelay05.fra02v.mail.ibm.com ([9.218.2.225]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3r94f5980m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:33:59 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay05.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35J8XuA824576526 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Jun 2023 08:33:56 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 503782004D; Mon, 19 Jun 2023 08:33:56 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 6BD3520043; Mon, 19 Jun 2023 08:33:55 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 19 Jun 2023 08:33:55 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, david@redhat.com, nsg@linux.ibm.com, nrb@linux.ibm.com Subject: [kvm-unit-tests PATCH v5 4/8] s390x: pv-diags: Drop snippet from snippet names Date: Mon, 19 Jun 2023 08:33:25 +0000 Message-Id: <20230619083329.22680-5-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619083329.22680-1-frankja@linux.ibm.com> References: <20230619083329.22680-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: _iQ-N9KIBDhUL4j272VspAZ6P88xrr16 X-Proofpoint-ORIG-GUID: KRwkgy5e8yiHhdEXScSQUTO1kSdYEYYd 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-19_05,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 clxscore=1015 suspectscore=0 bulkscore=0 spamscore=0 impostorscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306190072 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org It's a bit redundant. Signed-off-by: Janosch Frank Reviewed-by: Claudio Imbrenda Acked-by: Nico Boehr --- s390x/Makefile | 6 +-- s390x/pv-diags.c | 48 +++++++++---------- .../{snippet-pv-diag-288.S => pv-diag-288.S} | 0 .../{snippet-pv-diag-500.S => pv-diag-500.S} | 0 ...nippet-pv-diag-yield.S => pv-diag-yield.S} | 0 5 files changed, 27 insertions(+), 27 deletions(-) rename s390x/snippets/asm/{snippet-pv-diag-288.S => pv-diag-288.S} (100%) rename s390x/snippets/asm/{snippet-pv-diag-500.S => pv-diag-500.S} (100%) rename s390x/snippets/asm/{snippet-pv-diag-yield.S => pv-diag-yield.S} (100%) diff --git a/s390x/Makefile b/s390x/Makefile index a80db538..8d1cfc7c 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -122,9 +122,9 @@ snippet_lib = $(snippet_asmlib) lib/auxinfo.o $(TEST_DIR)/mvpg-sie.elf: snippets = $(SNIPPET_DIR)/c/mvpg-snippet.gbin $(TEST_DIR)/spec_ex-sie.elf: snippets = $(SNIPPET_DIR)/c/spec_ex.gbin -$(TEST_DIR)/pv-diags.elf: pv-snippets += $(SNIPPET_DIR)/asm/snippet-pv-diag-yield.gbin -$(TEST_DIR)/pv-diags.elf: pv-snippets += $(SNIPPET_DIR)/asm/snippet-pv-diag-288.gbin -$(TEST_DIR)/pv-diags.elf: pv-snippets += $(SNIPPET_DIR)/asm/snippet-pv-diag-500.gbin +$(TEST_DIR)/pv-diags.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-diag-yield.gbin +$(TEST_DIR)/pv-diags.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-diag-288.gbin +$(TEST_DIR)/pv-diags.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-diag-500.gbin ifneq ($(GEN_SE_HEADER),) snippets += $(pv-snippets) diff --git a/s390x/pv-diags.c b/s390x/pv-diags.c index 096ac61f..fa4e5532 100644 --- a/s390x/pv-diags.c +++ b/s390x/pv-diags.c @@ -18,17 +18,17 @@ static struct vm vm; static void test_diag_500(void) { - extern const char SNIPPET_NAME_START(asm, snippet_pv_diag_500)[]; - extern const char SNIPPET_NAME_END(asm, snippet_pv_diag_500)[]; - extern const char SNIPPET_HDR_START(asm, snippet_pv_diag_500)[]; - extern const char SNIPPET_HDR_END(asm, snippet_pv_diag_500)[]; - int size_hdr = SNIPPET_HDR_LEN(asm, snippet_pv_diag_500); - int size_gbin = SNIPPET_LEN(asm, snippet_pv_diag_500); + extern const char SNIPPET_NAME_START(asm, pv_diag_500)[]; + extern const char SNIPPET_NAME_END(asm, pv_diag_500)[]; + extern const char SNIPPET_HDR_START(asm, pv_diag_500)[]; + extern const char SNIPPET_HDR_END(asm, pv_diag_500)[]; + int size_hdr = SNIPPET_HDR_LEN(asm, pv_diag_500); + int size_gbin = SNIPPET_LEN(asm, pv_diag_500); report_prefix_push("diag 0x500"); - snippet_pv_init(&vm, SNIPPET_NAME_START(asm, snippet_pv_diag_500), - SNIPPET_HDR_START(asm, snippet_pv_diag_500), + snippet_pv_init(&vm, SNIPPET_NAME_START(asm, pv_diag_500), + SNIPPET_HDR_START(asm, pv_diag_500), size_gbin, size_hdr, SNIPPET_UNPACK_OFF); sie(&vm); @@ -70,17 +70,17 @@ static void test_diag_500(void) static void test_diag_288(void) { - extern const char SNIPPET_NAME_START(asm, snippet_pv_diag_288)[]; - extern const char SNIPPET_NAME_END(asm, snippet_pv_diag_288)[]; - extern const char SNIPPET_HDR_START(asm, snippet_pv_diag_288)[]; - extern const char SNIPPET_HDR_END(asm, snippet_pv_diag_288)[]; - int size_hdr = SNIPPET_HDR_LEN(asm, snippet_pv_diag_288); - int size_gbin = SNIPPET_LEN(asm, snippet_pv_diag_288); + extern const char SNIPPET_NAME_START(asm, pv_diag_288)[]; + extern const char SNIPPET_NAME_END(asm, pv_diag_288)[]; + extern const char SNIPPET_HDR_START(asm, pv_diag_288)[]; + extern const char SNIPPET_HDR_END(asm, pv_diag_288)[]; + int size_hdr = SNIPPET_HDR_LEN(asm, pv_diag_288); + int size_gbin = SNIPPET_LEN(asm, pv_diag_288); report_prefix_push("diag 0x288"); - snippet_pv_init(&vm, SNIPPET_NAME_START(asm, snippet_pv_diag_288), - SNIPPET_HDR_START(asm, snippet_pv_diag_288), + snippet_pv_init(&vm, SNIPPET_NAME_START(asm, pv_diag_288), + SNIPPET_HDR_START(asm, pv_diag_288), size_gbin, size_hdr, SNIPPET_UNPACK_OFF); sie(&vm); @@ -111,17 +111,17 @@ static void test_diag_288(void) static void test_diag_yield(void) { - extern const char SNIPPET_NAME_START(asm, snippet_pv_diag_yield)[]; - extern const char SNIPPET_NAME_END(asm, snippet_pv_diag_yield)[]; - extern const char SNIPPET_HDR_START(asm, snippet_pv_diag_yield)[]; - extern const char SNIPPET_HDR_END(asm, snippet_pv_diag_yield)[]; - int size_hdr = SNIPPET_HDR_LEN(asm, snippet_pv_diag_yield); - int size_gbin = SNIPPET_LEN(asm, snippet_pv_diag_yield); + extern const char SNIPPET_NAME_START(asm, pv_diag_yield)[]; + extern const char SNIPPET_NAME_END(asm, pv_diag_yield)[]; + extern const char SNIPPET_HDR_START(asm, pv_diag_yield)[]; + extern const char SNIPPET_HDR_END(asm, pv_diag_yield)[]; + int size_hdr = SNIPPET_HDR_LEN(asm, pv_diag_yield); + int size_gbin = SNIPPET_LEN(asm, pv_diag_yield); report_prefix_push("diag yield"); - snippet_pv_init(&vm, SNIPPET_NAME_START(asm, snippet_pv_diag_yield), - SNIPPET_HDR_START(asm, snippet_pv_diag_yield), + snippet_pv_init(&vm, SNIPPET_NAME_START(asm, pv_diag_yield), + SNIPPET_HDR_START(asm, pv_diag_yield), size_gbin, size_hdr, SNIPPET_UNPACK_OFF); /* 0x44 */ diff --git a/s390x/snippets/asm/snippet-pv-diag-288.S b/s390x/snippets/asm/pv-diag-288.S similarity index 100% rename from s390x/snippets/asm/snippet-pv-diag-288.S rename to s390x/snippets/asm/pv-diag-288.S diff --git a/s390x/snippets/asm/snippet-pv-diag-500.S b/s390x/snippets/asm/pv-diag-500.S similarity index 100% rename from s390x/snippets/asm/snippet-pv-diag-500.S rename to s390x/snippets/asm/pv-diag-500.S diff --git a/s390x/snippets/asm/snippet-pv-diag-yield.S b/s390x/snippets/asm/pv-diag-yield.S similarity index 100% rename from s390x/snippets/asm/snippet-pv-diag-yield.S rename to s390x/snippets/asm/pv-diag-yield.S From patchwork Mon Jun 19 08:33: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: 13284297 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 9C792EB64D9 for ; Mon, 19 Jun 2023 10:02:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231476AbjFSKCs (ORCPT ); Mon, 19 Jun 2023 06:02:48 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46614 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231985AbjFSKCe (ORCPT ); Mon, 19 Jun 2023 06:02:34 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E98D2E51; Mon, 19 Jun 2023 03:02:11 -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 35J8LugB028534; Mon, 19 Jun 2023 08:34:04 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=bvcXv2O6Z2cZq6PtacksfB3Jc3wsAIGIARcU/ojdVj0=; b=b5KUeX7hrBCRP+CoEPWzeCdTHEHj/TC0HdLw4r3IH7jp2RgHL/bnlkSbnew+pL+wstKa Hx0k7TgUbZRv/BHeunDW6rfExSOpZ4gXFHFk5ZBov9IsiQDBfa2dXghbN127pNIjPOPY TQcTGTL8M4l9zHw5P+3G8ckVDR6XP3xMEjOlpAdM20m6MAX2td8c7YrFzjcVSVAq38TF WodOqmPF6tMF9XfTt28M9JPXO4V63Par4nFtimg9e/epY5vbW9SV7mt4SLgxNKblJVPs Sfe7qWbxb97GS7iLnN2DxwIhru2b5jfke504amwbkl0TVPqEoThAZ5uYQR9WtTi1y8JH Nw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3raken06uv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:03 +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 35J8Mr2E000967; Mon, 19 Jun 2023 08:34:03 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 3raken06u1-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:03 +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 35J4kk42018552; Mon, 19 Jun 2023 08:34:00 GMT Received: from smtprelay06.fra02v.mail.ibm.com ([9.218.2.230]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3r94f50xdt-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:00 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay06.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35J8XvUA36242044 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Jun 2023 08:33:57 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 617152004E; Mon, 19 Jun 2023 08:33:57 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7DE2520043; Mon, 19 Jun 2023 08:33:56 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 19 Jun 2023 08:33:56 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, david@redhat.com, nsg@linux.ibm.com, nrb@linux.ibm.com Subject: [kvm-unit-tests PATCH v5 5/8] lib: s390x: uv: Add pv host requirement check function Date: Mon, 19 Jun 2023 08:33:26 +0000 Message-Id: <20230619083329.22680-6-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619083329.22680-1-frankja@linux.ibm.com> References: <20230619083329.22680-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: nibyZHTEUo8PO72DhQHC-bdbjZn720no X-Proofpoint-GUID: Te8a1BCqarkbp_XhBJbvLGNtLB6x6a9U 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-19_06,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 suspectscore=0 spamscore=0 mlxlogscore=999 malwarescore=0 bulkscore=0 clxscore=1015 mlxscore=0 impostorscore=0 adultscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306190077 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org When running PV guests some of the UV memory needs to be allocated with > 31 bit addresses which means tests with PV guests will always need a lot more memory than other tests. Additionally facilities nr 158 and sclp.sief2 need to be available. Let's add a function that checks for these requirements and prints a helpful skip message. Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- lib/s390x/snippet.h | 7 +++++++ lib/s390x/uv.c | 20 ++++++++++++++++++++ lib/s390x/uv.h | 1 + s390x/pv-diags.c | 8 +------- 4 files changed, 29 insertions(+), 7 deletions(-) diff --git a/lib/s390x/snippet.h b/lib/s390x/snippet.h index 57045994..11ec54c3 100644 --- a/lib/s390x/snippet.h +++ b/lib/s390x/snippet.h @@ -30,6 +30,13 @@ #define SNIPPET_HDR_LEN(type, file) \ ((uintptr_t)SNIPPET_HDR_END(type, file) - (uintptr_t)SNIPPET_HDR_START(type, file)) +/* + * Some of the UV memory needs to be allocated with >31 bit + * addresses which means we need a lot more memory than other + * tests. + */ +#define SNIPPET_PV_MIN_MEM_SIZE (SZ_1M * 2200UL) + #define SNIPPET_PV_TWEAK0 0x42UL #define SNIPPET_PV_TWEAK1 0UL #define SNIPPET_UNPACK_OFF 0 diff --git a/lib/s390x/uv.c b/lib/s390x/uv.c index 383271a5..4ccb7bde 100644 --- a/lib/s390x/uv.c +++ b/lib/s390x/uv.c @@ -18,6 +18,7 @@ #include #include #include +#include static struct uv_cb_qui uvcb_qui = { .header.cmd = UVC_CMD_QUI, @@ -38,6 +39,25 @@ bool uv_os_is_host(void) return test_facility(158) && uv_query_test_call(BIT_UVC_CMD_INIT_UV); } +bool uv_host_requirement_checks(void) +{ + if (!test_facility(158)) { + report_skip("UV Call facility unavailable"); + return false; + } + if (!sclp_facilities.has_sief2) { + report_skip("SIEF2 facility unavailable"); + return false; + } + 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); + return false; + } + + return true; +} + bool uv_query_test_call(unsigned int nr) { /* Query needs to be called first */ diff --git a/lib/s390x/uv.h b/lib/s390x/uv.h index 78b979b7..286933ca 100644 --- a/lib/s390x/uv.h +++ b/lib/s390x/uv.h @@ -7,6 +7,7 @@ bool uv_os_is_guest(void); bool uv_os_is_host(void); +bool uv_host_requirement_checks(void); bool uv_query_test_call(unsigned int nr); const struct uv_cb_qui *uv_get_query_data(void); void uv_init(void); diff --git a/s390x/pv-diags.c b/s390x/pv-diags.c index fa4e5532..3193ad99 100644 --- a/s390x/pv-diags.c +++ b/s390x/pv-diags.c @@ -149,14 +149,8 @@ static void test_diag_yield(void) int main(void) { report_prefix_push("pv-diags"); - if (!test_facility(158)) { - report_skip("UV Call facility unavailable"); + if (!uv_host_requirement_checks()) goto done; - } - if (!sclp_facilities.has_sief2) { - report_skip("SIEF2 facility unavailable"); - goto done; - } uv_setup_asces(); snippet_setup_guest(&vm, true); From patchwork Mon Jun 19 08:33: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: 13284133 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 5AC11EB64DA for ; Mon, 19 Jun 2023 08:37:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230440AbjFSIhz (ORCPT ); Mon, 19 Jun 2023 04:37:55 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37826 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231183AbjFSIhe (ORCPT ); Mon, 19 Jun 2023 04:37:34 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6FBAC198B; Mon, 19 Jun 2023 01:35:12 -0700 (PDT) Received: from pps.filterd (m0353725.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35J8HQsM019473; Mon, 19 Jun 2023 08:34:12 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=0vrjSXFjOBX7/4rodDFQUuU250jfgWIKNGdVo1a4mVU=; b=Jjz4qC2G49aFTlcFbyH15Dclm8VxFsjkYaPV9D0WDKQm1wVnEVvGRnwzvr3sKmf42aji hWF3AKmTmSY7VlP9bej2kNRXplUApIzEcH4HKtLq0m5S/xkPlCt70Z/PgvBhfHT1gPsg SHGKE2bxvY88VLUvUSOOaLbNqQ7FdISKyzGN/mRXyhp/rrxA6YWFDBDtnGHjpU84udO1 cn7z3TNdbGtxwmszENRqnKyCHro+PgIsKC+tT4YOjMR060yr4ZsqcfWqfykA7KMf5StD 5jSSGSOCB5y5+t4ZNdMvNT8BU3kmRtMyXyFMiN43o0cAyDxqsE3wGCd6uqE0AzSAyLXT 6w== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rakcjgb3x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:11 +0000 Received: from m0353725.ppops.net (m0353725.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35J8K9Gd030271; Mon, 19 Jun 2023 08:34:11 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 3rakcjgb1d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:11 +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 35J6viOM012894; Mon, 19 Jun 2023 08:34:07 GMT Received: from smtprelay07.fra02v.mail.ibm.com ([9.218.2.229]) by ppma01fra.de.ibm.com (PPS) with ESMTPS id 3r94f50xdx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:06 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay07.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35J8XwUC57934242 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Jun 2023 08:33:58 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7E8092004D; Mon, 19 Jun 2023 08:33:58 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 901F720043; Mon, 19 Jun 2023 08:33:57 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 19 Jun 2023 08:33:57 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, david@redhat.com, nsg@linux.ibm.com, nrb@linux.ibm.com Subject: [kvm-unit-tests PATCH v5 6/8] s390x: pv: Add sie entry intercept and validity test Date: Mon, 19 Jun 2023 08:33:27 +0000 Message-Id: <20230619083329.22680-7-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619083329.22680-1-frankja@linux.ibm.com> References: <20230619083329.22680-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: c_eEKwXInsvmTNWtPZSS1rCabw6hV7Hj X-Proofpoint-ORIG-GUID: OiyDN_LlmzZtePJnPKGYO7SJdVS2uYyN 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-19_05,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 mlxlogscore=999 spamscore=0 bulkscore=0 adultscore=0 phishscore=0 priorityscore=1501 mlxscore=0 suspectscore=0 malwarescore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306190077 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The lowcore is an important part of any s390 cpu so we need to make sure it's always available when we virtualize one. For non-PV guests that would mean ensuring that the lowcore page is read and writable by the guest. For PV guests we additionally need to make sure that the page is owned by the guest as it is only allowed to access them if that's the case. The code 112 SIE intercept tells us if the lowcore pages aren't secure anymore. Let's check if that intercept is reported by SIE if we export the lowcore pages. Additionally check if that's also the case if the guest shares the lowcore which will make it readable to the host but ownership of the page should not change. Also we check for validities in these conditions: * Manipulated cpu timer * Double SIE for same vcpu * Re-use of VCPU handle from another secure configuration * ASCE re-use Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- s390x/Makefile | 5 + s390x/pv-icptcode.c | 376 ++++++++++++++++++++++++ s390x/snippets/asm/icpt-loop.S | 15 + s390x/snippets/asm/loop.S | 13 + s390x/snippets/asm/pv-icpt-112.S | 81 +++++ s390x/snippets/asm/pv-icpt-vir-timing.S | 21 ++ s390x/unittests.cfg | 6 + 7 files changed, 517 insertions(+) create mode 100644 s390x/pv-icptcode.c create mode 100644 s390x/snippets/asm/icpt-loop.S create mode 100644 s390x/snippets/asm/loop.S create mode 100644 s390x/snippets/asm/pv-icpt-112.S create mode 100644 s390x/snippets/asm/pv-icpt-vir-timing.S diff --git a/s390x/Makefile b/s390x/Makefile index 8d1cfc7c..67be5360 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -42,6 +42,7 @@ tests += $(TEST_DIR)/exittime.elf tests += $(TEST_DIR)/ex.elf pv-tests += $(TEST_DIR)/pv-diags.elf +pv-tests += $(TEST_DIR)/pv-icptcode.elf ifneq ($(HOST_KEY_DOCUMENT),) ifneq ($(GEN_SE_HEADER),) @@ -125,6 +126,10 @@ $(TEST_DIR)/spec_ex-sie.elf: snippets = $(SNIPPET_DIR)/c/spec_ex.gbin $(TEST_DIR)/pv-diags.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-diag-yield.gbin $(TEST_DIR)/pv-diags.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-diag-288.gbin $(TEST_DIR)/pv-diags.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-diag-500.gbin +$(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-icpt-112.gbin +$(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/icpt-loop.gbin +$(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/loop.gbin +$(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-icpt-vir-timing.gbin ifneq ($(GEN_SE_HEADER),) snippets += $(pv-snippets) diff --git a/s390x/pv-icptcode.c b/s390x/pv-icptcode.c new file mode 100644 index 00000000..d7c47d6f --- /dev/null +++ b/s390x/pv-icptcode.c @@ -0,0 +1,376 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * PV virtualization interception tests for intercepts that are not + * caused by an instruction. + * + * Copyright (c) 2023 IBM Corp + * + * Authors: + * Janosch Frank + */ +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +static struct vm vm, vm2; + +/* + * The hypervisor should not be able to decrease the cpu timer by an + * amount that is higher than the amount of time spent outside of + * SIE. + * + * Warning: A lot of things influence time so decreasing the timer by + * a more significant amount than the difference to have a safety + * margin is advised. + */ +static void test_validity_timing(void) +{ + extern const char SNIPPET_NAME_START(asm, pv_icpt_vir_timing)[]; + extern const char SNIPPET_NAME_END(asm, pv_icpt_vir_timing)[]; + extern const char SNIPPET_HDR_START(asm, pv_icpt_vir_timing)[]; + extern const char SNIPPET_HDR_END(asm, pv_icpt_vir_timing)[]; + int size_hdr = SNIPPET_HDR_LEN(asm, pv_icpt_vir_timing); + int size_gbin = SNIPPET_LEN(asm, pv_icpt_vir_timing); + uint64_t time_exit, time_entry, tmp; + + report_prefix_push("manipulated cpu time"); + snippet_pv_init(&vm, SNIPPET_NAME_START(asm, pv_icpt_vir_timing), + SNIPPET_HDR_START(asm, pv_icpt_vir_timing), + size_gbin, size_hdr, SNIPPET_UNPACK_OFF); + + sie(&vm); + report(pv_icptdata_check_diag(&vm, 0x44), "spt done"); + stck(&time_exit); + tmp = vm.sblk->cputm; + mb(); + + /* Cpu timer counts down so adding a ms should lead to a validity */ + vm.sblk->cputm += S390_CLOCK_SHIFT_US * 1000; + sie_expect_validity(&vm); + sie(&vm); + report(uv_validity_check(&vm), "validity entry cput > exit cput"); + vm.sblk->cputm = tmp; + + /* + * We are not allowed to decrement the timer more than the + * time spent outside of SIE + */ + stck(&time_entry); + vm.sblk->cputm -= (time_entry - time_exit) + S390_CLOCK_SHIFT_US * 1000; + sie_expect_validity(&vm); + sie(&vm); + report(uv_validity_check(&vm), "validity entry cput < time spent outside SIE"); + vm.sblk->cputm = tmp; + + uv_destroy_guest(&vm); + report_prefix_pop(); +} + +static void run_loop(void) +{ + sie(&vm); + sigp_retry(stap(), SIGP_STOP, 0, NULL); +} + +static void test_validity_already_running(void) +{ + extern const char SNIPPET_NAME_START(asm, loop)[]; + extern const char SNIPPET_NAME_END(asm, loop)[]; + extern const char SNIPPET_HDR_START(asm, loop)[]; + extern const char SNIPPET_HDR_END(asm, loop)[]; + int size_hdr = SNIPPET_HDR_LEN(asm, loop); + int size_gbin = SNIPPET_LEN(asm, loop); + struct psw psw = { + .mask = PSW_MASK_64, + .addr = (uint64_t)run_loop, + }; + + report_prefix_push("already running"); + if (smp_query_num_cpus() < 3) { + report_skip("need at least 3 cpus for this test"); + goto out; + } + + snippet_pv_init(&vm, SNIPPET_NAME_START(asm, loop), + SNIPPET_HDR_START(asm, loop), + size_gbin, size_hdr, SNIPPET_UNPACK_OFF); + + smp_cpu_setup(1, psw); + sie_expect_validity(&vm); + smp_cpu_setup(2, psw); + while (vm.sblk->icptcode != ICPT_VALIDITY) { + mb(); + } + + /* + * One cpu will enter SIE and one will receive the validity. + * We rely on the expectation that the cpu in SIE won't exit + * until we had a chance to observe the validity as the exit + * would overwrite the validity. + * + * In general that expectation is valid but HW/FW can in + * theory still exit to handle their interrupts. + */ + report(uv_validity_check(&vm), "validity"); + smp_cpu_stop(1); + smp_cpu_stop(2); + uv_destroy_guest(&vm); + +out: + report_prefix_pop(); +} + +/* Tests if a vcpu handle from another configuration results in a validity intercept. */ +static void test_validity_handle_not_in_config(void) +{ + extern const char SNIPPET_NAME_START(asm, icpt_loop)[]; + extern const char SNIPPET_NAME_END(asm, icpt_loop)[]; + extern const char SNIPPET_HDR_START(asm, icpt_loop)[]; + extern const char SNIPPET_HDR_END(asm, icpt_loop)[]; + int size_hdr = SNIPPET_HDR_LEN(asm, icpt_loop); + int size_gbin = SNIPPET_LEN(asm, icpt_loop); + + report_prefix_push("handle not in config"); + /* Setup our primary vm */ + snippet_pv_init(&vm, SNIPPET_NAME_START(asm, icpt_loop), + SNIPPET_HDR_START(asm, icpt_loop), + size_gbin, size_hdr, SNIPPET_UNPACK_OFF); + + /* Setup secondary vm */ + snippet_setup_guest(&vm2, true); + snippet_pv_init(&vm2, SNIPPET_NAME_START(asm, icpt_loop), + SNIPPET_HDR_START(asm, icpt_loop), + size_gbin, size_hdr, SNIPPET_UNPACK_OFF); + + vm.sblk->pv_handle_cpu = vm2.sblk->pv_handle_cpu; + sie_expect_validity(&vm); + sie(&vm); + report(uv_validity_check(&vm), "switched cpu handle"); + vm.sblk->pv_handle_cpu = vm.uv.vcpu_handle; + + vm.sblk->pv_handle_config = vm2.uv.vm_handle; + sie_expect_validity(&vm); + sie(&vm); + report(uv_validity_check(&vm), "switched configuration handle"); + vm.sblk->pv_handle_config = vm.uv.vm_handle; + + /* Destroy the second vm, since we don't need it for further tests */ + uv_destroy_guest(&vm2); + sie_guest_destroy(&vm2); + + uv_destroy_guest(&vm); + report_prefix_pop(); +} + +/* Tests if a wrong vm or vcpu handle results in a validity intercept. */ +static void test_validity_seid(void) +{ + extern const char SNIPPET_NAME_START(asm, icpt_loop)[]; + extern const char SNIPPET_NAME_END(asm, icpt_loop)[]; + extern const char SNIPPET_HDR_START(asm, icpt_loop)[]; + extern const char SNIPPET_HDR_END(asm, icpt_loop)[]; + int size_hdr = SNIPPET_HDR_LEN(asm, icpt_loop); + int size_gbin = SNIPPET_LEN(asm, icpt_loop); + int fails = 0; + int i; + + report_prefix_push("handles"); + snippet_pv_init(&vm, SNIPPET_NAME_START(asm, icpt_loop), + SNIPPET_HDR_START(asm, icpt_loop), + size_gbin, size_hdr, SNIPPET_UNPACK_OFF); + + for (i = 0; i < 64; i++) { + vm.sblk->pv_handle_config ^= 1UL << i; + sie_expect_validity(&vm); + sie(&vm); + if (!uv_validity_check(&vm)) { + report_fail("SIE accepted wrong VM SEID, changed bit %d", + 63 - i); + fails++; + } + vm.sblk->pv_handle_config ^= 1UL << i; + } + report(!fails, "No wrong vm handle accepted"); + + fails = 0; + for (i = 0; i < 64; i++) { + vm.sblk->pv_handle_cpu ^= 1UL << i; + sie_expect_validity(&vm); + sie(&vm); + if (!uv_validity_check(&vm)) { + report_fail("SIE accepted wrong CPU SEID, changed bit %d", + 63 - i); + fails++; + } + vm.sblk->pv_handle_cpu ^= 1UL << i; + } + report(!fails, "No wrong cpu handle accepted"); + + uv_destroy_guest(&vm); + report_prefix_pop(); +} + +/* + * Tests if we get a validity intercept if the CR1 asce at SIE entry + * is not the same as the one given at the UV creation of the VM. + */ +static void test_validity_asce(void) +{ + extern const char SNIPPET_NAME_START(asm, pv_icpt_112)[]; + extern const char SNIPPET_NAME_END(asm, pv_icpt_112)[]; + extern const char SNIPPET_HDR_START(asm, pv_icpt_112)[]; + extern const char SNIPPET_HDR_END(asm, pv_icpt_112)[]; + int size_hdr = SNIPPET_HDR_LEN(asm, pv_icpt_112); + int size_gbin = SNIPPET_LEN(asm, pv_icpt_112); + uint64_t asce_old, asce_new; + void *pgd_new, *pgd_old; + + report_prefix_push("asce"); + snippet_pv_init(&vm, SNIPPET_NAME_START(asm, pv_icpt_112), + SNIPPET_HDR_START(asm, pv_icpt_112), + size_gbin, size_hdr, SNIPPET_UNPACK_OFF); + + asce_old = vm.save_area.guest.asce; + pgd_new = memalign_pages_flags(PAGE_SIZE, PAGE_SIZE * 4, 0); + pgd_old = (void *)(asce_old & PAGE_MASK); + + /* Copy the contents of the top most table */ + memcpy(pgd_new, pgd_old, PAGE_SIZE * 4); + + /* Create the replacement ASCE */ + asce_new = __pa(pgd_new) | ASCE_DT_REGION1 | REGION_TABLE_LENGTH | ASCE_P; + vm.save_area.guest.asce = asce_new; + + sie_expect_validity(&vm); + sie(&vm); + report(uv_validity_check(&vm), "wrong CR1 validity"); + + /* Restore the old ASCE */ + vm.save_area.guest.asce = asce_old; + + /* Try if we can still do an entry with the correct asce */ + sie(&vm); + report(pv_icptdata_check_diag(&vm, 0x44), "re-entry with valid CR1"); + uv_destroy_guest(&vm); + free_pages(pgd_new); + report_prefix_pop(); +} + +static void run_icpt_122_tests(unsigned long lc_off) +{ + uv_export(vm.sblk->mso + lc_off); + sie(&vm); + report(vm.sblk->icptcode == ICPT_PV_PREF, "Intercept 112 for page 0"); + uv_import(vm.uv.vm_handle, vm.sblk->mso + lc_off); + + uv_export(vm.sblk->mso + lc_off + PAGE_SIZE); + sie(&vm); + report(vm.sblk->icptcode == ICPT_PV_PREF, "Intercept 112 for page 1"); + uv_import(vm.uv.vm_handle, vm.sblk->mso + lc_off + PAGE_SIZE); +} + +static void run_icpt_122_tests_prefix(unsigned long prefix) +{ + uint32_t *ptr = 0; + + report_prefix_pushf("0x%lx", prefix); + report_prefix_push("unshared"); + run_icpt_122_tests(prefix); + report_prefix_pop(); + + /* + * Guest will share the lowcore and we need to check if that + * makes a difference (which it should not). + */ + report_prefix_push("shared"); + + sie(&vm); + /* Guest indicates that it has been setup via the diag 0x44 */ + assert(pv_icptdata_check_diag(&vm, 0x44)); + /* If the pages have not been shared these writes will cause exceptions */ + ptr = (uint32_t *)prefix; + WRITE_ONCE(ptr, 0); + ptr = (uint32_t *)(prefix + offsetof(struct lowcore, ars_sa[0])); + WRITE_ONCE(ptr, 0); + + run_icpt_122_tests(prefix); + + /* shared*/ + report_prefix_pop(); + /* prefix hex value */ + report_prefix_pop(); +} + +static void test_icpt_112(void) +{ + extern const char SNIPPET_NAME_START(asm, pv_icpt_112)[]; + extern const char SNIPPET_NAME_END(asm, pv_icpt_112)[]; + extern const char SNIPPET_HDR_START(asm, pv_icpt_112)[]; + extern const char SNIPPET_HDR_END(asm, pv_icpt_112)[]; + int size_hdr = SNIPPET_HDR_LEN(asm, pv_icpt_112); + int size_gbin = SNIPPET_LEN(asm, pv_icpt_112); + + unsigned long lc_off = 0; + + report_prefix_push("prefix"); + + snippet_pv_init(&vm, SNIPPET_NAME_START(asm, pv_icpt_112), + SNIPPET_HDR_START(asm, pv_icpt_112), + size_gbin, size_hdr, SNIPPET_UNPACK_OFF); + + /* Setup of the guest's state for 0x0 prefix */ + sie(&vm); + assert(pv_icptdata_check_diag(&vm, 0x44)); + + /* Test on standard 0x0 prefix */ + run_icpt_122_tests_prefix(0); + + /* Setup of the guest's state for 0x8000 prefix */ + lc_off = 0x8000; + uv_import(vm.uv.vm_handle, vm.sblk->mso + lc_off); + uv_import(vm.uv.vm_handle, vm.sblk->mso + lc_off + PAGE_SIZE); + /* Guest will set prefix to 0x8000 */ + sie(&vm); + /* SPX generates a PV instruction notification */ + assert(vm.sblk->icptcode == ICPT_PV_NOTIFY && vm.sblk->ipa == 0xb210); + assert(*(u32 *)vm.sblk->sidad == 0x8000); + + /* Test on 0x8000 prefix */ + run_icpt_122_tests_prefix(0x8000); + + /* Try a re-entry after everything has been imported again */ + sie(&vm); + report(pv_icptdata_check_diag(&vm, 0x9c) && + vm.save_area.guest.grs[0] == 42, + "re-entry successful"); + report_prefix_pop(); + uv_destroy_guest(&vm); +} + +int main(void) +{ + report_prefix_push("pv-icpts"); + if (!uv_host_requirement_checks()) + goto done; + + snippet_setup_guest(&vm, true); + test_icpt_112(); + test_validity_asce(); + test_validity_seid(); + test_validity_handle_not_in_config(); + test_validity_already_running(); + test_validity_timing(); + sie_guest_destroy(&vm); + +done: + report_prefix_pop(); + return report_summary(); +} diff --git a/s390x/snippets/asm/icpt-loop.S b/s390x/snippets/asm/icpt-loop.S new file mode 100644 index 00000000..2aa59c01 --- /dev/null +++ b/s390x/snippets/asm/icpt-loop.S @@ -0,0 +1,15 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Infinite loop snippet which can be used to test manipulated SIE + * control block intercepts. E.g. when manipulating the PV handles. + * + * Copyright (c) 2023 IBM Corp + * + * Authors: + * Janosch Frank + */ +.section .text +xgr %r0, %r0 +retry: +diag 0,0,0x44 +j retry diff --git a/s390x/snippets/asm/loop.S b/s390x/snippets/asm/loop.S new file mode 100644 index 00000000..a75bf00d --- /dev/null +++ b/s390x/snippets/asm/loop.S @@ -0,0 +1,13 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Infinite loop snippet with no exit + * + * Copyright (c) 2023 IBM Corp + * + * Authors: + * Janosch Frank + */ +.section .text + +retry: +j retry diff --git a/s390x/snippets/asm/pv-icpt-112.S b/s390x/snippets/asm/pv-icpt-112.S new file mode 100644 index 00000000..d9545fff --- /dev/null +++ b/s390x/snippets/asm/pv-icpt-112.S @@ -0,0 +1,81 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Intercept 112 PV snippet + * + * We setup and share a prefix at 0x0 and 0x8000 which the hypervisor + * test will try to export and then execute a SIE entry which + * should result in a 112 SIE intercept. + * + * Copyright (c) 2023 IBM Corp + * + * Authors: + * Janosch Frank + */ +#include + +.section .text +xgr %r0, %r0 +xgr %r1, %r1 + +/* Let's tell the hypervisor we're ready to start */ +diag 0,0,0x44 + +/* + * Hypervisor will export the lowcore and try a SIE entry which should + * result in a 112. It will then import the lowcore again and we + * should continue with the code below. + */ + +/* Share the lowcore */ +larl %r1, share +.insn rrf,0xB9A40000,0,1,0,0 +xgr %r1, %r1 + +/* Let's tell the hypervisor we're ready to start shared testing */ +diag 0,0,0x44 + +/* Host: icpt: PV instruction diag 0x44 */ +/* Host: icpt: 112 */ + +/* Copy the invalid PGM new PSW to the new lowcore */ +larl %r1, prfx +l %r2, 0(%r1) +mvc GEN_LC_PGM_NEW_PSW(16, %r2), GEN_LC_PGM_NEW_PSW(%r0) + +/* Change the prefix to 0x8000 and re-try */ +xgr %r1, %r1 +xgr %r2, %r2 +larl %r2, prfx +spx 0(%r2) + +/* Host: icpt: PV instruction notification SPX*/ +/* Host: icpt: 112 */ + +/* Share the new lowcore */ +larl %r3, share_addr +stg %r2, 0(%r3) +larl %r2, share +.insn rrf,0xB9A40000,0,2,0,0 + +/* Let's tell the hypervisor we're ready to start shared testing */ +diag 0,0,0x44 + +/* Host: icpt: PV instruction diag 0x44 */ +/* Host: icpt: 112 */ + +/* Test re-entry */ +lghi %r1, 42 +diag 1,0,0x9c + +/* Host: icpt: PV instruction diag 0x9c */ + +.align 8 +share: + .quad 0x0030100000000000 + .quad 0x0, 0x0, 0x0 +share_addr: + .quad 0x0 + .quad 0x0 +.align 4 +prfx: + .long 0x00008000 diff --git a/s390x/snippets/asm/pv-icpt-vir-timing.S b/s390x/snippets/asm/pv-icpt-vir-timing.S new file mode 100644 index 00000000..939134a2 --- /dev/null +++ b/s390x/snippets/asm/pv-icpt-vir-timing.S @@ -0,0 +1,21 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Sets a cpu timer which the host can manipulate to check if it will + * receive a validity + * + * Copyright (c) 2023 IBM Corp + * + * Authors: + * Janosch Frank + */ +.section .text +larl %r1, time_val +spt 0 (%r1) +diag 0, 0, 0x44 +lghi %r1, 42 +diag 1, 0, 0x9c + + +.align 8 +time_val: + .quad 0x280de80000 diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg index b61faf07..df25b483 100644 --- a/s390x/unittests.cfg +++ b/s390x/unittests.cfg @@ -218,3 +218,9 @@ extra_params = -append '--parallel' [execute] file = ex.elf + +[pv-icptcode] +file = pv-icptcode.elf +smp = 3 +groups = pv-host +extra_params = -m 2200 From patchwork Mon Jun 19 08:33: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: 13284147 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 9A93CEB64DC for ; Mon, 19 Jun 2023 08:50:18 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230242AbjFSIuR (ORCPT ); Mon, 19 Jun 2023 04:50:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52864 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230467AbjFSItP (ORCPT ); Mon, 19 Jun 2023 04:49:15 -0400 Received: from mx0b-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id E50B73C19; Mon, 19 Jun 2023 01:47:40 -0700 (PDT) Received: from pps.filterd (m0353724.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 35J8H7FN029020; Mon, 19 Jun 2023 08:34:05 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=cmdQnQhlazLPaPGHb/eJWPwgmqyOgUe7vLVCn+DsO9s=; b=B82X9+wp1isKXKf9EYvMMbmaJqWxRNS8mMUQ/Ph45PdsDslbMLPIeHpRaj8I1sAwC9f6 ixUJrY2H6CSZyLqiAMkmENZlBvF3gHxFe8xr71XZi769OZ9ZNQqIeKEGIudhY/DnYHXL 1j4PrcnFg08RyULhyq4YCVMBDFTTmwn31D2QOD3z1fiIeUngPXLJB3rDhpH7wQANn73f XZJuZa2RJEb88zQfwi+uNaT2nJHg1bYcBD2NCKL9uSETpyPzvoP8JQX/8yXs61j4MLT1 S3Z4X8dj8NcY4v/x+qkXGCUyZ4kVDD/6WjUxeAwVLpOeo+78HdS+SnZIze7T7VYsxob3 7g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rakcf8a85-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:05 +0000 Received: from m0353724.ppops.net (m0353724.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 35J8JK5w002523; Mon, 19 Jun 2023 08:34:04 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 3rakcf8a7n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:04 +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 35J6RmT3030340; Mon, 19 Jun 2023 08:34:03 GMT Received: from smtprelay02.fra02v.mail.ibm.com ([9.218.2.226]) by ppma03fra.de.ibm.com (PPS) with ESMTPS id 3r94f58xet-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:02 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay02.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35J8Xxg916646734 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Jun 2023 08:33:59 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9097E2004F; Mon, 19 Jun 2023 08:33:59 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AC77220043; Mon, 19 Jun 2023 08:33:58 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 19 Jun 2023 08:33:58 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, david@redhat.com, nsg@linux.ibm.com, nrb@linux.ibm.com Subject: [kvm-unit-tests PATCH v5 7/8] s390x: pv: Add IPL reset tests Date: Mon, 19 Jun 2023 08:33:28 +0000 Message-Id: <20230619083329.22680-8-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619083329.22680-1-frankja@linux.ibm.com> References: <20230619083329.22680-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: oYqOM2Cs8UXhZmX7DA5oh4fYY6LqXoDg X-Proofpoint-ORIG-GUID: SYWS7wCAWpKzNJ-e_dY_ZFLgM07xqoiG 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-19_05,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 malwarescore=0 clxscore=1015 suspectscore=0 bulkscore=0 spamscore=0 impostorscore=0 priorityscore=1501 phishscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306190072 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The diag308 requires extensive cooperation between the hypervisor and the Ultravisor so the Ultravisor can make sure all necessary reset steps have been done. Let's check if we get the correct validity errors. Signed-off-by: Janosch Frank Reviewed-by: Nico Boehr --- s390x/Makefile | 2 + s390x/pv-ipl.c | 143 +++++++++++++++++++++++++++++++ s390x/snippets/asm/pv-diag-308.S | 51 +++++++++++ s390x/unittests.cfg | 5 ++ 4 files changed, 201 insertions(+) create mode 100644 s390x/pv-ipl.c create mode 100644 s390x/snippets/asm/pv-diag-308.S diff --git a/s390x/Makefile b/s390x/Makefile index 67be5360..b5b94810 100644 --- a/s390x/Makefile +++ b/s390x/Makefile @@ -43,6 +43,7 @@ tests += $(TEST_DIR)/ex.elf pv-tests += $(TEST_DIR)/pv-diags.elf pv-tests += $(TEST_DIR)/pv-icptcode.elf +pv-tests += $(TEST_DIR)/pv-ipl.elf ifneq ($(HOST_KEY_DOCUMENT),) ifneq ($(GEN_SE_HEADER),) @@ -130,6 +131,7 @@ $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-icpt-112.gbin $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/icpt-loop.gbin $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/loop.gbin $(TEST_DIR)/pv-icptcode.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-icpt-vir-timing.gbin +$(TEST_DIR)/pv-ipl.elf: pv-snippets += $(SNIPPET_DIR)/asm/pv-diag-308.gbin ifneq ($(GEN_SE_HEADER),) snippets += $(pv-snippets) diff --git a/s390x/pv-ipl.c b/s390x/pv-ipl.c new file mode 100644 index 00000000..cc46e7f7 --- /dev/null +++ b/s390x/pv-ipl.c @@ -0,0 +1,143 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * PV diagnose 308 (IPL) tests + * + * Copyright (c) 2023 IBM Corp + * + * Authors: + * Janosch Frank + */ +#include +#include +#include +#include +#include +#include +#include + +static struct vm vm; + +static void test_diag_308(int subcode) +{ + extern const char SNIPPET_NAME_START(asm, pv_diag_308)[]; + extern const char SNIPPET_NAME_END(asm, pv_diag_308)[]; + extern const char SNIPPET_HDR_START(asm, pv_diag_308)[]; + extern const char SNIPPET_HDR_END(asm, pv_diag_308)[]; + int size_hdr = SNIPPET_HDR_LEN(asm, pv_diag_308); + int size_gbin = SNIPPET_LEN(asm, pv_diag_308); + uint16_t rc, rrc; + int cc; + + report_prefix_pushf("subcode %d", subcode); + snippet_pv_init(&vm, SNIPPET_NAME_START(asm, pv_diag_308), + SNIPPET_HDR_START(asm, pv_diag_308), + size_gbin, size_hdr, SNIPPET_UNPACK_OFF); + + /* First exit is a diag 0x500 */ + sie(&vm); + assert(pv_icptdata_check_diag(&vm, 0x500)); + + /* + * The snippet asked us for the subcode and we answer by + * putting the value in gr2. + * SIE will copy gr2 to the guest + */ + vm.save_area.guest.grs[2] = subcode; + + /* Continue after diag 0x500, next icpt should be the 0x308 */ + sie(&vm); + assert(pv_icptdata_check_diag(&vm, 0x308)); + assert(vm.save_area.guest.grs[2] == subcode); + + /* + * We need to perform several UV calls to emulate the subcode + * 0/1. Failing to do that should result in a validity. + * + * - Mark all cpus as stopped + * - Unshare all memory + * - Prepare the reset + * - Reset the cpus + * - Load the reset PSW + */ + sie_expect_validity(&vm); + sie(&vm); + report(uv_validity_check(&vm), "validity, no action"); + + /* Mark the CPU as stopped so we can unshare and reset */ + cc = uv_set_cpu_state(vm.sblk->pv_handle_cpu, PV_CPU_STATE_STP); + report(!cc, "Set cpu stopped"); + + sie_expect_validity(&vm); + sie(&vm); + report(uv_validity_check(&vm), "validity, stopped"); + + /* Unshare all memory */ + cc = uv_cmd_nodata(vm.sblk->pv_handle_config, + UVC_CMD_SET_UNSHARED_ALL, &rc, &rrc); + report(cc == 0 && rc == 1, "Unshare all"); + + sie_expect_validity(&vm); + sie(&vm); + report(uv_validity_check(&vm), "validity, stopped, unshared"); + + /* Prepare the CPU reset */ + cc = uv_cmd_nodata(vm.sblk->pv_handle_config, + UVC_CMD_PREPARE_RESET, &rc, &rrc); + report(cc == 0 && rc == 1, "Prepare reset call"); + + sie_expect_validity(&vm); + sie(&vm); + report(uv_validity_check(&vm), "validity, stopped, unshared, prep reset"); + + /* + * Do the reset on the initiating cpu + * + * Reset clear for subcode 0 + * Reset initial for subcode 1 + */ + if (subcode == 0) { + cc = uv_cmd_nodata(vm.sblk->pv_handle_cpu, + UVC_CMD_CPU_RESET_CLEAR, &rc, &rrc); + report(cc == 0 && rc == 1, "Clear reset cpu"); + } else { + cc = uv_cmd_nodata(vm.sblk->pv_handle_cpu, + UVC_CMD_CPU_RESET_INITIAL, &rc, &rrc); + report(cc == 0 && rc == 1, "Initial reset cpu"); + } + + sie_expect_validity(&vm); + sie(&vm); + report(uv_validity_check(&vm), "validity, stopped, unshared, prep reset, cpu reset"); + + /* Load the PSW from 0x0 */ + cc = uv_set_cpu_state(vm.sblk->pv_handle_cpu, PV_CPU_STATE_OPR_LOAD); + report(!cc, "Set cpu load"); + + /* + * Check if we executed the iaddr of the reset PSW, we should + * see a diagnose 0x9c PV instruction notification. + */ + sie(&vm); + report(pv_icptdata_check_diag(&vm, 0x9c) && + vm.save_area.guest.grs[0] == 42, + "continue after load"); + + uv_destroy_guest(&vm); + report_prefix_pop(); +} + +int main(void) +{ + report_prefix_push("uv-sie"); + if (!uv_host_requirement_checks()) + goto done; + + snippet_setup_guest(&vm, true); + test_diag_308(0); + test_diag_308(1); + sie_guest_destroy(&vm); + +done: + report_prefix_pop(); + return report_summary(); +} diff --git a/s390x/snippets/asm/pv-diag-308.S b/s390x/snippets/asm/pv-diag-308.S new file mode 100644 index 00000000..70aea589 --- /dev/null +++ b/s390x/snippets/asm/pv-diag-308.S @@ -0,0 +1,51 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Diagnose 0x308 snippet used for PV IPL and reset testing + * + * Copyright (c) 2023 IBM Corp + * + * Authors: + * Janosch Frank + */ +#include +.section .text + +/* + * Entry + * Execute the diag500 which will set the diag 308 subcode in gr2 + */ +diag 0, 0, 0x500 + +/* + * A valid PGM new PSW can be a real problem since we never fall out + * of SIE and therefore effectively loop forever. 0 is a valid PSW + * therefore we re-use the reset_psw as this has the short PSW + * bit set which is invalid for a long PSW like the exception new + * PSWs. + * + * For subcode 0/1 there are no PGMs to consider. + */ +lgrl %r5, reset_psw +stg %r5, GEN_LC_PGM_NEW_PSW + +/* Set up the reset psw at 0x0 */ +lgrl %r5, reset_psw +larl %r6, done +ogr %r5, %r6 +stg %r5, 0 + +/* Diag 308, subcode is in gr2 */ +diag %r0, %r2, 0x308 + +/* Should never be executed because of the reset PSW */ +diag 0, 0, 0x44 + +/* Pass on a special value indicating success */ +done: +lghi %r1, 42 +diag %r1, 0, 0x9c + + + .align 8 +reset_psw: + .quad 0x0008000180000000 diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg index df25b483..26bab34a 100644 --- a/s390x/unittests.cfg +++ b/s390x/unittests.cfg @@ -224,3 +224,8 @@ file = pv-icptcode.elf smp = 3 groups = pv-host extra_params = -m 2200 + +[pv-ipl] +file = pv-ipl.elf +groups = pv-host +extra_params = -m 2200 From patchwork Mon Jun 19 08:33: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: 13284302 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 03BDAEB64DB for ; Mon, 19 Jun 2023 10:06:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230149AbjFSKGp (ORCPT ); Mon, 19 Jun 2023 06:06:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:51516 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230444AbjFSKGm (ORCPT ); Mon, 19 Jun 2023 06:06:42 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0B009CA; Mon, 19 Jun 2023 03:06:41 -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 35J8HNMk029921; Mon, 19 Jun 2023 08:34:07 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=5LShhLbhVao8SLBGioX3j+rejckaVYzT/Y8Ky68v3cY=; b=Xpe26JTTAMZpqNxILVxR3CWSNhs1KALwS2ZYe815zAFeZMTlt5dRpud/4OYAUgtVR29W c1nctw0knYLu1JUNVAeDgQS2l1KsWPpjwCirZDgxOFr//HwdFH6c2OCagJ1U4rvo+QM0 dIcUljHlOYEwqUukrM+fK2+DrxmUCIFTYiJL7cFqG4BsJZt+cpvRD3pUQ2UK9WpKtuDg PZWxfOxmE/sWn8FhyGpUXDo8q0q7tE22VkjQOuXkH8HzVGUEotgId9Wv9uqnv/fNwUmI TG5tK53fjZHCRC9wYOb6jpk1HIXvndZh5OSd/QFz6BdtYO5m1UT3+8LUdijQ/wKhhrHH Zw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3rakcagbcb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:07 +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 35J8Y6OQ000626; Mon, 19 Jun 2023 08:34:06 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 3rakcagbbm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:06 +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 35J10fhx000966; Mon, 19 Jun 2023 08:34:04 GMT Received: from smtprelay01.fra02v.mail.ibm.com ([9.218.2.227]) by ppma04ams.nl.ibm.com (PPS) with ESMTPS id 3r94f5980n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 19 Jun 2023 08:34:04 +0000 Received: from smtpav04.fra02v.mail.ibm.com (smtpav04.fra02v.mail.ibm.com [10.20.54.103]) by smtprelay01.fra02v.mail.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 35J8Y01B12059192 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 19 Jun 2023 08:34:00 GMT Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id AC3292005A; Mon, 19 Jun 2023 08:34:00 +0000 (GMT) Received: from smtpav04.fra02v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id BE7682004B; Mon, 19 Jun 2023 08:33:59 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by smtpav04.fra02v.mail.ibm.com (Postfix) with ESMTP; Mon, 19 Jun 2023 08:33:59 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com, david@redhat.com, nsg@linux.ibm.com, nrb@linux.ibm.com Subject: [kvm-unit-tests PATCH v5 8/8] s390x: pv-diags: Add the test to unittests.conf Date: Mon, 19 Jun 2023 08:33:29 +0000 Message-Id: <20230619083329.22680-9-frankja@linux.ibm.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20230619083329.22680-1-frankja@linux.ibm.com> References: <20230619083329.22680-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: tdyxVFk79R-VaLsQ78FF6WdM4pT-ZXGX X-Proofpoint-ORIG-GUID: sCTZqxeMvjppmd_aPhnrwbJVUjqL48Tj 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-19_05,2023-06-16_01,2023-05-22_02 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 lowpriorityscore=0 malwarescore=0 bulkscore=0 mlxscore=0 suspectscore=0 priorityscore=1501 phishscore=0 mlxlogscore=999 impostorscore=0 adultscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2305260000 definitions=main-2306190077 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Better to have it run into a 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 26bab34a..49b3cee4 100644 --- a/s390x/unittests.cfg +++ b/s390x/unittests.cfg @@ -229,3 +229,8 @@ extra_params = -m 2200 file = pv-ipl.elf groups = pv-host extra_params = -m 2200 + +[pv-diags] +file = pv-diags.elf +groups = pv-host +extra_params = -m 2200