From nobody Sun May 19 03:02:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1603362829; cv=none; d=zohomail.com; s=zohoarc; b=RKG3vZCv04tsqDhTTlD2cmXzoyfdTauGf+tDCnd3sgXPVn1/hPEtAwdbmbEdumXJPDvp1w9onlMnCMxBmFTxeugWXiynmKDThN1qJ0yYqMT2a3VISwpmU2jwA54ZxrRgFx7qTVPVY3amOJmf1rl8xXlqOKdO58ba/4wS6dX0tuE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603362829; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=rrNFBG2DlRgGpO3rffrw7ArFcwYlaWuKcXvagTGLC5Y=; b=B7r8hYNTNU/6kNkD3g1RgOOczIov3uI27aspIlTzEbSgI8Bv9p368IigmUTM1WJaPiKKN6oHvJxp2mGHeq8mnwHUTfSNDVVfALK4x5PPTrgr+O2AHrYff+u9+4/s2G4nXqE+X4WGqQUcJVigObDeBl2EUx71ZxnnRvUm0KG3G9Y= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603362829130575.613265514133; Thu, 22 Oct 2020 03:33:49 -0700 (PDT) Received: from localhost ([::1]:48382 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVXul-00059u-UJ for importer@patchew.org; Thu, 22 Oct 2020 06:33:47 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51214) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVXsw-0004AB-1y; Thu, 22 Oct 2020 06:31:54 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:49232) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVXso-00021O-4r; Thu, 22 Oct 2020 06:31:53 -0400 Received: from pps.filterd (m0127361.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09MA3ejF052765; Thu, 22 Oct 2020 06:31:45 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 34b0ekk5qc-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Oct 2020 06:31:44 -0400 Received: from m0127361.ppops.net (m0127361.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 09MA4PhJ055454; Thu, 22 Oct 2020 06:31:44 -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 34b0ekk5pf-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Oct 2020 06:31:44 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 09MARVph023725; Thu, 22 Oct 2020 10:31:41 GMT Received: from b06cxnps3074.portsmouth.uk.ibm.com (d06relay09.portsmouth.uk.ibm.com [9.149.109.194]) by ppma03fra.de.ibm.com with ESMTP id 347r87ts5h-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Oct 2020 10:31:41 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 09MAVdoP28377382 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Oct 2020 10:31:39 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E218B52063; Thu, 22 Oct 2020 10:31:38 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 151345204F; Thu, 22 Oct 2020 10:31:38 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=rrNFBG2DlRgGpO3rffrw7ArFcwYlaWuKcXvagTGLC5Y=; b=J3yDUSwoGrYvbBOJdF2j6JhWhRg0zi0FrwB6EAp0hCpYh8EsvUw6POOKTvR1JLI/lnPZ xeUtKSueCUABY0mOCQMv8COa5v7gS2aE6zqvWMv7MtoWpgJf1fJqIknh1LcTodiKi53+ bh7DFtdgFOAe465cpT9zkJR52+MdOBRQIEeMe8qns3g6eLyCAlT8/wVG4RXK5niA3QII mcqjc4EDK8Bct0L9obLm5FYfgcNppz7WHk/+v5n33GFmvKpDLtKn6mDp01rLxgUglV9b 0Z0wJSWQEd53vUH6yy5O++Nv+Q26hDH81VMnpae6Bdq7Y6FeGUGxb99mTF/I8ko4xpj4 nQ== From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 1/2] s390x: pv: Remove sclp boundary checks Date: Thu, 22 Oct 2020 06:31:34 -0400 Message-Id: <20201022103135.126033-2-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201022103135.126033-1-frankja@linux.ibm.com> References: <20201022103135.126033-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.737 definitions=2020-10-22_02:2020-10-20, 2020-10-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 malwarescore=0 mlxscore=0 mlxlogscore=999 priorityscore=1501 spamscore=0 phishscore=0 lowpriorityscore=0 bulkscore=0 suspectscore=1 adultscore=0 impostorscore=0 clxscore=1015 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010220063 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=frankja@linux.ibm.com; helo=mx0b-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/22 06:31:44 X-ACL-Warn: Detected OS = Linux 3.1-3.10 X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, david@redhat.com, cohuck@redhat.com, walling@linux.ibm.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, mhartmay@linux.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" The SCLP boundary cross check is done by the Ultravisor for a protected guest, hence we don't need to do it. As QEMU doesn't get a valid SCCB address in protected mode this is even problematic and can lead to QEMU reporting a false boundary cross error. Signed-off-by: Janosch Frank Reported-by: Marc Hartmayer Fixes: db13387ca0 ("s390/sclp: rework sclp boundary checks") Reviewed-by: Christian Borntraeger Reviewed-by: Thomas Huth Acked-by: Halil Pasic Acked-by: David Hildenbrand Tested-by: Marc Hartmayer Reviewed-by: Collin Walling --- hw/s390x/sclp.c | 5 ----- 1 file changed, 5 deletions(-) diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 00f1e4648d..0cf2290826 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -285,11 +285,6 @@ int sclp_service_call_protected(CPUS390XState *env, ui= nt64_t sccb, goto out_write; } =20 - if (!sccb_verify_boundary(sccb, be16_to_cpu(work_sccb->h.length), code= )) { - work_sccb->h.response_code =3D cpu_to_be16(SCLP_RC_SCCB_BOUNDARY_V= IOLATION); - goto out_write; - } - sclp_c->execute(sclp, work_sccb, code); out_write: s390_cpu_pv_mem_write(env_archcpu(env), 0, work_sccb, --=20 2.25.1 From nobody Sun May 19 03:02:48 2024 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=linux.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1603362911; cv=none; d=zohomail.com; s=zohoarc; b=EJ6ISp9SREqzd4p9xaTLDkHvC0Vix/+FXWRr0QxseI6RVpDsHEUi1glZ5Hvr1WlCqpAtywL+8fjloP8kcC37pIvUCm7CuJBTkGZib2bcnm2benMrIxjJ0DJHu33L1VSxQ4F3bGlFD7MPakUFoGnCJpIr0D8UhHd/iCchD+q7YEc= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1603362911; h=Content-Transfer-Encoding:Cc:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=qGLJ0eSzg7qnYdKzm/mtVQ5a1tPBIvncT5kB5yRcT5s=; b=fq2/JDTl4Mqx3K0XbIGBkr/jtZgb4XPErJojH2SsNg+RuRiU9QX/H17sXN1ENgYu8dH75fAtVZ0/DYU1gSPXzOC+7uyFRz9uWvaoY7LhDWpbfrPe/9xV1zIE29rLzYQUkfSISulmup/+wMJzYqFr3n6dZdKVpRX9HwlV6rXysfk= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=fail; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail header.from= (p=none dis=none) header.from= Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1603362911026923.3854673933789; Thu, 22 Oct 2020 03:35:11 -0700 (PDT) Received: from localhost ([::1]:51580 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kVXw6-0006SC-04 for importer@patchew.org; Thu, 22 Oct 2020 06:35:10 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:51212) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVXsu-00049e-EN; Thu, 22 Oct 2020 06:31:52 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:47404 helo=mx0a-001b2d01.pphosted.com) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kVXso-00021S-Id; Thu, 22 Oct 2020 06:31:52 -0400 Received: from pps.filterd (m0098414.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 09MA4aOL093252; Thu, 22 Oct 2020 06:31:45 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com with ESMTP id 34b0wnkrhb-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Oct 2020 06:31:45 -0400 Received: from m0098414.ppops.net (m0098414.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 09MA4hG5093865; Thu, 22 Oct 2020 06:31:44 -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 34b0wnkrgw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Oct 2020 06:31:44 -0400 Received: from pps.filterd (ppma03fra.de.ibm.com [127.0.0.1]) by ppma03fra.de.ibm.com (8.16.0.42/8.16.0.42) with SMTP id 09MAReQY023755; Thu, 22 Oct 2020 10:31:43 GMT Received: from b06cxnps4076.portsmouth.uk.ibm.com (d06relay13.portsmouth.uk.ibm.com [9.149.109.198]) by ppma03fra.de.ibm.com with ESMTP id 347r87ts5j-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Thu, 22 Oct 2020 10:31:42 +0000 Received: from d06av21.portsmouth.uk.ibm.com (d06av21.portsmouth.uk.ibm.com [9.149.105.232]) by b06cxnps4076.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 09MAVeiO31850852 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Thu, 22 Oct 2020 10:31:40 GMT Received: from d06av21.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id EAE8552051; Thu, 22 Oct 2020 10:31:39 +0000 (GMT) Received: from linux01.pok.stglabs.ibm.com (unknown [9.114.17.81]) by d06av21.portsmouth.uk.ibm.com (Postfix) with ESMTP id 0AE3552054; Thu, 22 Oct 2020 10:31:38 +0000 (GMT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-transfer-encoding; s=pp1; bh=qGLJ0eSzg7qnYdKzm/mtVQ5a1tPBIvncT5kB5yRcT5s=; b=NUNev9CV/xuCwoIE6JIL+oMupEKTwbtmICQ0VPZMIKUOZnl3eUPdKtf99TqjPrzC1W/+ OONM5o5s5xUJSEX7JtLUnA62KErfkmsqOoRPcabnMGW9DBISNU1T8zETZALftFl47AAa 2aYtdV062xW060+JtzzCcLxV3AgMYV1fGPXqTCXC30bsCGArdR9VfGRw3+0wfpePPlqC tj7G9rmt5Bxcp9ZJGnecPTNPJOwsySehvRYdcM6jDoSeDTmZAYN6aiFPsijwBdeFKttF 6Q/oAtLLdM+BDVxOrDvSBO5A0kr1nrQ7VxCkQtEkhcqyCRbX2fJrLkiO1gdYDvvv7XXK 2g== From: Janosch Frank To: qemu-devel@nongnu.org Subject: [PATCH v2 2/2] s390x: pv: Fix diag318 PV fencing Date: Thu, 22 Oct 2020 06:31:35 -0400 Message-Id: <20201022103135.126033-3-frankja@linux.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20201022103135.126033-1-frankja@linux.ibm.com> References: <20201022103135.126033-1-frankja@linux.ibm.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-TM-AS-GCONF: 00 X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.235, 18.0.737 definitions=2020-10-22_03:2020-10-20, 2020-10-22 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 clxscore=1015 bulkscore=0 spamscore=0 mlxscore=0 lowpriorityscore=0 phishscore=0 adultscore=0 priorityscore=1501 mlxlogscore=999 suspectscore=1 malwarescore=0 impostorscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2009150000 definitions=main-2010220063 Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=148.163.158.5; envelope-from=frankja@linux.ibm.com; helo=mx0a-001b2d01.pphosted.com X-detected-operating-system: by eggs.gnu.org: First seen = 2020/10/22 06:31:44 X-ACL-Warn: Detected OS = Linux 3.x [generic] X-Spam_score_int: -19 X-Spam_score: -2.0 X-Spam_bar: -- X-Spam_report: (-2.0 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, RCVD_IN_MSPIKE_H2=-0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, david@redhat.com, cohuck@redhat.com, walling@linux.ibm.com, pasic@linux.ibm.com, borntraeger@de.ibm.com, qemu-s390x@nongnu.org, mhartmay@linux.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail-DKIM: fail (Header signature does not verify) Content-Type: text/plain; charset="utf-8" Diag318 fencing needs to be determined on the current VM PV state and not on the state that the VM has when we create the CPU model. Signed-off-by: Janosch Frank Reported-by: Marc Hartmayer Fixes: fabdada935 ("s390: guest support for diagnose 0x318") Acked-by: David Hildenbrand Reviewed-by: Christian Borntraeger Reviewed-by: Collin Walling Tested-by: Marc Hartmayer --- target/s390x/cpu_features.c | 5 +++++ target/s390x/cpu_features.h | 4 ++++ target/s390x/cpu_models.c | 4 ++++ target/s390x/kvm.c | 3 +-- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/target/s390x/cpu_features.c b/target/s390x/cpu_features.c index 31ea8df246..42fe0bf4ca 100644 --- a/target/s390x/cpu_features.c +++ b/target/s390x/cpu_features.c @@ -14,6 +14,7 @@ #include "qemu/osdep.h" #include "qemu/module.h" #include "cpu_features.h" +#include "hw/s390x/pv.h" =20 #define DEF_FEAT(_FEAT, _NAME, _TYPE, _BIT, _DESC) \ [S390_FEAT_##_FEAT] =3D { \ @@ -105,6 +106,10 @@ void s390_fill_feat_block(const S390FeatBitmap feature= s, S390FeatType type, } feat =3D find_next_bit(features, S390_FEAT_MAX, feat + 1); } + + if (type =3D=3D S390_FEAT_TYPE_SCLP_FAC134 && s390_is_pv()) { + clear_be_bit(s390_feat_def(S390_FEAT_DIAG_318)->bit, data); + } } =20 void s390_add_from_feat_block(S390FeatBitmap features, S390FeatType type, diff --git a/target/s390x/cpu_features.h b/target/s390x/cpu_features.h index ef52ffce83..87463f064d 100644 --- a/target/s390x/cpu_features.h +++ b/target/s390x/cpu_features.h @@ -81,6 +81,10 @@ const S390FeatGroupDef *s390_feat_group_def(S390FeatGrou= p group); =20 #define BE_BIT_NR(BIT) (BIT ^ (BITS_PER_LONG - 1)) =20 +static inline void clear_be_bit(unsigned int bit_nr, uint8_t *array) +{ + array[bit_nr / 8] &=3D ~(0x80 >> (bit_nr % 8)); +} static inline void set_be_bit(unsigned int bit_nr, uint8_t *array) { array[bit_nr / 8] |=3D 0x80 >> (bit_nr % 8); diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index ca484bfda7..461e0b8f4a 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -29,6 +29,7 @@ #include "hw/pci/pci.h" #endif #include "qapi/qapi-commands-machine-target.h" +#include "hw/s390x/pv.h" =20 #define CPUDEF_INIT(_type, _gen, _ec_ga, _mha_pow, _hmfai, _name, _desc) \ { \ @@ -238,6 +239,9 @@ bool s390_has_feat(S390Feat feat) } return 0; } + if (feat =3D=3D S390_FEAT_DIAG_318 && s390_is_pv()) { + return false; + } return test_bit(feat, cpu->model->features); } =20 diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index f13eff688c..baa070fdf7 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2498,8 +2498,7 @@ void kvm_s390_get_host_cpu_model(S390CPUModel *model,= Error **errp) */ set_bit(S390_FEAT_EXTENDED_LENGTH_SCCB, model->features); =20 - /* DIAGNOSE 0x318 is not supported under protected virtualization */ - if (!s390_is_pv() && kvm_check_extension(kvm_state, KVM_CAP_S390_DIAG3= 18)) { + if (kvm_check_extension(kvm_state, KVM_CAP_S390_DIAG318)) { set_bit(S390_FEAT_DIAG_318, model->features); } =20 --=20 2.25.1