From patchwork Wed May 5 08:42:53 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12239355 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id A4ADDC4360C for ; Wed, 5 May 2021 08:43:38 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 74F6B6121F for ; Wed, 5 May 2021 08:43:38 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232141AbhEEIod (ORCPT ); Wed, 5 May 2021 04:44:33 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:19732 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231923AbhEEIoa (ORCPT ); Wed, 5 May 2021 04:44:30 -0400 Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1458XhwE042809; Wed, 5 May 2021 04:43:33 -0400 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 : content-transfer-encoding : mime-version; s=pp1; bh=GdFoX1wU6DPtisMn3o8P172njLGjYpCBNdARkJ6xn1M=; b=l49g6YuJTh2/j4qYNOFJ6WXZkLcjX3HOa5oHM1jlhv3cHA4ArTnuccSGc/PxSDSHOCRd KZWa+JRewfAtjWfzKnG1wb03DsZ54UfXZ3u5TKiIFKcNPW02sPuT1xldZRpE2L4SJ5ua pPfVgEVTDCf3z+rS6MYZoVlbOCBBExlIXAR85x2Ne8nva3afSLqwg0Xx5cy0aef4vcI1 d02X0WSf0dMpEs54lTuP3fYcar8FkTjc1VGzPBnQgq2hRhh+3xaNlkRO0OQvRpzKrySS 9RhGMf2xJo1naLleByUOR4yavRjdxJpVYflwQUsTTREnGyROoFwMzrvhav4eboE3jz6r vg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 38bpu1a200-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:33 -0400 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1458aufk056054; Wed, 5 May 2021 04:43:33 -0400 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0b-001b2d01.pphosted.com with ESMTP id 38bpu1a1yf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:32 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1458h920026813; Wed, 5 May 2021 08:43:31 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma03fra.de.ibm.com with ESMTP id 38beebg3jg-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 08:43:31 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1458h2m335979752 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 May 2021 08:43:02 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 212D8A405B; Wed, 5 May 2021 08:43:28 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 88241A405C; Wed, 5 May 2021 08:43:27 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.65.32]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 5 May 2021 08:43:27 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 1/9] s390x: mvpg: add checks for op_acc_id Date: Wed, 5 May 2021 10:42:53 +0200 Message-Id: <20210505084301.17395-2-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505084301.17395-1-frankja@linux.ibm.com> References: <20210505084301.17395-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: yXDnp0xwnVDb5_kJCE1ilQ-58pgfDUe1 X-Proofpoint-GUID: jXUpoxw74SarxpXGnHPGL6M-UxtJ2360 X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-05_02:2021-05-05,2021-05-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 clxscore=1015 bulkscore=0 mlxscore=0 spamscore=0 adultscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 lowpriorityscore=0 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105050063 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Claudio Imbrenda Check the operand access identification when MVPG causes a page fault. Signed-off-by: Claudio Imbrenda Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth Reviewed-by: Janosch Frank Link: https://lore.kernel.org/kvm/20210427121608.157783-1-imbrenda@linux.ibm.com/ Signed-off-by: Janosch Frank --- s390x/mvpg.c | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/s390x/mvpg.c b/s390x/mvpg.c index 5743d5b6..2b7c6cc9 100644 --- a/s390x/mvpg.c +++ b/s390x/mvpg.c @@ -36,6 +36,7 @@ static uint8_t source[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE))); static uint8_t buffer[PAGE_SIZE] __attribute__((aligned(PAGE_SIZE))); +static struct lowcore * const lc; /* Keep track of fresh memory */ static uint8_t *fresh; @@ -77,6 +78,21 @@ static int page_ok(const uint8_t *p) return 1; } +/* + * Check that the Operand Access Identification matches with the values of + * the r1 and r2 fields in the instruction format. The r1 and r2 fields are + * in the last byte of the instruction, and the Program Old PSW will point + * to the beginning of the instruction after the one that caused the fault + * (the fixup code in the interrupt handler takes care of that for + * nullifying instructions). Therefore it is enough to compare the byte + * before the one contained in the Program Old PSW with the value of the + * Operand Access Identification. + */ +static inline bool check_oai(void) +{ + return *(uint8_t *)(lc->pgm_old_psw.addr - 1) == lc->op_acc_id; +} + static void test_exceptions(void) { int i, expected; @@ -201,17 +217,25 @@ static void test_mmu_prot(void) report(clear_pgm_int() == PGM_INT_CODE_PROTECTION, "destination read only"); fresh += PAGE_SIZE; + report_prefix_push("source invalid"); protect_page(source, PAGE_ENTRY_I); + lc->op_acc_id = 0; expect_pgm_int(); mvpg(0, fresh, source); - report(clear_pgm_int() == PGM_INT_CODE_PAGE_TRANSLATION, "source invalid"); + report(clear_pgm_int() == PGM_INT_CODE_PAGE_TRANSLATION, "exception"); unprotect_page(source, PAGE_ENTRY_I); + report(check_oai(), "operand access ident"); + report_prefix_pop(); fresh += PAGE_SIZE; + report_prefix_push("destination invalid"); protect_page(fresh, PAGE_ENTRY_I); + lc->op_acc_id = 0; expect_pgm_int(); mvpg(0, fresh, source); - report(clear_pgm_int() == PGM_INT_CODE_PAGE_TRANSLATION, "destination invalid"); + report(clear_pgm_int() == PGM_INT_CODE_PAGE_TRANSLATION, "exception"); + report(check_oai(), "operand access ident"); + report_prefix_pop(); fresh += PAGE_SIZE; report_prefix_pop(); From patchwork Wed May 5 08:42:54 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12239353 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 91C73C43461 for ; Wed, 5 May 2021 08:43:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 539B66121F for ; Wed, 5 May 2021 08:43:37 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232133AbhEEIoc (ORCPT ); Wed, 5 May 2021 04:44:32 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:56098 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232016AbhEEIoa (ORCPT ); Wed, 5 May 2021 04:44:30 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1458WgLh037446; Wed, 5 May 2021 04:43:33 -0400 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 : content-transfer-encoding : mime-version; s=pp1; bh=TwBEtCKBMBu56emLAoF0kLyHK7HSxyT6l/De0e4AC5M=; b=e4cNz3ONL4R3+U9mu2sNog/bMk8elnSa0Cd2Kuj0naqO4xbpsmoD91D1TWSzta+SuUWw 9N1FWpeuWgdeB3v5eMNvZ12IlJax6PxzcoWBeV5vOZO2EKaZ7Kfth5pF6VM43XNtB+Lo INYp9BgSEm1VFMc4Pnlf1/hmMND9/rnbVK+BjELv5nQLzgJbuNob4OhlMCzAEZnAO0Pz bl2kmm+vE1UXDaq4jc/b7INmuAO6V0sUGcJE8I82SP44PCK3M63CWzt2NsETu8iVA6YM 7j/zL1vYetf9nZx4t1ZwRS8s0V9+OBFF3vFfj3bOeNKVQzeqIXPFmFL9rZ7V1zD65SgI iw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bqdn94ra-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:33 -0400 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1458Wqjd037914; Wed, 5 May 2021 04:43:33 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bqdn94qv-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:33 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1458gq4A021490; Wed, 5 May 2021 08:43:31 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma03ams.nl.ibm.com with ESMTP id 38bedxr6ax-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 08:43:31 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1458h3aF29753748 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 May 2021 08:43:03 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C4B8EA405F; Wed, 5 May 2021 08:43:28 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3932FA405C; Wed, 5 May 2021 08:43:28 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.65.32]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 5 May 2021 08:43:28 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 2/9] s390x: css: Store CSS Characteristics Date: Wed, 5 May 2021 10:42:54 +0200 Message-Id: <20210505084301.17395-3-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505084301.17395-1-frankja@linux.ibm.com> References: <20210505084301.17395-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: -e9siCLwZBsXqmSWJHhbWI1l8u_ZTsd1 X-Proofpoint-ORIG-GUID: XVQBZGoRsFezYtVtUH46xi98yjg-v3fV X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-05_03:2021-05-05,2021-05-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 suspectscore=0 spamscore=0 clxscore=1011 mlxscore=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 bulkscore=0 adultscore=0 lowpriorityscore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105050063 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Pierre Morel CSS characteristics exposes the features of the Channel SubSystem. Let's use Store Channel Subsystem Characteristics to retrieve the features of the CSS. Signed-off-by: Pierre Morel Reviewed-by: Cornelia Huck Acked-by: Janosch Frank Link: https://lore.kernel.org/kvm/1615545714-13747-2-git-send-email-pmorel@linux.ibm.com/ Signed-off-by: Janosch Frank --- lib/s390x/css.h | 66 ++++++++++++++++++++++++++++++++ lib/s390x/css_lib.c | 93 ++++++++++++++++++++++++++++++++++++++++++++- s390x/css.c | 8 ++++ 3 files changed, 166 insertions(+), 1 deletion(-) diff --git a/lib/s390x/css.h b/lib/s390x/css.h index 3e574455..3dc2f313 100644 --- a/lib/s390x/css.h +++ b/lib/s390x/css.h @@ -288,4 +288,70 @@ int css_residual_count(unsigned int schid); void enable_io_isc(uint8_t isc); int wait_and_check_io_completion(int schid); +/* + * CHSC definitions + */ +struct chsc_header { + uint16_t len; + uint16_t code; +}; + +/* Store Channel Subsystem Characteristics */ +struct chsc_scsc { + struct chsc_header req; + uint16_t req_fmt; + uint8_t cssid; + uint8_t reserved[9]; + struct chsc_header res; + uint32_t res_fmt; + uint64_t general_char[255]; + uint64_t chsc_char[254]; +}; + +extern struct chsc_scsc *chsc_scsc; +#define CHSC_SCSC 0x0010 +#define CHSC_SCSC_LEN 0x0010 + +bool get_chsc_scsc(void); + +#define CSS_GENERAL_FEAT_BITLEN (255 * 64) +#define CSS_CHSC_FEAT_BITLEN (254 * 64) + +#define CHSC_SCSC 0x0010 +#define CHSC_SCSC_LEN 0x0010 + +#define CHSC_ERROR 0x0000 +#define CHSC_RSP_OK 0x0001 +#define CHSC_RSP_INVAL 0x0002 +#define CHSC_RSP_REQERR 0x0003 +#define CHSC_RSP_ENOCMD 0x0004 +#define CHSC_RSP_NODATA 0x0005 +#define CHSC_RSP_SUP31B 0x0006 +#define CHSC_RSP_EFRMT 0x0007 +#define CHSC_RSP_ECSSID 0x0008 +#define CHSC_RSP_ERFRMT 0x0009 +#define CHSC_RSP_ESSID 0x000A +#define CHSC_RSP_EBUSY 0x000B +#define CHSC_RSP_MAX 0x000B + +static inline int _chsc(void *p) +{ + int cc; + + asm volatile(" .insn rre,0xb25f0000,%2,0\n" + " ipm %0\n" + " srl %0,28\n" + : "=d" (cc), "=m" (p) + : "d" (p), "m" (p) + : "cc"); + + return cc; +} + +bool chsc(void *p, uint16_t code, uint16_t len); + +#include +#define css_test_general_feature(bit) test_bit_inv(bit, chsc_scsc->general_char) +#define css_test_chsc_feature(bit) test_bit_inv(bit, chsc_scsc->chsc_char) + #endif diff --git a/lib/s390x/css_lib.c b/lib/s390x/css_lib.c index 3c244801..3c1acbfb 100644 --- a/lib/s390x/css_lib.c +++ b/lib/s390x/css_lib.c @@ -15,11 +15,102 @@ #include #include #include - +#include #include #include static struct schib schib; +struct chsc_scsc *chsc_scsc; + +static const char * const chsc_rsp_description[] = { + "CHSC unknown error", + "Command executed", + "Invalid command", + "Request-block error", + "Command not installed", + "Data not available", + "Absolute address of channel-subsystem communication block exceeds 2G - 1.", + "Invalid command format", + "Invalid channel-subsystem identification (CSSID)", + "The command-request block specified an invalid format for the command response block.", + "Invalid subchannel-set identification (SSID)", + "A busy condition precludes execution.", +}; + +static bool check_response(void *p) +{ + struct chsc_header *h = p; + + if (h->code == CHSC_RSP_OK) + return true; + + if (h->code > CHSC_RSP_MAX) + h->code = 0; + + report_abort("Response code %04x: %s", h->code, + chsc_rsp_description[h->code]); + return false; +} + +bool chsc(void *p, uint16_t code, uint16_t len) +{ + struct chsc_header *h = p; + + h->code = code; + h->len = len; + + switch (_chsc(p)) { + case 3: + report_abort("Subchannel invalid or not enabled."); + break; + case 2: + report_abort("CHSC subchannel busy."); + break; + case 1: + report_abort("Subchannel invalid or not enabled."); + break; + case 0: + return check_response(p + len); + } + return false; +} + +bool get_chsc_scsc(void) +{ + int i, n; + char buffer[510]; + char *p; + + if (chsc_scsc) /* chsc_scsc already initialized */ + return true; + + chsc_scsc = alloc_page(); + if (!chsc_scsc) { + report_abort("could not allocate chsc_scsc page!"); + return false; + } + + if (!chsc(chsc_scsc, CHSC_SCSC, CHSC_SCSC_LEN)) + return false; + + for (i = 0, p = buffer; i < CSS_GENERAL_FEAT_BITLEN; i++) { + if (css_test_general_feature(i)) { + n = snprintf(p, sizeof(buffer), "%d,", i); + p += n; + } + } + report_info("General features: %s", buffer); + + for (i = 0, p = buffer; i < CSS_CHSC_FEAT_BITLEN; i++) { + if (css_test_chsc_feature(i)) { + n = snprintf(p, sizeof(buffer), "%d,", i); + p += n; + } + } + report_info("CHSC features: %s", buffer); + + return true; +} /* * css_enumerate: diff --git a/s390x/css.c b/s390x/css.c index 1a61a5c2..12036b3b 100644 --- a/s390x/css.c +++ b/s390x/css.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include @@ -140,10 +141,17 @@ error_senseid: unregister_io_int_func(css_irq_io); } +static void css_init(void) +{ + report(get_chsc_scsc(), "Store Channel Characteristics"); +} + static struct { const char *name; void (*func)(void); } tests[] = { + /* The css_init test is needed to initialize the CSS Characteristics */ + { "initialize CSS (chsc)", css_init }, { "enumerate (stsch)", test_enumerate }, { "enable (msch)", test_enable }, { "sense (ssch/tsch)", test_sense }, From patchwork Wed May 5 08:42:55 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12239357 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 58BABC43611 for ; Wed, 5 May 2021 08:43:40 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 34B5C613AA for ; Wed, 5 May 2021 08:43:40 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232180AbhEEIof (ORCPT ); Wed, 5 May 2021 04:44:35 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:44518 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232098AbhEEIob (ORCPT ); Wed, 5 May 2021 04:44:31 -0400 Received: from pps.filterd (m0098417.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1458X99x013577; Wed, 5 May 2021 04:43:35 -0400 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 : content-transfer-encoding : mime-version; s=pp1; bh=3rqZA6nLtA5Bvc9E3ATsoIzOl9MJtriwsypShRZXov0=; b=W84EpfsSdAxF1+hUtInM4g04DXCkX3qdf+aMyS/hdZZLorN3MXGfBEdawKMXEoIFX6Yy HuMHa3RwmBnq+LTSpzT68RbLyyVuI2j9zCfVv+YD0Xswn1WaTUtDAgPF1JW0QINYfL7y 3dbt1s/LbJ+HmDkHHZllAqewBsavC25cKdC1GLapK1XTD9kLajg+v0eH+Tz4slZ7r0Ur 47UG0uArn5CARdXZrU6LB+xKBw677jqR9G46PpAOmqvQ311chMwtVyHpljHTmfRY0Dja sRttZmAOYyVWsVOaScCN+SD1374fmWXYrtxBzHvC+wozvdvKYYQ85Ub3VG+q5WZF33SY Eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bqnp8q8v-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:35 -0400 Received: from m0098417.ppops.net (m0098417.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1458XNJR014790; Wed, 5 May 2021 04:43:34 -0400 Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bqnp8q85-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:34 -0400 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1458hWb9004470; Wed, 5 May 2021 08:43:32 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma05fra.de.ibm.com with ESMTP id 38beea83k7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 08:43:32 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1458h3G935782974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 May 2021 08:43:04 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72F39A405F; Wed, 5 May 2021 08:43:29 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DC7DBA405C; Wed, 5 May 2021 08:43:28 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.65.32]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 5 May 2021 08:43:28 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 3/9] s390x: css: simplifications of the tests Date: Wed, 5 May 2021 10:42:55 +0200 Message-Id: <20210505084301.17395-4-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505084301.17395-1-frankja@linux.ibm.com> References: <20210505084301.17395-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: hXUKUmVwBwsUKDIbDclvEB08V4krAOPC X-Proofpoint-GUID: PWN94W-ANbHM_eyvDqDsmBpxcEfh7B1V X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-05_03:2021-05-05,2021-05-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 mlxlogscore=999 mlxscore=0 malwarescore=0 spamscore=0 suspectscore=0 lowpriorityscore=0 priorityscore=1501 phishscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105050063 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Pierre Morel In order to ease the writing of tests based on: - interrupt - enabling a subchannel - using multiple I/O on a channel without disabling it We do the following simplifications: - the I/O interrupt handler is registered on CSS initialization - We do not enable again a subchannel in senseid if it is already enabled - we add a css_enabled() function to test if a subchannel is enabled Signed-off-by: Pierre Morel Reviewed-by: Cornelia Huck Acked-by: Janosch Frank Link: https://lore.kernel.org/kvm/1615545714-13747-3-git-send-email-pmorel@linux.ibm.com/ Signed-off-by: Janosch Frank --- lib/s390x/css.h | 1 + lib/s390x/css_lib.c | 41 ++++++++++++++++++++++++++--------------- s390x/css.c | 15 +++++---------- 3 files changed, 32 insertions(+), 25 deletions(-) diff --git a/lib/s390x/css.h b/lib/s390x/css.h index 3dc2f313..b9e4c08f 100644 --- a/lib/s390x/css.h +++ b/lib/s390x/css.h @@ -278,6 +278,7 @@ int css_enumerate(void); #define IO_SCH_ISC 3 int css_enable(int schid, int isc); +bool css_enabled(int schid); /* Library functions */ int start_ccw1_chain(unsigned int sid, struct ccw1 *ccw); diff --git a/lib/s390x/css_lib.c b/lib/s390x/css_lib.c index 3c1acbfb..a97d61e7 100644 --- a/lib/s390x/css_lib.c +++ b/lib/s390x/css_lib.c @@ -161,6 +161,31 @@ out: return schid; } +/* + * css_enabled: report if the subchannel is enabled + * @schid: Subchannel Identifier + * Return value: + * true if the subchannel is enabled + * false otherwise + */ +bool css_enabled(int schid) +{ + struct pmcw *pmcw = &schib.pmcw; + int cc; + + cc = stsch(schid, &schib); + if (cc) { + report_info("stsch: updating sch %08x failed with cc=%d", + schid, cc); + return false; + } + + if (!(pmcw->flags & PMCW_ENABLE)) { + report_info("stsch: sch %08x not enabled", schid); + return false; + } + return true; +} /* * css_enable: enable the subchannel with the specified ISC * @schid: Subchannel Identifier @@ -210,18 +235,8 @@ retry: /* * Read the SCHIB again to verify the enablement */ - cc = stsch(schid, &schib); - if (cc) { - report_info("stsch: updating sch %08x failed with cc=%d", - schid, cc); - return cc; - } - - if ((pmcw->flags & flags) == flags) { - report_info("stsch: sch %08x successfully modified after %d retries", - schid, retry_count); + if (css_enabled(schid)) return 0; - } if (retry_count++ < MAX_ENABLE_RETRIES) { mdelay(10); /* the hardware was not ready, give it some time */ @@ -250,10 +265,6 @@ void css_irq_io(void) lowcore_ptr->io_int_param, sid); goto pop; } - report_info("subsys_id_word: %08x io_int_param %08x io_int_word %08x", - lowcore_ptr->subsys_id_word, - lowcore_ptr->io_int_param, - lowcore_ptr->io_int_word); report_prefix_pop(); report_prefix_push("tsch"); diff --git a/s390x/css.c b/s390x/css.c index 12036b3b..a4778338 100644 --- a/s390x/css.c +++ b/s390x/css.c @@ -25,6 +25,7 @@ static unsigned long cu_type = DEFAULT_CU_TYPE; static int test_device_sid; static struct senseid *senseid; +struct ccw1 *ccw; static void test_enumerate(void) { @@ -58,7 +59,6 @@ static void test_enable(void) */ static void test_sense(void) { - struct ccw1 *ccw; int ret; int len; @@ -74,18 +74,12 @@ static void test_sense(void) return; } - ret = register_io_int_func(css_irq_io); - if (ret) { - report(0, "Could not register IRQ handler"); - return; - } - lowcore_ptr->io_int_param = 0; senseid = alloc_io_mem(sizeof(*senseid), 0); if (!senseid) { report(0, "Allocation of senseid"); - goto error_senseid; + return; } ccw = ccw_alloc(CCW_CMD_SENSE_ID, senseid, sizeof(*senseid), CCW_F_SLI); @@ -137,12 +131,13 @@ error: free_io_mem(ccw, sizeof(*ccw)); error_ccw: free_io_mem(senseid, sizeof(*senseid)); -error_senseid: - unregister_io_int_func(css_irq_io); } static void css_init(void) { + assert(register_io_int_func(css_irq_io) == 0); + lowcore_ptr->io_int_param = 0; + report(get_chsc_scsc(), "Store Channel Characteristics"); } From patchwork Wed May 5 08:42:56 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12239359 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 103FFC43460 for ; Wed, 5 May 2021 08:43:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D57AF611CB for ; Wed, 5 May 2021 08:43:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232098AbhEEIog (ORCPT ); Wed, 5 May 2021 04:44:36 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:52248 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232119AbhEEIoc (ORCPT ); Wed, 5 May 2021 04:44:32 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1458XbLA086018; Wed, 5 May 2021 04:43:36 -0400 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 : content-transfer-encoding : mime-version; s=pp1; bh=+zU5VrJHjAEDmtRdBmvi1J5X8mLrDdIsview2IX2X8w=; b=J486bXi6Pf4rAK3JKVlflA8S0fdA87nf7OJ1AZNOSRImm6TdnM23wSnBEsZtHXlwlRUk wo6Ip39nebmf8j2h7Y7Q3a5EfKflUUNjvpOpCEV8xUc+It0qk7e2G5VwMKcF8vsyrXDU RAuR3JKYgFMuYyybQRaTjSvq1X6V/Y0A+c4Z0U2pPW6UVWqGYeB1H9HFheuBoUPzmYQL Wu7cw9oF7NYfe2Euo6Vm56Yx/n2RLJfXHRIdnU0oxx3c/TDV4Vp5Sosucq7olT+uwZh/ sFrR4/H48PCZdnF/+mEYgxh9iTYPVhREdEIzhWcKku4niNPlcxUCWnZMW6ifRtCuaA0v Ig== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bn4dmm1d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:35 -0400 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 1458baeQ105325; Wed, 5 May 2021 04:43:35 -0400 Received: from ppma05fra.de.ibm.com (6c.4a.5195.ip4.static.sl-reverse.com [149.81.74.108]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bn4dmm0m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:35 -0400 Received: from pps.filterd (ppma05fra.de.ibm.com [127.0.0.1]) by ppma05fra.de.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1458hXiK004474; Wed, 5 May 2021 08:43:33 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma05fra.de.ibm.com with ESMTP id 38beea83k8-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 08:43:33 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1458hUxI21889402 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 May 2021 08:43:30 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 236D0A4060; Wed, 5 May 2021 08:43:30 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8B0EDA405C; Wed, 5 May 2021 08:43:29 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.65.32]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 5 May 2021 08:43:29 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 4/9] s390x: css: extending the subchannel modifying functions Date: Wed, 5 May 2021 10:42:56 +0200 Message-Id: <20210505084301.17395-5-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505084301.17395-1-frankja@linux.ibm.com> References: <20210505084301.17395-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 4xTwpxvgpr3zE94rxb1dgL8KCMUwkVtP X-Proofpoint-ORIG-GUID: G12lA9mFu9ueuzwi4Vflsmd95NcuKuVC X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-05_03:2021-05-05,2021-05-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 impostorscore=0 clxscore=1015 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105050063 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Pierre Morel To enable or disable measurement we will need specific modifications on the subchannel. Signed-off-by: Pierre Morel Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/kvm/1615545714-13747-4-git-send-email-pmorel@linux.ibm.com/ Signed-off-by: Janosch Frank --- lib/s390x/css.h | 9 +++- lib/s390x/css_lib.c | 100 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 108 insertions(+), 1 deletion(-) diff --git a/lib/s390x/css.h b/lib/s390x/css.h index b9e4c08f..7dddb422 100644 --- a/lib/s390x/css.h +++ b/lib/s390x/css.h @@ -82,6 +82,8 @@ struct pmcw { uint32_t intparm; #define PMCW_DNV 0x0001 #define PMCW_ENABLE 0x0080 +#define PMCW_MBUE 0x0010 +#define PMCW_DCTME 0x0008 #define PMCW_ISC_MASK 0x3800 #define PMCW_ISC_SHIFT 11 uint16_t flags; @@ -94,6 +96,7 @@ struct pmcw { uint8_t pom; uint8_t pam; uint8_t chpid[8]; +#define PMCW_MBF1 0x0004 uint32_t flags2; }; #define PMCW_CHANNEL_TYPE(pmcw) (pmcw->flags2 >> 21) @@ -101,7 +104,8 @@ struct pmcw { struct schib { struct pmcw pmcw; struct scsw scsw; - uint8_t md[12]; + uint64_t mbo; + uint8_t md[4]; } __attribute__ ((aligned(4))); struct irb { @@ -355,4 +359,7 @@ bool chsc(void *p, uint16_t code, uint16_t len); #define css_test_general_feature(bit) test_bit_inv(bit, chsc_scsc->general_char) #define css_test_chsc_feature(bit) test_bit_inv(bit, chsc_scsc->chsc_char) +bool css_enable_mb(int sid, uint64_t mb, uint16_t mbi, uint16_t flg, bool fmt1); +bool css_disable_mb(int schid); + #endif diff --git a/lib/s390x/css_lib.c b/lib/s390x/css_lib.c index a97d61e7..8f093839 100644 --- a/lib/s390x/css_lib.c +++ b/lib/s390x/css_lib.c @@ -248,6 +248,106 @@ retry: return -1; } +/* + * schib_update_mb: update the subchannel Measurement Block + * @schid: Subchannel Identifier + * @mb : 64bit address of the measurement block + * @mbi : the measurement block offset + * @flags : PMCW_MBUE to enable measurement block update + * PMCW_DCTME to enable device connect time + * 0 to disable measurement + * @format1: set if format 1 is to be used + */ +static bool schib_update_mb(int schid, uint64_t mb, uint16_t mbi, + uint16_t flags, bool format1) +{ + struct pmcw *pmcw = &schib.pmcw; + int cc; + + /* Read the SCHIB for this subchannel */ + cc = stsch(schid, &schib); + if (cc) { + report_info("stsch: sch %08x failed with cc=%d", schid, cc); + return false; + } + + /* Update the SCHIB to enable the measurement block */ + if (flags) { + pmcw->flags |= flags; + + if (format1) + pmcw->flags2 |= PMCW_MBF1; + else + pmcw->flags2 &= ~PMCW_MBF1; + + pmcw->mbi = mbi; + schib.mbo = mb & ~0x3f; + } else { + pmcw->flags &= ~(PMCW_MBUE | PMCW_DCTME); + } + + /* Tell the CSS we want to modify the subchannel */ + cc = msch(schid, &schib); + if (cc) { + /* + * If the subchannel is status pending or + * if a function is in progress, + * we consider both cases as errors. + */ + report_info("msch: sch %08x failed with cc=%d", schid, cc); + return false; + } + + /* + * Read the SCHIB again + */ + cc = stsch(schid, &schib); + if (cc) { + report_info("stsch: updating sch %08x failed with cc=%d", + schid, cc); + return false; + } + + return true; +} + +/* + * css_enable_mb: enable the subchannel Measurement Block + * @schid: Subchannel Identifier + * @mb : 64bit address of the measurement block + * @format1: set if format 1 is to be used + * @mbi : the measurement block offset + * @flags : PMCW_MBUE to enable measurement block update + * PMCW_DCTME to enable device connect time + */ +bool css_enable_mb(int schid, uint64_t mb, uint16_t mbi, uint16_t flags, + bool format1) +{ + int retry_count = MAX_ENABLE_RETRIES; + struct pmcw *pmcw = &schib.pmcw; + + while (retry_count-- && + !schib_update_mb(schid, mb, mbi, flags, format1)) + mdelay(10); /* the hardware was not ready, give it some time */ + + return schib.mbo == mb && pmcw->mbi == mbi; +} + +/* + * css_disable_mb: disable the subchannel Measurement Block + * @schid: Subchannel Identifier + */ +bool css_disable_mb(int schid) +{ + int retry_count = MAX_ENABLE_RETRIES; + + while (retry_count-- && + !schib_update_mb(schid, 0, 0, 0, 0)) + mdelay(10); /* the hardware was not ready, give it some time */ + + return retry_count > 0; +} + static struct irb irb; void css_irq_io(void) From patchwork Wed May 5 08:42:57 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12239361 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 379A1C43600 for ; Wed, 5 May 2021 08:43:43 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 010D76121F for ; Wed, 5 May 2021 08:43:42 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232171AbhEEIoh (ORCPT ); Wed, 5 May 2021 04:44:37 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:57944 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232140AbhEEIod (ORCPT ); Wed, 5 May 2021 04:44:33 -0400 Received: from pps.filterd (m0098399.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1458Xhg0038143; Wed, 5 May 2021 04:43:37 -0400 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 : content-transfer-encoding : mime-version; s=pp1; bh=pOs1vB8u+sF/OIKZ1zak5HrbiA7czhkU7kRAYd0vPzE=; b=n5E3qqlaJcGq7puQ7IRnWyPzNSvjYz9tfWiJWxkV6G1GE+W6RMOYjfAaB6M7MVunyPPG f17tnmeD38Blhr/ErN8dS2qaZRewTutAaWoMUbasfiKTUE7UvO00oRBuwuAENHrwSPdA C2EUn+AH1yeUZ4UYnkjX6cJrn4HvaY+hPGj06/9ufZmXcE74NViq5G0AYB0AtNWEiL6Q 0KHl91Z7uMogdO0NJp13ZQStdw1SurA+Ocmv2E6EpYAye/F3JklWEWhEbHH9Vg17qnjP ty1S+jswzJEV2+F0+7II1S0L68tBXpDT/sYptsYTOmdw3WJYHbHJLRhvU34ibhr86JcC CQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bqgvrxs5-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:36 -0400 Received: from m0098399.ppops.net (m0098399.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1458XsRc039064; Wed, 5 May 2021 04:43:36 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bqgvrxr3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:36 -0400 Received: from pps.filterd (ppma03ams.nl.ibm.com [127.0.0.1]) by ppma03ams.nl.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1458gHlE021422; Wed, 5 May 2021 08:43:33 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03ams.nl.ibm.com with ESMTP id 38bedxr6b0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 08:43:33 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1458hUe729753670 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 May 2021 08:43:30 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id C480DA4054; Wed, 5 May 2021 08:43:30 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 3A60CA4066; Wed, 5 May 2021 08:43:30 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.65.32]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 5 May 2021 08:43:30 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 5/9] s390x: css: implementing Set CHannel Monitor Date: Wed, 5 May 2021 10:42:57 +0200 Message-Id: <20210505084301.17395-6-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505084301.17395-1-frankja@linux.ibm.com> References: <20210505084301.17395-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: tGLCdwTv9IBeBhwp931-7zO76YCG-syc X-Proofpoint-GUID: dYzKinawcms96skIybBTF73J42Oz3DQc X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-05_03:2021-05-05,2021-05-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxscore=0 bulkscore=0 lowpriorityscore=0 clxscore=1015 adultscore=0 suspectscore=0 priorityscore=1501 mlxlogscore=999 malwarescore=0 phishscore=0 impostorscore=0 spamscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105050063 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Pierre Morel We implement the call of the Set CHannel Monitor instruction, starting the monitoring of the all Channel Sub System, and initializing channel subsystem monitoring. Initial tests report the presence of the extended measurement block feature, and verify the error reporting of the hypervisor for SCHM. Signed-off-by: Pierre Morel Reviewed-by: Cornelia Huck Acked-by: Janosch Frank Link: https://lore.kernel.org/kvm/1615545714-13747-5-git-send-email-pmorel@linux.ibm.com/ Signed-off-by: Janosch Frank --- lib/s390x/css.h | 12 ++++++++++++ s390x/css.c | 35 +++++++++++++++++++++++++++++++++++ 2 files changed, 47 insertions(+) diff --git a/lib/s390x/css.h b/lib/s390x/css.h index 7dddb422..7158423c 100644 --- a/lib/s390x/css.h +++ b/lib/s390x/css.h @@ -309,6 +309,7 @@ struct chsc_scsc { uint8_t reserved[9]; struct chsc_header res; uint32_t res_fmt; +#define CSSC_EXTENDED_MEASUREMENT_BLOCK 48 uint64_t general_char[255]; uint64_t chsc_char[254]; }; @@ -359,6 +360,17 @@ bool chsc(void *p, uint16_t code, uint16_t len); #define css_test_general_feature(bit) test_bit_inv(bit, chsc_scsc->general_char) #define css_test_chsc_feature(bit) test_bit_inv(bit, chsc_scsc->chsc_char) +#define SCHM_DCTM 1 /* activate Device Connection TiMe */ +#define SCHM_MBU 2 /* activate Measurement Block Update */ + +static inline void schm(void *mbo, unsigned int flags) +{ + register void *__gpr2 asm("2") = mbo; + register long __gpr1 asm("1") = flags; + + asm("schm" : : "d" (__gpr2), "d" (__gpr1)); +} + bool css_enable_mb(int sid, uint64_t mb, uint16_t mbi, uint16_t flg, bool fmt1); bool css_disable_mb(int schid); diff --git a/s390x/css.c b/s390x/css.c index a4778338..af68266d 100644 --- a/s390x/css.c +++ b/s390x/css.c @@ -141,6 +141,40 @@ static void css_init(void) report(get_chsc_scsc(), "Store Channel Characteristics"); } +static void test_schm(void) +{ + if (css_test_general_feature(CSSC_EXTENDED_MEASUREMENT_BLOCK)) + report_info("Extended measurement block available"); + + /* bits 59-63 of MB address must be 0 if MBU is defined */ + report_prefix_push("Unaligned operand"); + expect_pgm_int(); + schm((void *)0x01, SCHM_MBU); + check_pgm_int_code(PGM_INT_CODE_OPERAND); + report_prefix_pop(); + + /* bits 36-61 of register 1 (flags) must be 0 */ + report_prefix_push("Bad flags"); + expect_pgm_int(); + schm(NULL, 0xfffffffc); + check_pgm_int_code(PGM_INT_CODE_OPERAND); + report_prefix_pop(); + + /* SCHM is a privilege operation */ + report_prefix_push("Privilege"); + enter_pstate(); + expect_pgm_int(); + schm(NULL, SCHM_MBU); + check_pgm_int_code(PGM_INT_CODE_PRIVILEGED_OPERATION); + report_prefix_pop(); + + /* Normal operation */ + report_prefix_push("Normal operation"); + schm(NULL, SCHM_MBU); + report(1, "SCHM call without address"); + report_prefix_pop(); +} + static struct { const char *name; void (*func)(void); @@ -150,6 +184,7 @@ static struct { { "enumerate (stsch)", test_enumerate }, { "enable (msch)", test_enable }, { "sense (ssch/tsch)", test_sense }, + { "measurement block (schm)", test_schm }, { NULL, NULL } }; From patchwork Wed May 5 08:42:58 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12239367 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2D3D0C433ED for ; Wed, 5 May 2021 08:43:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id F0B82611CB for ; Wed, 5 May 2021 08:43:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232249AbhEEIoo (ORCPT ); Wed, 5 May 2021 04:44:44 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:14026 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232169AbhEEIoe (ORCPT ); Wed, 5 May 2021 04:44:34 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1458Y5hB161603; Wed, 5 May 2021 04:43:38 -0400 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 : content-transfer-encoding : mime-version; s=pp1; bh=YBTV/l4zouVP0SmCeJ7pC2K09Fnld51eVOEdvtR5exg=; b=pkGcjToR3iS3aA0zY4TzHt5wp/6oALurfXPm9p/qhrtbPH9fL14XxPRWlnYvku74WUk3 3z/rAeu9xZEXTo/N4FcNqRBlNiXU6LQTiOf+/+9yIC3qGG88oHXeQlbzdJKjavL6npbL sa+QvhBXYreEUXNdU6U2DoKKHtnO0r5TRZqycpS1jh4SYNTE5KhyNfBWTBNR0Vb9H8+n ERg6SJMaPwrdwcd4DiX+26goIo+UCiZhTLSIIv0O3+74hM6Qa4HFQUsTBLB7zwyWNrA8 MfiTxkPOpz0mHydhP0PTztlnVqXxz90jXY3tKUPChRT7taXMoEuitykmgeGfDd5Wf2VO aA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 38bn7ym7ec-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:38 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1458YaIE163435; Wed, 5 May 2021 04:43:37 -0400 Received: from ppma02fra.de.ibm.com (47.49.7a9f.ip4.static.sl-reverse.com [159.122.73.71]) by mx0b-001b2d01.pphosted.com with ESMTP id 38bn7ym7ck-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:37 -0400 Received: from pps.filterd (ppma02fra.de.ibm.com [127.0.0.1]) by ppma02fra.de.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1458gTmf010449; Wed, 5 May 2021 08:43:34 GMT Received: from b06cxnps4074.portsmouth.uk.ibm.com (d06relay11.portsmouth.uk.ibm.com [9.149.109.196]) by ppma02fra.de.ibm.com with ESMTP id 38bee2g3nc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 08:43:34 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1458hVF642402048 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 May 2021 08:43:31 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 73345A4054; Wed, 5 May 2021 08:43:31 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DBFE6A405B; Wed, 5 May 2021 08:43:30 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.65.32]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 5 May 2021 08:43:30 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 6/9] s390x: css: testing measurement block format 0 Date: Wed, 5 May 2021 10:42:58 +0200 Message-Id: <20210505084301.17395-7-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505084301.17395-1-frankja@linux.ibm.com> References: <20210505084301.17395-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 9jls_FrfeVP2TCTadB3LEk1-OT5WKzTQ X-Proofpoint-ORIG-GUID: dmRfBIbwc4SfspiD5OgMlzS5VxVb0VOU X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-05_02:2021-05-05,2021-05-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 impostorscore=0 malwarescore=0 suspectscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 mlxlogscore=999 priorityscore=1501 adultscore=0 clxscore=1015 spamscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105050063 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Pierre Morel We test the update of the measurement block format 0, the measurement block origin is calculated from the mbo argument used by the SCHM instruction and the offset calculated using the measurement block index of the SCHIB. Signed-off-by: Pierre Morel Reviewed-by: Cornelia Huck Acked-by: Janosch Frank Link: https://lore.kernel.org/kvm/1615545714-13747-6-git-send-email-pmorel@linux.ibm.com/ Signed-off-by: Janosch Frank --- lib/s390x/css.h | 12 +++++++ s390x/css.c | 83 +++++++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 95 insertions(+) diff --git a/lib/s390x/css.h b/lib/s390x/css.h index 7158423c..335bc705 100644 --- a/lib/s390x/css.h +++ b/lib/s390x/css.h @@ -374,4 +374,16 @@ static inline void schm(void *mbo, unsigned int flags) bool css_enable_mb(int sid, uint64_t mb, uint16_t mbi, uint16_t flg, bool fmt1); bool css_disable_mb(int schid); +struct measurement_block_format0 { + uint16_t ssch_rsch_count; + uint16_t sample_count; + uint32_t device_connect_time; + uint32_t function_pending_time; + uint32_t device_disconnect_time; + uint32_t cu_queuing_time; + uint32_t device_active_only_time; + uint32_t device_busy_time; + uint32_t initial_cmd_resp_time; +}; + #endif diff --git a/s390x/css.c b/s390x/css.c index af68266d..658c5f87 100644 --- a/s390x/css.c +++ b/s390x/css.c @@ -133,6 +133,13 @@ error_ccw: free_io_mem(senseid, sizeof(*senseid)); } +static void sense_id(void) +{ + assert(!start_ccw1_chain(test_device_sid, ccw)); + + assert(wait_and_check_io_completion(test_device_sid) >= 0); +} + static void css_init(void) { assert(register_io_int_func(css_irq_io) == 0); @@ -175,6 +182,81 @@ static void test_schm(void) report_prefix_pop(); } +#define SCHM_UPDATE_CNT 10 +static bool start_measuring(uint64_t mbo, uint16_t mbi, bool fmt1) +{ + int i; + + senseid = alloc_io_mem(sizeof(*senseid), 0); + assert(senseid); + + ccw = ccw_alloc(CCW_CMD_SENSE_ID, senseid, sizeof(*senseid), CCW_F_SLI); + assert(ccw); + + if (!css_enable_mb(test_device_sid, mbo, mbi, PMCW_MBUE, fmt1)) { + report_abort("Enabling measurement block failed"); + return false; + } + + for (i = 0; i < SCHM_UPDATE_CNT; i++) + sense_id(); + + free_io_mem(ccw, sizeof(*ccw)); + free_io_mem(senseid, sizeof(*senseid)); + + return true; +} + +/* + * test_schm_fmt0: + * With measurement block format 0 a memory space is shared + * by all subchannels, each subchannel can provide an index + * for the measurement block facility to store the measurements. + */ +static void test_schm_fmt0(void) +{ + struct measurement_block_format0 *mb0; + int shared_mb_size = 2 * sizeof(struct measurement_block_format0); + + if (!test_device_sid) { + report_skip("No device"); + return; + } + + /* Allocate zeroed Measurement block */ + mb0 = alloc_io_mem(shared_mb_size, 0); + if (!mb0) { + report_abort("measurement_block_format0 allocation failed"); + return; + } + + schm(NULL, 0); /* Stop any previous measurement */ + schm(mb0, SCHM_MBU); + + /* Expect success */ + report_prefix_push("Valid MB address and index 0"); + report(start_measuring(0, 0, false) && + mb0->ssch_rsch_count == SCHM_UPDATE_CNT, + "SSCH measured %d", mb0->ssch_rsch_count); + report_prefix_pop(); + + /* Clear the measurement block for the next test */ + memset(mb0, 0, shared_mb_size); + + /* Expect success */ + report_prefix_push("Valid MB address and index 1"); + if (start_measuring(0, 1, false)) + report(mb0[1].ssch_rsch_count == SCHM_UPDATE_CNT, + "SSCH measured %d", mb0[1].ssch_rsch_count); + report_prefix_pop(); + + /* Stop the measurement */ + css_disable_mb(test_device_sid); + schm(NULL, 0); + + free_io_mem(mb0, shared_mb_size); +} + static struct { const char *name; void (*func)(void); @@ -185,6 +267,7 @@ static struct { { "enable (msch)", test_enable }, { "sense (ssch/tsch)", test_sense }, { "measurement block (schm)", test_schm }, + { "measurement block format0", test_schm_fmt0 }, { NULL, NULL } }; From patchwork Wed May 5 08:42:59 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12239363 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EDA5AC433B4 for ; Wed, 5 May 2021 08:43:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id BF14C611CB for ; Wed, 5 May 2021 08:43:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232223AbhEEIoj (ORCPT ); Wed, 5 May 2021 04:44:39 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:12850 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232154AbhEEIoe (ORCPT ); Wed, 5 May 2021 04:44:34 -0400 Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1458WbYx130417; Wed, 5 May 2021 04:43:38 -0400 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 : content-transfer-encoding : mime-version; s=pp1; bh=A8BW3T/fMZNLSQ9f8VJ0FghQ9g7P5FJmCdB4trDPmDU=; b=FdwZUF8aE7oxhlsxrn6B4DbY+M1T2I2wgxoUDugic7hMuvknMwq9IzR2umWZMfurujTK U2AYoLkWKO+2RN96ypwGJLGmGlMxzG5MW7SZLj+GinCiMkq6KzMk8Q4n4qtn2fCi9XeY 8VeeqRq5ZyBzGtG9qe3Vuz8LQEurbo8/dkbqLNv7m+DD9z019bNiDQPMKLSW6nGsFEsg 4zJr7ihTeKNp59MFMYhva9qz0rDkuE8dTRzU4n6mEJ5SRM70qqFrGXgZso4y+wprR7+a kI75YSho1Wc71to9RQvUXs1iz3mLyUrcNIYfRlk2PmoSKQwvoRx1ZAorpXJTvDPE84+N qQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bpn92fej-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:37 -0400 Received: from m0098393.ppops.net (m0098393.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1458XQoG132588; Wed, 5 May 2021 04:43:37 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bpn92fdh-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:37 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1458h3G5022508; Wed, 5 May 2021 08:43:35 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma04ams.nl.ibm.com with ESMTP id 38beeeg6d2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 08:43:34 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1458hWkf57737478 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 May 2021 08:43:32 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 1F81FA405C; Wed, 5 May 2021 08:43:32 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8A062A405B; Wed, 5 May 2021 08:43:31 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.65.32]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 5 May 2021 08:43:31 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 7/9] s390x: css: testing measurement block format 1 Date: Wed, 5 May 2021 10:42:59 +0200 Message-Id: <20210505084301.17395-8-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505084301.17395-1-frankja@linux.ibm.com> References: <20210505084301.17395-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: YLh1lWPjFuLIa91HfKchEmvvg8mui-gd X-Proofpoint-GUID: XBIJ534RcIkyHjmHlGkfDE-8uVCA5qII X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-05_03:2021-05-05,2021-05-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 mlxlogscore=999 priorityscore=1501 impostorscore=0 adultscore=0 spamscore=0 suspectscore=0 bulkscore=0 lowpriorityscore=0 mlxscore=0 clxscore=1015 phishscore=0 malwarescore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105050063 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Pierre Morel Measurement block format 1 is made available by the extended measurement block facility and is indicated in the SCHIB by the bit in the PMCW. The MBO is specified in the SCHIB of each channel and the MBO defined by the SCHM instruction is ignored. The test of the MB format 1 is just skipped if the feature is not available. Signed-off-by: Pierre Morel Reviewed-by: Cornelia Huck Link: https://lore.kernel.org/kvm/1615545714-13747-7-git-send-email-pmorel@linux.ibm.com/ Signed-off-by: Janosch Frank --- lib/s390x/css.h | 15 +++++++++ lib/s390x/css_lib.c | 2 +- s390x/css.c | 75 +++++++++++++++++++++++++++++++++++++++++++++ 3 files changed, 91 insertions(+), 1 deletion(-) diff --git a/lib/s390x/css.h b/lib/s390x/css.h index 335bc705..7e3d2613 100644 --- a/lib/s390x/css.h +++ b/lib/s390x/css.h @@ -107,6 +107,7 @@ struct schib { uint64_t mbo; uint8_t md[4]; } __attribute__ ((aligned(4))); +extern struct schib schib; struct irb { struct scsw scsw; @@ -386,4 +387,18 @@ struct measurement_block_format0 { uint32_t initial_cmd_resp_time; }; +struct measurement_block_format1 { + uint32_t ssch_rsch_count; + uint32_t sample_count; + uint32_t device_connect_time; + uint32_t function_pending_time; + uint32_t device_disconnect_time; + uint32_t cu_queuing_time; + uint32_t device_active_only_time; + uint32_t device_busy_time; + uint32_t initial_cmd_resp_time; + uint32_t irq_delay_time; + uint32_t irq_prio_delay_time; +}; + #endif diff --git a/lib/s390x/css_lib.c b/lib/s390x/css_lib.c index 8f093839..efc70576 100644 --- a/lib/s390x/css_lib.c +++ b/lib/s390x/css_lib.c @@ -19,7 +19,7 @@ #include #include -static struct schib schib; +struct schib schib; struct chsc_scsc *chsc_scsc; static const char * const chsc_rsp_description[] = { diff --git a/s390x/css.c b/s390x/css.c index 658c5f87..c340c539 100644 --- a/s390x/css.c +++ b/s390x/css.c @@ -257,6 +257,80 @@ static void test_schm_fmt0(void) free_io_mem(mb0, shared_mb_size); } +static void msch_with_wrong_fmt1_mbo(unsigned int schid, uint64_t mb) +{ + struct pmcw *pmcw = &schib.pmcw; + int cc; + + /* Read the SCHIB for this subchannel */ + cc = stsch(schid, &schib); + if (cc) { + report(0, "stsch: sch %08x failed with cc=%d", schid, cc); + return; + } + + /* Update the SCHIB to enable the measurement block */ + pmcw->flags |= PMCW_MBUE; + pmcw->flags2 |= PMCW_MBF1; + schib.mbo = mb; + + /* Tell the CSS we want to modify the subchannel */ + expect_pgm_int(); + cc = msch(schid, &schib); + check_pgm_int_code(PGM_INT_CODE_OPERAND); +} + +/* + * test_schm_fmt1: + * With measurement block format 1 the measurement block is + * dedicated to a subchannel. + */ +static void test_schm_fmt1(void) +{ + struct measurement_block_format1 *mb1; + + if (!test_device_sid) { + report_skip("No device"); + return; + } + + if (!css_test_general_feature(CSSC_EXTENDED_MEASUREMENT_BLOCK)) { + report_skip("Extended measurement block not available"); + return; + } + + /* Allocate zeroed Measurement block */ + mb1 = alloc_io_mem(sizeof(struct measurement_block_format1), 0); + if (!mb1) { + report_abort("measurement_block_format1 allocation failed"); + return; + } + + schm(NULL, 0); /* Stop any previous measurement */ + schm(0, SCHM_MBU); + + /* Expect error for non aligned MB */ + report_prefix_push("Unaligned MB origin"); + msch_with_wrong_fmt1_mbo(test_device_sid, (uint64_t)mb1 + 1); + report_prefix_pop(); + + /* Clear the measurement block for the next test */ + memset(mb1, 0, sizeof(*mb1)); + + /* Expect success */ + report_prefix_push("Valid MB origin"); + if (start_measuring((u64)mb1, 0, true)) + report(mb1->ssch_rsch_count == SCHM_UPDATE_CNT, + "SSCH measured %d", mb1->ssch_rsch_count); + report_prefix_pop(); + + /* Stop the measurement */ + css_disable_mb(test_device_sid); + schm(NULL, 0); + + free_io_mem(mb1, sizeof(struct measurement_block_format1)); +} + static struct { const char *name; void (*func)(void); @@ -268,6 +342,7 @@ static struct { { "sense (ssch/tsch)", test_sense }, { "measurement block (schm)", test_schm }, { "measurement block format0", test_schm_fmt0 }, + { "measurement block format1", test_schm_fmt1 }, { NULL, NULL } }; From patchwork Wed May 5 08:43:00 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12239365 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 57889C43460 for ; Wed, 5 May 2021 08:43:46 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E0D596121F for ; Wed, 5 May 2021 08:43:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232229AbhEEIok (ORCPT ); Wed, 5 May 2021 04:44:40 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:20782 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232168AbhEEIoe (ORCPT ); Wed, 5 May 2021 04:44:34 -0400 Received: from pps.filterd (m0187473.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1458XZ36015774; Wed, 5 May 2021 04:43:38 -0400 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 : content-transfer-encoding : mime-version; s=pp1; bh=Z3VZQUtWJ1X6pNtb4EmisIFvsmeGIONO+y/C3ScZuo4=; b=ecQsaRTb/CscUw+RSqJqT4Y5P2oZWNRJn+j2SnjNnowiXrGQBb2T+UlSXi78ubQCcSXh AJTXNMUjpimtOmvMZCTTWUNgoaRz14rM9V5OkPjXEcGa+zHde8ewnSXlWNzFz1TmTC3l RlwbEldmO+KWzEuV/zT5OJwvEPS0msGkrqsLYQNPv7Ky61SYv4KTxRTwnRt599V9Q9tS 9x1fCTNuRwT+W1apLsTaNJOU9IX4MKYogYQyQl8eztlnvkgLrxyfZJ8WiXkB66J+lBTt 0FLCNToJOqtx3QPpjrrrf4v22qJot82VPBwU8don/oxuqmCm3nsCZXgh5Wvh/xwyELSw 1Q== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bnfsc2h0-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:38 -0400 Received: from m0187473.ppops.net (m0187473.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 1458b6A4032267; Wed, 5 May 2021 04:43:38 -0400 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 38bnfsc2ga-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:37 -0400 Received: from pps.filterd (ppma06ams.nl.ibm.com [127.0.0.1]) by ppma06ams.nl.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1458gaUT012628; Wed, 5 May 2021 08:43:35 GMT Received: from b06cxnps4075.portsmouth.uk.ibm.com (d06relay12.portsmouth.uk.ibm.com [9.149.109.197]) by ppma06ams.nl.ibm.com with ESMTP id 38bee586ex-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 08:43:35 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1458hWlF44761374 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 May 2021 08:43:32 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CA56BA4054; Wed, 5 May 2021 08:43:32 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 36442A405B; Wed, 5 May 2021 08:43:32 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.65.32]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 5 May 2021 08:43:32 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 8/9] MAINTAINERS: s390x: add myself as reviewer Date: Wed, 5 May 2021 10:43:00 +0200 Message-Id: <20210505084301.17395-9-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505084301.17395-1-frankja@linux.ibm.com> References: <20210505084301.17395-1-frankja@linux.ibm.com> X-TM-AS-GCONF: 00 X-Proofpoint-GUID: blCgiD66xZGTt-HnUTf87klv_d891EFW X-Proofpoint-ORIG-GUID: SJ7-yy6TYqP0msyxWGFxMUWmJIytVGft X-Proofpoint-UnRewURL: 0 URL was un-rewritten MIME-Version: 1.0 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-05_02:2021-05-05,2021-05-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 phishscore=0 spamscore=0 clxscore=1015 priorityscore=1501 mlxscore=0 malwarescore=0 suspectscore=0 mlxlogscore=999 impostorscore=0 bulkscore=0 lowpriorityscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105050063 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org From: Claudio Imbrenda Signed-off-by: Claudio Imbrenda Acked-by: David Hildenbrand Acked-by: Cornelia Huck Acked-by: Janosch Frank Message-Id: <20210427121608.157783-1-imbrenda@linux.ibm.com> Link: https://lore.kernel.org/kvm/20210427121608.157783-1-imbrenda@linux.ibm.com/ Signed-off-by: Janosch Frank --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index e2505985..aaa404cf 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -85,6 +85,7 @@ M: Thomas Huth M: David Hildenbrand M: Janosch Frank R: Cornelia Huck +R: Claudio Imbrenda L: kvm@vger.kernel.org L: linux-s390@vger.kernel.org F: s390x/* From patchwork Wed May 5 08:43:01 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12239369 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id EA935C433B4 for ; Wed, 5 May 2021 08:43:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id B4E57611CB for ; Wed, 5 May 2021 08:43:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232235AbhEEIoq (ORCPT ); Wed, 5 May 2021 04:44:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:19946 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232186AbhEEIof (ORCPT ); Wed, 5 May 2021 04:44:35 -0400 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 1458XZn3085905; Wed, 5 May 2021 04:43:39 -0400 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=n4y0JBR5dkYGehv58NVWc1GLx0lZdEKuACSBeg/Iu5Y=; b=gIro+VOMDGwITuzWe3fItSOTKBg6wAr0tnoNES86G4/12utXNiuLKpoAQQl0sQz+PaeY pT+Ws21es8aporNj/+Sxq35OTS+PlpJCuCwrRs5uOl4mXeL4dUqQaf6L9ul+yTInkGhK zQh0LU4mYj1xB1prb1mH0JKL7uO58FfAVxXsA+SKcg3f5bwHoECGFBLPYQaAS1W4bywc T22iaP2y+xQT726YR5jKmlacy7e1XlrdOdnsZ2RvVpCn1IEsXSAiDpctPIeC8hpSlQ/I 9BheKFWy9goIvm6vV0eByGyw/XLo6IYwGchmagwzgxFfb7sGbZWnhoY3GnlNTWmS8okg NQ== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bn4dmm3b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:39 -0400 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 1458Y8Zf092133; Wed, 5 May 2021 04:43:38 -0400 Received: from ppma04ams.nl.ibm.com (63.31.33a9.ip4.static.sl-reverse.com [169.51.49.99]) by mx0a-001b2d01.pphosted.com with ESMTP id 38bn4dmm1x-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 04:43:38 -0400 Received: from pps.filterd (ppma04ams.nl.ibm.com [127.0.0.1]) by ppma04ams.nl.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 1458hGRH022563; Wed, 5 May 2021 08:43:36 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma04ams.nl.ibm.com with ESMTP id 38beeeg6d3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 05 May 2021 08:43:36 +0000 Received: from b06wcsmtp001.portsmouth.uk.ibm.com (b06wcsmtp001.portsmouth.uk.ibm.com [9.149.105.160]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 1458hX8v32702910 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 5 May 2021 08:43:33 GMT Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 7F5A5A4060; Wed, 5 May 2021 08:43:33 +0000 (GMT) Received: from b06wcsmtp001.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E1608A405B; Wed, 5 May 2021 08:43:32 +0000 (GMT) Received: from localhost.localdomain.com (unknown [9.145.65.32]) by b06wcsmtp001.portsmouth.uk.ibm.com (Postfix) with ESMTP; Wed, 5 May 2021 08:43:32 +0000 (GMT) From: Janosch Frank To: pbonzini@redhat.com Cc: kvm@vger.kernel.org, frankja@linux.ibm.com, david@redhat.com, borntraeger@de.ibm.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests GIT PULL 9/9] s390x: Fix vector stfle checks Date: Wed, 5 May 2021 10:43:01 +0200 Message-Id: <20210505084301.17395-10-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210505084301.17395-1-frankja@linux.ibm.com> References: <20210505084301.17395-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: fgJwIVgq_I3TfvP2cH6VN5iGsXnsb5rr X-Proofpoint-ORIG-GUID: 48rPAs1nla-TbyMSVAE5FMf73-XaUhrh X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-05_03:2021-05-05,2021-05-05 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 phishscore=0 adultscore=0 mlxscore=0 lowpriorityscore=0 suspectscore=0 spamscore=0 malwarescore=0 priorityscore=1501 bulkscore=0 impostorscore=0 clxscore=1015 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104060000 definitions=main-2105050063 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org 134 is for bcd 135 is for the vector enhancements Not the other way around... Signed-off-by: Janosch Frank Reviewed-by: David Hildenbrand Reviewed-by: Cornelia Huck Reviewed-by: Claudio Imbrenda Suggested-by: David Hildenbrand --- s390x/vector.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/s390x/vector.c b/s390x/vector.c index d1b6a571..b052de55 100644 --- a/s390x/vector.c +++ b/s390x/vector.c @@ -53,7 +53,7 @@ static void test_add(void) /* z14 vector extension test */ static void test_ext1_nand(void) { - bool has_vext = test_facility(134); + bool has_vext = test_facility(135); static struct prm { __uint128_t a,b,c; } prm __attribute__((aligned(16))); @@ -79,7 +79,7 @@ static void test_ext1_nand(void) /* z14 bcd extension test */ static void test_bcd_add(void) { - bool has_bcd = test_facility(135); + bool has_bcd = test_facility(134); static struct prm { __uint128_t a,b,c; } prm __attribute__((aligned(16)));