From patchwork Tue Feb 19 08:49:12 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 10819479 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 9A38613B5 for ; Tue, 19 Feb 2019 08:49:38 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8562C2B331 for ; Tue, 19 Feb 2019 08:49:38 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 767632B3E2; Tue, 19 Feb 2019 08:49:38 +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 371E72B331 for ; Tue, 19 Feb 2019 08:49:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727538AbfBSItg (ORCPT ); Tue, 19 Feb 2019 03:49:36 -0500 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:37196 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727244AbfBSItf (ORCPT ); Tue, 19 Feb 2019 03:49:35 -0500 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x1J8i8aR040512 for ; Tue, 19 Feb 2019 03:49:34 -0500 Received: from e06smtp07.uk.ibm.com (e06smtp07.uk.ibm.com [195.75.94.103]) by mx0a-001b2d01.pphosted.com with ESMTP id 2qrcvmpg8j-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Tue, 19 Feb 2019 03:49:34 -0500 Received: from localhost by e06smtp07.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Tue, 19 Feb 2019 08:49:31 -0000 Received: from b06cxnps4074.portsmouth.uk.ibm.com (9.149.109.196) by e06smtp07.uk.ibm.com (192.168.101.137) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Tue, 19 Feb 2019 08:49:30 -0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id x1J8nTRL27525166 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Tue, 19 Feb 2019 08:49:29 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 0B4B652050; Tue, 19 Feb 2019 08:49:29 +0000 (GMT) Received: from s38lp20.lnxne.boe (unknown [9.152.224.63]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id C1B595204E; Tue, 19 Feb 2019 08:49:28 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: linux-s390@vger.kernel.org, david@redhat.com, thuth@redhat.co Subject: [kvm-unit-tests PATCH 2/3] s390x: Beautify pfmf report strings Date: Tue, 19 Feb 2019 09:49:12 +0100 X-Mailer: git-send-email 2.14.3 In-Reply-To: <20190219084913.198737-1-frankja@linux.ibm.com> References: <20190219084913.198737-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 19021908-0028-0000-0000-0000034A425F X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 19021908-0029-0000-0000-000024087D0B Message-Id: <20190219084913.198737-3-frankja@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2019-02-19_06:,, 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=843 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1810050000 definitions=main-1902190067 Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Use a 4k/1m prefix rather than mangling it into the report string. Signed-off-by: Janosch Frank --- s390x/pfmf.c | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/s390x/pfmf.c b/s390x/pfmf.c index 4cc6bd1..340b0bd 100644 --- a/s390x/pfmf.c +++ b/s390x/pfmf.c @@ -64,6 +64,7 @@ static void test_4k_key(void) union r1 r1; union skey skey; + report_prefix_push("4K"); r1.val = 0; r1.reg.sk = 1; r1.reg.fsc = FSC_4K; @@ -71,7 +72,8 @@ static void test_4k_key(void) pfmf(r1.val, (unsigned long) pagebuf); skey.val = get_storage_key((unsigned long) pagebuf); skey.val &= SKEY_ACC | SKEY_FP; - report("set 4k", skey.val == 0x30); + report("set storage keys", skey.val == 0x30); + report_prefix_pop(); } static void test_1m_key(void) @@ -80,6 +82,7 @@ static void test_1m_key(void) union r1 r1; union skey skey; + report_prefix_push("1M"); r1.val = 0; r1.reg.sk = 1; r1.reg.fsc = FSC_1M; @@ -89,11 +92,12 @@ static void test_1m_key(void) skey.val = get_storage_key((unsigned long) pagebuf + i * PAGE_SIZE); skey.val &= SKEY_ACC | SKEY_FP; if (skey.val != 0x30) { - report("set 1M", false); + report("set storage keys", false); return; } } - report("set 1M", true); + report("set storage keys", true); + report_prefix_pop(); } static void test_4k_clear(void) @@ -104,9 +108,11 @@ static void test_4k_clear(void) r1.reg.cf = 1; r1.reg.fsc = FSC_4K; + report_prefix_push("4K"); memset(pagebuf, 42, PAGE_SIZE); pfmf(r1.val, (unsigned long) pagebuf); - report("clear 4k", !memcmp(pagebuf, pagebuf + PAGE_SIZE, PAGE_SIZE)); + report("clear memory", !memcmp(pagebuf, pagebuf + PAGE_SIZE, PAGE_SIZE)); + report_prefix_pop(); } static void test_1m_clear(void) @@ -119,11 +125,13 @@ static void test_1m_clear(void) r1.reg.cf = 1; r1.reg.fsc = FSC_1M; + report_prefix_push("1M"); memset(pagebuf, 42, PAGE_SIZE * 256); pfmf(r1.val, (unsigned long) pagebuf); for (i = 0; i < PAGE_SIZE * 256; i++) sum |= pagebuf[i]; report("clear 1m", !sum); + report_prefix_pop(); } int main(void) @@ -141,8 +149,8 @@ int main(void) memset(pagebuf, 0, PAGE_SIZE * 256); test_4k_key(); - test_1m_key(); test_4k_clear(); + test_1m_key(); test_1m_clear(); done: