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 157EEC32792 for ; Tue, 23 Aug 2022 11:27:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241674AbiHWL1w (ORCPT ); Tue, 23 Aug 2022 07:27:52 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60492 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S241501AbiHWLXo (ORCPT ); Tue, 23 Aug 2022 07:23:44 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D23206BD74 for ; Tue, 23 Aug 2022 02:23:41 -0700 (PDT) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 27N946dT016552 for ; Tue, 23 Aug 2022 09:23:40 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : date : mime-version : subject : to : cc : references : from : in-reply-to : content-type : content-transfer-encoding; s=pp1; bh=2qSX64/vVLrlJvYnjsafiMFjmkve5UEdOg3pry6ohRw=; b=HU5frb3FqkVMUQJ6dT6WTTml3PH0IFirc+4Gz3FijehMnep2onUUIJ0+7BXJfxm8DAOr 8d4+9hvdjaVA86nWHB/himHWeGgjSEEwFhGDzSWVnRH5WoO0V5SS3xFiU6Iob32/VN4u pJD7AHhGuQCilNNJZnbNmLl90+o8VFi3JU/4SrHOnCWMJrpeJHX6nV5q94sJos+s+vRn qHyPptTUqTQFqtItmfEo5siCgd/h47zgORZXquegrePWaWNwVn7U69Mv49JUwdnXoGTF TaWgsHppkH9bi221TtB9y5hbvLrVzCT/f9HT0x19liLzIp7rEfT4hf2lh54MMvHAV98Q 0g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3j4ux80gte-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 23 Aug 2022 09:23:40 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 27N94BpL016720 for ; Tue, 23 Aug 2022 09:23:39 GMT Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3j4ux80gt2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Aug 2022 09:23:39 +0000 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 27N9KhnQ000373; Tue, 23 Aug 2022 09:23:38 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma02fra.de.ibm.com with ESMTP id 3j2q88tk5w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 23 Aug 2022 09:23:37 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 27N9NY0t32178446 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 23 Aug 2022 09:23:34 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C3D14A405C; Tue, 23 Aug 2022 09:23:34 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8D675A405B; Tue, 23 Aug 2022 09:23:34 +0000 (GMT) Received: from [9.145.84.26] (unknown [9.145.84.26]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Tue, 23 Aug 2022 09:23:34 +0000 (GMT) Message-ID: <63549dea-135d-06ff-f6da-9e50ff91c715@linux.ibm.com> Date: Tue, 23 Aug 2022 11:23:34 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.9.0 Subject: Re: [kvm-unit-tests PATCH v5 4/4] s390x: add pgm spec interrupt loop test Content-Language: en-US To: Nico Boehr , kvm@vger.kernel.org Cc: imbrenda@linux.ibm.com, thuth@redhat.com References: <20220823084525.52365-1-nrb@linux.ibm.com> <20220823084525.52365-5-nrb@linux.ibm.com> From: Janosch Frank In-Reply-To: <20220823084525.52365-5-nrb@linux.ibm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: AyY65JGJto78KiE4VysERajFw3D1kBJd X-Proofpoint-ORIG-GUID: xxEcujtbDuRvyExfFkGMAVr3I3tZddhW X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.517,FMLib:17.11.122.1 definitions=2022-08-23_04,2022-08-22_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 priorityscore=1501 malwarescore=0 adultscore=0 suspectscore=0 spamscore=0 bulkscore=0 phishscore=0 clxscore=1015 impostorscore=0 mlxscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2207270000 definitions=main-2208230035 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org On 8/23/22 10:45, Nico Boehr wrote: > An invalid PSW causes a program interrupt. When an invalid PSW is > introduced in the pgm_new_psw, an interrupt loop occurs as soon as a > program interrupt is caused. > > QEMU should detect that and panic the guest, hence add a test for it. > > Signed-off-by: Nico Boehr > Reviewed-by: Claudio Imbrenda Reviewed-by: Janosch Frank > --- > s390x/Makefile | 1 + > s390x/panic-loop-pgm.c | 38 ++++++++++++++++++++++++++++++++++++++ > s390x/unittests.cfg | 6 ++++++ > 3 files changed, 45 insertions(+) > create mode 100644 s390x/panic-loop-pgm.c > > diff --git a/s390x/Makefile b/s390x/Makefile > index e4649da50d9d..66415d0b588d 100644 > --- a/s390x/Makefile > +++ b/s390x/Makefile > @@ -35,6 +35,7 @@ tests += $(TEST_DIR)/pv-attest.elf > tests += $(TEST_DIR)/migration-cmm.elf > tests += $(TEST_DIR)/migration-skey.elf > tests += $(TEST_DIR)/panic-loop-extint.elf > +tests += $(TEST_DIR)/panic-loop-pgm.elf > > pv-tests += $(TEST_DIR)/pv-diags.elf > > diff --git a/s390x/panic-loop-pgm.c b/s390x/panic-loop-pgm.c > new file mode 100644 > index 000000000000..23e973477f68 > --- /dev/null > +++ b/s390x/panic-loop-pgm.c > @@ -0,0 +1,38 @@ > +/* SPDX-License-Identifier: GPL-2.0-only */ > +/* > + * Program interrupt loop test > + * > + * Copyright IBM Corp. 2022 > + * > + * Authors: > + * Nico Boehr > + */ > +#include > +#include > +#include > +#include > +#include > + > +int main(void) > +{ > + report_prefix_push("panic-loop-pgm"); > + > + if (!host_is_qemu() || host_is_tcg()) { > + report_skip("QEMU-KVM-only test"); > + goto out; > + } > + > + expect_pgm_int(); > + /* bit 12 set is invalid */ > + lowcore.pgm_new_psw.mask = extract_psw_mask() | BIT(63 - 12); > + mb(); > + > + /* cause a pgm int */ > + psw_mask_set_bits(BIT(63 - 12)); > + > + report_fail("survived pgm int loop"); > + > +out: > + report_prefix_pop(); > + return report_summary(); > +} > diff --git a/s390x/unittests.cfg b/s390x/unittests.cfg > index b1b25f118ff6..f9f102abfa89 100644 > --- a/s390x/unittests.cfg > +++ b/s390x/unittests.cfg > @@ -191,3 +191,9 @@ file = panic-loop-extint.elf > groups = panic > accel = kvm > timeout = 5 > + > +[panic-loop-pgm] > +file = panic-loop-pgm.elf > +groups = panic > +accel = kvm > +timeout = 5