From patchwork Mon May 10 15:00:12 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12248429 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 F0AFEC43460 for ; Mon, 10 May 2021 15:05:41 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C83EB61421 for ; Mon, 10 May 2021 15:05:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240731AbhEJPGn (ORCPT ); Mon, 10 May 2021 11:06:43 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:29329 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S231168AbhEJPDI (ORCPT ); Mon, 10 May 2021 11:03:08 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14AEcRPN060494; Mon, 10 May 2021 11:02:03 -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=XUtLXsdceggkbafQ9KIgtpEUlAgSHZJIwuYsMj2R5/0=; b=QGt8506qLMt9viOMpiOCw+dEHp2NCRk98bf6ScZazEYvLNSMiWr4mzyglRvKbGyldVzp EJvL1uI/sX1fxuYyiKlJp4bBc65sBZTxvxL6ERMUqIXhKnbvijfGxgmDnqcUGQYeMirl /FpwxNEU10Ou3Gt0S1hpApEK0WfIq+qqfW53gV4qKU3EinNS12Q5cVoUBO8c/KqXL8tU vhCxBXwLq+MXYYi68G4TcrbInmp9ZzIRjDg9RjkoO7pNnYmjIDo5UwvMCK1t3IbBwlUn ewiUfBGM9aFz9LpdlV6RSjz0GoI31AXafImj4+kGfn3BC5Fbf4QEND/WyXQ+HIjAFs1/ Bw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 38f21t9m7t-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 11:02:02 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 14AEco5s063044; Mon, 10 May 2021 11:02:02 -0400 Received: from ppma06fra.de.ibm.com (48.49.7a9f.ip4.static.sl-reverse.com [159.122.73.72]) by mx0b-001b2d01.pphosted.com with ESMTP id 38f21t9m5b-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 11:02:02 -0400 Received: from pps.filterd (ppma06fra.de.ibm.com [127.0.0.1]) by ppma06fra.de.ibm.com (8.16.0.43/8.16.0.43) with SMTP id 14AEtLdr010361; Mon, 10 May 2021 15:01:59 GMT Received: from b06avi18878370.portsmouth.uk.ibm.com (b06avi18878370.portsmouth.uk.ibm.com [9.149.26.194]) by ppma06fra.de.ibm.com with ESMTP id 38dhwh0jmu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 15:01:59 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18878370.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 14AF1ULF22610254 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 May 2021 15:01:30 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 9C625AE053; Mon, 10 May 2021 15:01:56 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id DA08DAE061; Mon, 10 May 2021 15:01:55 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 10 May 2021 15:01:55 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: frankja@linux.ibm.com, david@redhat.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests PATCH 1/4] s390x: sclp: Only fetch read info byte 134 if cpu entries are above it Date: Mon, 10 May 2021 15:00:12 +0000 Message-Id: <20210510150015.11119-2-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210510150015.11119-1-frankja@linux.ibm.com> References: <20210510150015.11119-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: bLkBwzht5fgRW-Z3tJOLscCymLBxoN-t X-Proofpoint-ORIG-GUID: laD1Mo8X8BLZYjn_SlO6cVPRX5kS5AqP X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-10_09:2021-05-10,2021-05-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 priorityscore=1501 mlxscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105100105 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The cpu offset tells us where the cpu entries are in the sclp read info structure. Signed-off-by: Janosch Frank Reviewed-by: Claudio Imbrenda Reviewed-by: David Hildenbrand Reviewed-by: Cornelia Huck --- lib/s390x/sclp.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/s390x/sclp.c b/lib/s390x/sclp.c index 7a9b2c52..f11c2035 100644 --- a/lib/s390x/sclp.c +++ b/lib/s390x/sclp.c @@ -138,7 +138,8 @@ void sclp_facilities_setup(void) assert(read_info); cpu = sclp_get_cpu_entries(); - sclp_facilities.has_diag318 = read_info->byte_134_diag318; + if (read_info->offset_cpu > 134) + sclp_facilities.has_diag318 = read_info->byte_134_diag318; for (i = 0; i < read_info->entries_cpu; i++, cpu++) { /* * The logic for only reading the facilities from the From patchwork Mon May 10 15:00:13 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12248431 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 7AB4BC43470 for ; Mon, 10 May 2021 15:05:44 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 561AF6147F for ; Mon, 10 May 2021 15:05:44 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241050AbhEJPGq (ORCPT ); Mon, 10 May 2021 11:06:46 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:22884 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231680AbhEJPDJ (ORCPT ); Mon, 10 May 2021 11:03:09 -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 14AEXpFo030860; Mon, 10 May 2021 11:02:04 -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=RhAkAzTfiP5TBRtnalaZ84J0Q13aIlnimPS5PsYww0Y=; b=QQEUljb9sS2Zjm3P3LZX3+TRkiuTDvXweI5nZZjwBLfXh5ZKmME8UZH4/pF0rBvai9Sl LdJ5ehS/P2fwaGv/3gfh7YiHtXpZ51sZQ2HnPTuCVuEwGHesuuIFZvnPb6abZsEhVG3/ IIyuayMApC0ch3sfqqheQ8b0zIwsTIQOoPvDxwpsxIASBkcxkZXCA48onpnwj/IXF0m0 KF5qD144ohxQgdv+bE7g785OdUdDaOWTTdlc7PK9my5WzV/i9wvEs8ffOq6veFLHq5Mz uxZlF+68XpYjiIyiYYALyOHCEejDcOfH+ucDePtlINbMZn/9Pg9nZPdaoAMR3NlMiCYT mw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38f5ytjpxm-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 11:02:03 -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 14AEXoJ2030788; Mon, 10 May 2021 11:02:03 -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 38f5ytjpw4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 11:02:03 -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 14AEsA3k031396; Mon, 10 May 2021 15:02:00 GMT Received: from b06avi18626390.portsmouth.uk.ibm.com (b06avi18626390.portsmouth.uk.ibm.com [9.149.26.192]) by ppma06ams.nl.ibm.com with ESMTP id 38dhwh9216-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 15:02:00 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06avi18626390.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 14AF1Vft25559352 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 May 2021 15:01:31 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 8F9CDAE053; Mon, 10 May 2021 15:01:57 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id CCA9DAE045; Mon, 10 May 2021 15:01:56 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 10 May 2021 15:01:56 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: frankja@linux.ibm.com, david@redhat.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests PATCH 2/4] lib: s390x: sclp: Extend feature probing Date: Mon, 10 May 2021 15:00:13 +0000 Message-Id: <20210510150015.11119-3-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210510150015.11119-1-frankja@linux.ibm.com> References: <20210510150015.11119-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-ORIG-GUID: h190A5q9sqM25CZIPk-fPfbL0JBzLaxG X-Proofpoint-GUID: p0rp2OJ-kR6jmLt5MiKGfU0rijPt72Qo X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-10_09:2021-05-10,2021-05-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 impostorscore=0 mlxscore=0 spamscore=0 suspectscore=0 bulkscore=0 adultscore=0 clxscore=1015 malwarescore=0 mlxlogscore=999 priorityscore=1501 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105100105 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Lets grab more of the feature bits from SCLP read info so we can use them in the cpumodel tests. Signed-off-by: Janosch Frank Reviewed-by: Claudio Imbrenda --- lib/s390x/sclp.c | 20 ++++++++++++++++++++ lib/s390x/sclp.h | 38 +++++++++++++++++++++++++++++++++++--- 2 files changed, 55 insertions(+), 3 deletions(-) diff --git a/lib/s390x/sclp.c b/lib/s390x/sclp.c index f11c2035..f25cfdb2 100644 --- a/lib/s390x/sclp.c +++ b/lib/s390x/sclp.c @@ -129,6 +129,13 @@ CPUEntry *sclp_get_cpu_entries(void) return (CPUEntry *)(_read_info + read_info->offset_cpu); } +static bool sclp_feat_check(int byte, int mask) +{ + uint8_t *rib = (uint8_t *)read_info; + + return !!(rib[byte] & mask); +} + void sclp_facilities_setup(void) { unsigned short cpu0_addr = stap(); @@ -140,6 +147,14 @@ void sclp_facilities_setup(void) cpu = sclp_get_cpu_entries(); if (read_info->offset_cpu > 134) sclp_facilities.has_diag318 = read_info->byte_134_diag318; + sclp_facilities.has_gsls = sclp_feat_check(85, SCLP_FEAT_85_MASK_GSLS); + sclp_facilities.has_kss = sclp_feat_check(98, SCLP_FEAT_98_MASK_KSS); + sclp_facilities.has_cmma = sclp_feat_check(116, SCLP_FEAT_116_MASK_CMMA); + sclp_facilities.has_64bscao = sclp_feat_check(116, SCLP_FEAT_116_MASK_64BSCAO); + sclp_facilities.has_esca = sclp_feat_check(116, SCLP_FEAT_116_MASK_ESCA); + sclp_facilities.has_ibs = sclp_feat_check(117, SCLP_FEAT_117_MASK_IBS); + sclp_facilities.has_pfmfi = sclp_feat_check(117, SCLP_FEAT_117_MASK_PFMFI); + for (i = 0; i < read_info->entries_cpu; i++, cpu++) { /* * The logic for only reading the facilities from the @@ -150,6 +165,11 @@ void sclp_facilities_setup(void) */ if (cpu->address == cpu0_addr) { sclp_facilities.has_sief2 = cpu->feat_sief2; + sclp_facilities.has_skeyi = cpu->feat_skeyi; + sclp_facilities.has_siif = cpu->feat_siif; + sclp_facilities.has_sigpif = cpu->feat_sigpif; + sclp_facilities.has_ib = cpu->feat_ib; + sclp_facilities.has_cei = cpu->feat_cei; break; } } diff --git a/lib/s390x/sclp.h b/lib/s390x/sclp.h index 85231333..48df1260 100644 --- a/lib/s390x/sclp.h +++ b/lib/s390x/sclp.h @@ -94,9 +94,19 @@ typedef struct CPUEntry { uint8_t reserved0; uint8_t : 4; uint8_t feat_sief2 : 1; + uint8_t feat_skeyi : 1; + uint8_t : 2; + uint8_t : 2; + uint8_t feat_gpere : 1; + uint8_t feat_siif : 1; + uint8_t feat_sigpif : 1; uint8_t : 3; - uint8_t features_res2 [SCCB_CPU_FEATURE_LEN - 1]; - uint8_t reserved2[6]; + uint8_t reserved2[3]; + uint8_t : 2; + uint8_t feat_ib : 1; + uint8_t feat_cei : 1; + uint8_t : 4; + uint8_t reserved3[6]; uint8_t type; uint8_t reserved1; } __attribute__((packed)) CPUEntry; @@ -105,10 +115,32 @@ extern struct sclp_facilities sclp_facilities; struct sclp_facilities { uint64_t has_sief2 : 1; + uint64_t has_skeyi : 1; + uint64_t has_gpere : 1; + uint64_t has_siif : 1; + uint64_t has_sigpif : 1; + uint64_t has_ib : 1; + uint64_t has_cei : 1; + uint64_t has_diag318 : 1; - uint64_t : 62; + uint64_t has_gsls : 1; + uint64_t has_cmma : 1; + uint64_t has_64bscao : 1; + uint64_t has_esca : 1; + uint64_t has_kss : 1; + uint64_t has_pfmfi : 1; + uint64_t has_ibs : 1; + uint64_t : 64 - 15; }; +#define SCLP_FEAT_85_MASK_GSLS (1 << 7) +#define SCLP_FEAT_98_MASK_KSS (1 << 0) +#define SCLP_FEAT_116_MASK_64BSCAO (1 << 7) +#define SCLP_FEAT_116_MASK_CMMA (1 << 6) +#define SCLP_FEAT_116_MASK_ESCA (1 << 3) +#define SCLP_FEAT_117_MASK_PFMFI (1 << 6) +#define SCLP_FEAT_117_MASK_IBS (1 << 5) + typedef struct ReadInfo { SCCBHeader h; uint16_t rnmax; From patchwork Mon May 10 15:00:14 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12248435 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,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 CE6AAC43460 for ; Mon, 10 May 2021 15:05:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id A35F261621 for ; Mon, 10 May 2021 15:05:50 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241909AbhEJPGw (ORCPT ); Mon, 10 May 2021 11:06:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:54216 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S232146AbhEJPDQ (ORCPT ); Mon, 10 May 2021 11:03:16 -0400 Received: from pps.filterd (m0098420.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id 14AEcQhA060412; Mon, 10 May 2021 11:02:04 -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=XsUv/2HwzPakkhxVHIjDfFbSEmKCTHFzTgeoGj3ch4o=; b=BQhtJErwE3iG9wAtamSUZvUTR2BvB2Yjq56tQZLcy3T23j6ZJDkmc+ZnCp4A7Qnh4EHC BbRo9Afm4q8aTYUj6RpjSj9gG6yUDS9Enzt/gDxELU1zZteC3OTvX7VdHAzKW3KR2r01 qr6GG1ezWHfdrneEtyZI78fVbAiZeL24Z+FBgNfGKIWZUkgi/SDoX68VFcV8rClnjHyY VywycFDZIZm7qf3OC1Hf3ryTdWj2ZTDPQZv216/snezJSsNodg17eSqfkIKDyq3wOC9v cxzwSxjBTcta6swdSg/6RuX/1pU348C3I7/qn+LDVCxTVL2DSgd6zSLrbRtPw/WwYvPt 9g== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 38f21t9m8w-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 11:02:04 -0400 Received: from m0098420.ppops.net (m0098420.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.43/8.16.0.43) with SMTP id 14AEceoc062447; Mon, 10 May 2021 11:02:03 -0400 Received: from ppma03ams.nl.ibm.com (62.31.33a9.ip4.static.sl-reverse.com [169.51.49.98]) by mx0b-001b2d01.pphosted.com with ESMTP id 38f21t9m7d-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 11:02:03 -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 14AEqslZ006456; Mon, 10 May 2021 15:02:01 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03ams.nl.ibm.com with ESMTP id 38dj9891w6-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 15:02:01 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 14AF1w5e24051974 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 May 2021 15:01:58 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 72E57AE057; Mon, 10 May 2021 15:01:58 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id B7F3CAE045; Mon, 10 May 2021 15:01:57 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 10 May 2021 15:01:57 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: frankja@linux.ibm.com, david@redhat.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests PATCH 3/4] s390x: cpumodel: FMT4 SCLP test Date: Mon, 10 May 2021 15:00:14 +0000 Message-Id: <20210510150015.11119-4-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210510150015.11119-1-frankja@linux.ibm.com> References: <20210510150015.11119-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: ClxRzRAAAgcDWIfqSF8_QdcXqaB-9Qcr X-Proofpoint-ORIG-GUID: I-Kn0gR8UAJf2NZQDSIATEoB1Bfn_fkD X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-10_09:2021-05-10,2021-05-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 phishscore=0 priorityscore=1501 mlxscore=0 spamscore=0 lowpriorityscore=0 adultscore=0 mlxlogscore=999 bulkscore=0 suspectscore=0 clxscore=1015 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105100105 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org SCLP is also part of the cpumodel, so we need to make sure that the features indicated via read info / read cpu info are correct. Signed-off-by: Janosch Frank Acked-by: David Hildenbrand Reviewed-by: Claudio Imbrenda --- s390x/cpumodel.c | 59 +++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 58 insertions(+), 1 deletion(-) diff --git a/s390x/cpumodel.c b/s390x/cpumodel.c index 4dd8b96f..619c3dc7 100644 --- a/s390x/cpumodel.c +++ b/s390x/cpumodel.c @@ -2,14 +2,69 @@ /* * Test the known dependencies for facilities * - * Copyright 2019 IBM Corp. + * Copyright 2019, 2021 IBM Corp. * * Authors: * Christian Borntraeger + * Janosch Frank */ #include #include +#include +#include +#include + +static void test_sclp_missing_sief2_implications(void) +{ + /* Virtualization related facilities */ + report(!sclp_facilities.has_64bscao, "!64bscao"); + report(!sclp_facilities.has_pfmfi, "!pfmfi"); + report(!sclp_facilities.has_gsls, "!gsls"); + report(!sclp_facilities.has_cmma, "!cmma"); + report(!sclp_facilities.has_esca, "!esca"); + report(!sclp_facilities.has_kss, "!kss"); + report(!sclp_facilities.has_ibs, "!ibs"); + + /* Virtualization related facilities reported via CPU entries */ + report(!sclp_facilities.has_sigpif, "!sigpif"); + report(!sclp_facilities.has_sief2, "!sief2"); + report(!sclp_facilities.has_skeyi, "!skeyi"); + report(!sclp_facilities.has_siif, "!siif"); + report(!sclp_facilities.has_cei, "!cei"); + report(!sclp_facilities.has_ib, "!ib"); +} + +static void test_sclp_features_fmt4(void) +{ + /* + * STFLE facilities are handled by the Ultravisor but SCLP + * facilities are advertised by the hypervisor. + */ + report_prefix_push("PV guest implies"); + + /* General facilities */ + report(!sclp_facilities.has_diag318, "!diag318"); + + /* + * Virtualization related facilities, all of which are + * unavailable because there's no virtualization support in a + * protected guest. + */ + test_sclp_missing_sief2_implications(); + + report_prefix_pop(); +} + +static void test_sclp_features(void) +{ + report_prefix_push("sclp"); + + if (uv_os_is_guest()) + test_sclp_features_fmt4(); + + report_prefix_pop(); +} static struct { int facility; @@ -60,6 +115,8 @@ int main(void) } report_prefix_pop(); + test_sclp_features(); + report_prefix_pop(); return report_summary(); } From patchwork Mon May 10 15:00:15 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Janosch Frank X-Patchwork-Id: 12248433 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,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 E51FEC433B4 for ; Mon, 10 May 2021 15:05:45 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id C05C76147F for ; Mon, 10 May 2021 15:05:45 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S241309AbhEJPGs (ORCPT ); Mon, 10 May 2021 11:06:48 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:43191 "EHLO mx0b-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232772AbhEJPDQ (ORCPT ); Mon, 10 May 2021 11:03:16 -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 14AEaE0v148725; Mon, 10 May 2021 11:02:09 -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=qmWTO6Jpcomzj7wYTwIK2pecoL7VSoFFO1RSCnOZ0J8=; b=slW+KlkyDAzDiZXi4fSODKZOHjLGXgRB1enLVkZlpEXHZHH91H2Gk6c2thtBCrw4Isq8 rKW8asMIyrgFMfAkr6ROAMiPXouAjVjBl/O2xRu7bhUJBGynOc5j4Td2jEhBXjsVgBui lEri/KG+m9oQ0NmZ3x5Zruyz5fYFWiLI0x1ck+ALOhAnB98WfccpHo8mWPEBrliVwyo8 xjrCYG9/GIenQXmxZ378G2LiSYid4qowLCVkh8EPIEntjBKwAnZ4eg1Owe/jnvLV1FQ5 rZDWr5LxqdbjxkduHcE/xt625bZ2qxrmCz0bHPJae1ZDocEOxb/ih+dgdgMEoRHtZSS2 Nw== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 38f3dbf2hx-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 11:02:08 -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 14AEaVdd151054; Mon, 10 May 2021 11:02:08 -0400 Received: from ppma03fra.de.ibm.com (6b.4a.5195.ip4.static.sl-reverse.com [149.81.74.107]) by mx0a-001b2d01.pphosted.com with ESMTP id 38f3dbf2gb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 11:02:08 -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 14AErOBv009509; Mon, 10 May 2021 15:02:04 GMT Received: from b06cxnps3075.portsmouth.uk.ibm.com (d06relay10.portsmouth.uk.ibm.com [9.149.109.195]) by ppma03fra.de.ibm.com with ESMTP id 38dj988jgs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 10 May 2021 15:02:03 +0000 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3075.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 14AF1xUg33620304 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 10 May 2021 15:01:59 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 64577AE053; Mon, 10 May 2021 15:01:59 +0000 (GMT) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id A27AFAE051; Mon, 10 May 2021 15:01:58 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Mon, 10 May 2021 15:01:58 +0000 (GMT) From: Janosch Frank To: kvm@vger.kernel.org Cc: frankja@linux.ibm.com, david@redhat.com, cohuck@redhat.com, linux-s390@vger.kernel.org, imbrenda@linux.ibm.com, thuth@redhat.com Subject: [kvm-unit-tests PATCH 4/4] s390x: cpumodel: FMT2 SCLP implies test Date: Mon, 10 May 2021 15:00:15 +0000 Message-Id: <20210510150015.11119-5-frankja@linux.ibm.com> X-Mailer: git-send-email 2.30.2 In-Reply-To: <20210510150015.11119-1-frankja@linux.ibm.com> References: <20210510150015.11119-1-frankja@linux.ibm.com> MIME-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: X5LFWpYHUIDedv5t-2FnRQTpmJPFJDII X-Proofpoint-ORIG-GUID: lj9rlZBJ77BCqqK6f3PjhDrCkp1R4_TN X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.391,18.0.761 definitions=2021-05-10_09:2021-05-10,2021-05-10 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 spamscore=0 mlxscore=0 suspectscore=0 bulkscore=0 priorityscore=1501 lowpriorityscore=0 malwarescore=0 mlxlogscore=999 phishscore=0 impostorscore=0 clxscore=1015 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2104190000 definitions=main-2105100105 Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org The sie facilities require sief2 to also be enabled, so lets check if that's the case. Signed-off-by: Janosch Frank Acked-by: David Hildenbrand Reviewed-by: Claudio Imbrenda --- s390x/cpumodel.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/s390x/cpumodel.c b/s390x/cpumodel.c index 619c3dc7..67bb6543 100644 --- a/s390x/cpumodel.c +++ b/s390x/cpumodel.c @@ -56,12 +56,24 @@ static void test_sclp_features_fmt4(void) report_prefix_pop(); } +static void test_sclp_features_fmt2(void) +{ + if (sclp_facilities.has_sief2) + return; + + report_prefix_push("!sief2 implies"); + test_sclp_missing_sief2_implications(); + report_prefix_pop(); +} + static void test_sclp_features(void) { report_prefix_push("sclp"); if (uv_os_is_guest()) test_sclp_features_fmt4(); + else + test_sclp_features_fmt2(); report_prefix_pop(); }