From patchwork Thu Apr 7 08:44:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12804753 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 75DEAC43219 for ; Thu, 7 Apr 2022 08:44:48 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S243261AbiDGIqp (ORCPT ); Thu, 7 Apr 2022 04:46:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S243246AbiDGIqh (ORCPT ); Thu, 7 Apr 2022 04:46:37 -0400 Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 67BEF1834ED; Thu, 7 Apr 2022 01:44:38 -0700 (PDT) Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.1.2/8.16.1.2) with SMTP id 2376A8wm029032; Thu, 7 Apr 2022 08:44:38 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=hes7G/aASAmZz0j8yh3Xkg5MWFQXd3DQafpcGBQxmZQ=; b=LWakQScaMDHMy34jMvAG86vGqG54mxx6ulPGXcGhTccNOOiFkLaqDO2BR0p4ZXvfOPUh F03U3O/BvFQ07uc8w31AZJqsEQWJ79fFDxN2p+Mjh/OnKdcjNNjzRRFCyMXJ60r4HjEH o8hQfELKGzpcdJOrBgKNUOODw5Gp7ENlSQZfAN6ajrwsMBQ0qM7cS3rvwXFxv76cOCiu zi2QsVznB6PNXdxRaQ4jfsB3HjiUPSLtaRqSzDoVDUMbESttROfBhEU4jFgunGy6ol0x v72JqSpOF20Mv/f/W4NXyaXC+Wy3LwttlIu7gjWI1/Jq8fbcGECTto7lKAviKZKV3Wz6 9Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 3f97nbh454-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 Apr 2022 08:44:37 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 2378LbhF020762; Thu, 7 Apr 2022 08:44:37 GMT Received: from ppma06ams.nl.ibm.com (66.31.33a9.ip4.static.sl-reverse.com [169.51.49.102]) by mx0a-001b2d01.pphosted.com with ESMTP id 3f97nbh44a-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 Apr 2022 08:44:37 +0000 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2378XL0Y001563; Thu, 7 Apr 2022 08:44:35 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma06ams.nl.ibm.com with ESMTP id 3f6drhsdbg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 07 Apr 2022 08:44:35 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2378iWGN37093828 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 7 Apr 2022 08:44:32 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 173B7AE055; Thu, 7 Apr 2022 08:44:32 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 55630AE053; Thu, 7 Apr 2022 08:44:31 +0000 (GMT) Received: from linux6.. (unknown [9.114.12.104]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 7 Apr 2022 08:44:31 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, david@redhat.com, thuth@redhat.com, nrb@linux.ibm.com, seiden@linux.ibm.com Subject: [kvm-unit-tests PATCH v2 3/9] s390x: diag308: Only test subcode 2 under QEMU Date: Thu, 7 Apr 2022 08:44:15 +0000 Message-Id: <20220407084421.2811-4-frankja@linux.ibm.com> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20220407084421.2811-1-frankja@linux.ibm.com> References: <20220407084421.2811-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 8Z3mXdefR3yv0UkFmvv9u9tcPlRq7yUq X-Proofpoint-ORIG-GUID: PBlC8-bx1A71B-MG5VvbgUEP-fMMk5dc X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.850,Hydra:6.0.425,FMLib:17.11.64.514 definitions=2022-04-06_13,2022-04-06_01,2022-02-23_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 clxscore=1015 malwarescore=0 priorityscore=1501 phishscore=0 bulkscore=0 spamscore=0 mlxlogscore=898 adultscore=0 lowpriorityscore=0 impostorscore=0 suspectscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2202240000 definitions=main-2204070043 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Other hypervisors might implement it and therefore not send a specification exception. Signed-off-by: Janosch Frank --- s390x/diag308.c | 15 ++++++++++++++- 1 file changed, 14 insertions(+), 1 deletion(-) diff --git a/s390x/diag308.c b/s390x/diag308.c index c9d6c499..ae5f5a5f 100644 --- a/s390x/diag308.c +++ b/s390x/diag308.c @@ -8,6 +8,7 @@ #include #include #include +#include /* The diagnose calls should be blocked in problem state */ static void test_priv(void) @@ -75,7 +76,7 @@ static void test_subcode6(void) /* Unsupported subcodes should generate a specification exception */ static void test_unsupported_subcode(void) { - int subcodes[] = { 2, 0x101, 0xffff, 0x10001, -1 }; + int subcodes[] = { 0x101, 0xffff, 0x10001, -1 }; int idx; for (idx = 0; idx < ARRAY_SIZE(subcodes); idx++) { @@ -85,6 +86,18 @@ static void test_unsupported_subcode(void) check_pgm_int_code(PGM_INT_CODE_SPECIFICATION); report_prefix_pop(); } + + /* + * Subcode 2 is not available under QEMU but might be on other + * hypervisors. + */ + if (host_is_qemu()) { + report_prefix_pushf("0x%04x", 2); + expect_pgm_int(); + asm volatile ("diag %0,%1,0x308" :: "d"(0), "d"(2)); + check_pgm_int_code(PGM_INT_CODE_SPECIFICATION); + report_prefix_pop(); + } } static struct {