From patchwork Wed Sep 19 09:48:56 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 10605563 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 81337112B for ; Wed, 19 Sep 2018 09:49:15 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 74FA12B42C for ; Wed, 19 Sep 2018 09:49:15 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 694842B431; Wed, 19 Sep 2018 09:49:15 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-7.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id D62722B42E for ; Wed, 19 Sep 2018 09:49:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1730392AbeISP0T (ORCPT ); Wed, 19 Sep 2018 11:26:19 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:55276 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727796AbeISP0T (ORCPT ); Wed, 19 Sep 2018 11:26:19 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8J9i2qq088098 for ; Wed, 19 Sep 2018 05:49:12 -0400 Received: from e06smtp02.uk.ibm.com (e06smtp02.uk.ibm.com [195.75.94.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 2mkkxj8hp6-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 19 Sep 2018 05:49:12 -0400 Received: from localhost by e06smtp02.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Wed, 19 Sep 2018 10:49:10 +0100 Received: from b06cxnps4075.portsmouth.uk.ibm.com (9.149.109.197) by e06smtp02.uk.ibm.com (192.168.101.132) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Wed, 19 Sep 2018 10:49:08 +0100 Received: from d06av24.portsmouth.uk.ibm.com (mk.ibm.com [9.149.105.60]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8J9n7fn65667256 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Wed, 19 Sep 2018 09:49:07 GMT Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C82334204B; Wed, 19 Sep 2018 12:48:54 +0100 (BST) Received: from d06av24.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3CEED4204C; Wed, 19 Sep 2018 12:48:54 +0100 (BST) Received: from s38lp20.lnxne.boe (unknown [9.145.184.145]) by d06av24.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 19 Sep 2018 12:48:54 +0100 (BST) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, david@redhat.com, thuth@redhat.com Subject: [kvm-unit-tests PATCH] s390x: Add prefixes to pgm interrupt checks Date: Wed, 19 Sep 2018 11:48:56 +0200 X-Mailer: git-send-email 2.14.3 X-TM-AS-GCONF: 00 x-cbid: 18091909-0008-0000-0000-000002736FCD X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18091909-0009-0000-0000-000021DBC87F Message-Id: <20180919094856.191590-1-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-19_03:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=1 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809190101 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP We need the information about which of the checks failed if there are more than one and the prefixes provide that. Signed-off-by: Janosch Frank Reviewed-by: Thomas Huth --- s390x/cmm.c | 4 ++++ s390x/diag10.c | 23 +++++++++++++++++++++++ s390x/gs.c | 8 ++++++++ s390x/iep.c | 2 ++ s390x/pfmf.c | 2 ++ s390x/skey.c | 7 +++++++ 6 files changed, 46 insertions(+) diff --git a/s390x/cmm.c b/s390x/cmm.c index 42dfda2..fe4d9df 100644 --- a/s390x/cmm.c +++ b/s390x/cmm.c @@ -29,17 +29,21 @@ static unsigned long essa(uint8_t state, unsigned long paddr) static void test_params(void) { + report_prefix_push("invalid ORC 8"); expect_pgm_int(); essa(8, (unsigned long)pagebuf); check_pgm_int_code(PGM_INT_CODE_SPECIFICATION); + report_prefix_pop(); } static void test_priv(void) { + report_prefix_push("privileged"); expect_pgm_int(); enter_pstate(); essa(0, (unsigned long)pagebuf); check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION); + report_prefix_pop(); } /* Unfortunately the availability is not indicated by stfl bits, but diff --git a/s390x/diag10.c b/s390x/diag10.c index 806ebc6..7ee8945 100644 --- a/s390x/diag10.c +++ b/s390x/diag10.c @@ -32,43 +32,66 @@ static inline void diag10(unsigned long start, unsigned long end) /* Try freeing the prefix */ static void test_prefix(void) { + report_prefix_push("lowcore freeing"); + + report_prefix_push("0x0000/0x0000"); expect_pgm_int(); diag10(0, 0); check_pgm_int_code(PGM_INT_CODE_SPECIFICATION); + report_prefix_pop(); + + report_prefix_push("0x1000/0x1000"); expect_pgm_int(); diag10(0x1000, 0x1000); check_pgm_int_code(PGM_INT_CODE_SPECIFICATION); + report_prefix_pop(); + report_prefix_push("0x0000/0x1000"); expect_pgm_int(); diag10(0, 0x1000); check_pgm_int_code(PGM_INT_CODE_SPECIFICATION); + report_prefix_pop(); + + report_prefix_pop(); } static void test_params(void) { + report_prefix_push("start/end"); + /* end < start */ + report_prefix_push("end < start"); expect_pgm_int(); diag10(page1, page0); check_pgm_int_code(PGM_INT_CODE_SPECIFICATION); + report_prefix_pop(); /* Unaligned start */ + report_prefix_push("unaligned start"); expect_pgm_int(); diag10((unsigned long) pagebuf + 42, page1); check_pgm_int_code(PGM_INT_CODE_SPECIFICATION); + report_prefix_pop(); /* Unaligned end */ + report_prefix_push("unaligned end"); expect_pgm_int(); diag10(page0, (unsigned long) pagebuf + PAGE_SIZE + 42); check_pgm_int_code(PGM_INT_CODE_SPECIFICATION); + report_prefix_pop(); + + report_prefix_pop(); } static void test_priv(void) { + report_prefix_push("privileged"); expect_pgm_int(); enter_pstate(); diag10(page0, page0); check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION); + report_prefix_pop(); } int main(void) diff --git a/s390x/gs.c b/s390x/gs.c index bddc2b4..26f22e8 100644 --- a/s390x/gs.c +++ b/s390x/gs.c @@ -128,12 +128,20 @@ static void test_load(void) /* Test gs instructions without enablement resulting in an exception */ static void test_special(void) { + report_prefix_push("disabled gs"); + report_prefix_push("load gs"); expect_pgm_int(); load_gs_cb(&gs_cb); check_pgm_int_code(PGM_INT_CODE_SPECIAL_OPERATION); + report_prefix_pop(); + + report_prefix_push("store gs"); expect_pgm_int(); store_gs_cb(&gs_cb); check_pgm_int_code(PGM_INT_CODE_SPECIAL_OPERATION); + report_prefix_pop(); + + report_prefix_pop(); } static void init(void) diff --git a/s390x/iep.c b/s390x/iep.c index 8c1ea8f..9f98b09 100644 --- a/s390x/iep.c +++ b/s390x/iep.c @@ -38,7 +38,9 @@ static void test_iep(void) expect_pgm_int(); /* Jump into protected page */ fn(); + report_prefix_push("iep protection"); check_pgm_int_code(PGM_INT_CODE_PROTECTION); + report_prefix_pop(); unprotect_page(iepbuf, PAGE_ENTRY_IEP); ctl_clear_bit(0, 20); } diff --git a/s390x/pfmf.c b/s390x/pfmf.c index 2268fd0..5e61267 100644 --- a/s390x/pfmf.c +++ b/s390x/pfmf.c @@ -51,10 +51,12 @@ static inline unsigned long pfmf(unsigned long r1, unsigned long paddr) static void test_priv(void) { + report_prefix_push("privileged"); expect_pgm_int(); enter_pstate(); pfmf(0, (unsigned long) pagebuf); check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION); + report_prefix_pop(); } static void test_4k_key(void) diff --git a/s390x/skey.c b/s390x/skey.c index e4c2a43..1949533 100644 --- a/s390x/skey.c +++ b/s390x/skey.c @@ -68,18 +68,25 @@ static void test_priv(void) union skey skey; memset(pagebuf, 0, PAGE_SIZE * 2); + report_prefix_push("privileged"); + report_prefix_push("sske"); expect_pgm_int(); enter_pstate(); set_storage_key(page0, 0x30, 0); check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION); + report_prefix_pop(); skey.val = get_storage_key(page0); report("skey did not change on exception", skey.str.acc != 3); + report_prefix_push("iske"); expect_pgm_int(); enter_pstate(); get_storage_key(page0); check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION); + report_prefix_pop(); + + report_prefix_pop(); } int main(void)