From nobody Sun May 19 12:00:47 2024 Delivered-To: importer@patchew.org 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; Authentication-Results: mx.zohomail.com; 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=de.ibm.com ARC-Seal: i=1; a=rsa-sha256; t=1586160047; cv=none; d=zohomail.com; s=zohoarc; b=Wlc6CF/NRyz7QjSOH92bvHqvqaQaEBgwdIQIe9jDGezeDVMqsvWzwonoy/Z485e0k9Wy6TbcGE2haPM6etT+qP3Ung+PKxexnBFKWuDCurh7lBiGKYoa8ilLyeBsdAm1Cr0/PzVdHoptvWWsBayVeg1PMxNfFWYVkNJsPe8xFo4= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1586160047; 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=AMYqof9ZL+T4BhAmQ6OoFcRzu8+o5dbUDatXBAAS2/w=; b=PdGfAz0pmY0Nmwn2oMg7fUUswK+DcnKxRjOFkV4pVZRA4ON+FUCnYA2tN1BPOEL5SbrUz1ViTNJSGokvJwrWtu/5zDHAvhPeOE1gNHpQiAO9Mi2n3D0n6nolWZigpPHQxLQhFHViuumMaZf7Z4TXmNKWCj/zfTL+iiss8DzE8Z0= ARC-Authentication-Results: i=1; mx.zohomail.com; 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 1586160047634731.731458185538; Mon, 6 Apr 2020 01:00:47 -0700 (PDT) Received: from localhost ([::1]:55952 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLMgY-0006OZ-0L for importer@patchew.org; Mon, 06 Apr 2020 04:00:46 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:60577) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jLMfR-0005Wb-RE for qemu-devel@nongnu.org; Mon, 06 Apr 2020 03:59:38 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1jLMfQ-0005Pv-MP for qemu-devel@nongnu.org; Mon, 06 Apr 2020 03:59:37 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:31000) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1jLMfQ-0005PQ-En; Mon, 06 Apr 2020 03:59:36 -0400 Received: from pps.filterd (m0098404.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id 0367YAI4134605; Mon, 6 Apr 2020 03:59:35 -0400 Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com with ESMTP id 306pakt938-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Apr 2020 03:59:35 -0400 Received: from m0098404.ppops.net (m0098404.ppops.net [127.0.0.1]) by pps.reinject (8.16.0.36/8.16.0.36) with SMTP id 0367YSWq136896; Mon, 6 Apr 2020 03:59:34 -0400 Received: from ppma04wdc.us.ibm.com (1a.90.2fa9.ip4.static.sl-reverse.com [169.47.144.26]) by mx0a-001b2d01.pphosted.com with ESMTP id 306pakt92n-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Apr 2020 03:59:34 -0400 Received: from pps.filterd (ppma04wdc.us.ibm.com [127.0.0.1]) by ppma04wdc.us.ibm.com (8.16.0.27/8.16.0.27) with SMTP id 0367wgkN022004; Mon, 6 Apr 2020 07:59:33 GMT Received: from b01cxnp22033.gho.pok.ibm.com (b01cxnp22033.gho.pok.ibm.com [9.57.198.23]) by ppma04wdc.us.ibm.com with ESMTP id 306hv5xgxk-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 06 Apr 2020 07:59:33 +0000 Received: from b01ledav002.gho.pok.ibm.com (b01ledav002.gho.pok.ibm.com [9.57.199.107]) by b01cxnp22033.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 0367xXb154001930 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 6 Apr 2020 07:59:33 GMT Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 05F43124054; Mon, 6 Apr 2020 07:59:33 +0000 (GMT) Received: from b01ledav002.gho.pok.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E8BF512405B; Mon, 6 Apr 2020 07:59:32 +0000 (GMT) Received: from localhost.localdomain (unknown [9.114.17.106]) by b01ledav002.gho.pok.ibm.com (Postfix) with ESMTP; Mon, 6 Apr 2020 07:59:32 +0000 (GMT) From: Christian Borntraeger To: qemu-devel , Cornelia Huck Subject: [PATCH 1/1] s390x/s390-virtio-ccw: Fix build on systems without KVM Date: Mon, 6 Apr 2020 03:59:31 -0400 Message-Id: <20200406075931.26232-2-borntraeger@de.ibm.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200406075931.26232-1-borntraeger@de.ibm.com> References: <20200406075931.26232-1-borntraeger@de.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.138, 18.0.676 definitions=2020-04-06_03:2020-04-03, 2020-04-06 signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 adultscore=0 mlxlogscore=999 spamscore=0 suspectscore=0 mlxscore=0 lowpriorityscore=0 bulkscore=0 priorityscore=1501 impostorscore=0 clxscore=1015 malwarescore=0 phishscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2003020000 definitions=main-2004060059 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-Received-From: 148.163.156.1 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: Thomas Huth , Janosch Frank , David Hildenbrand , Bruce Rogers , Halil Pasic , Christian Borntraeger , qemu-s390x , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Type: text/plain; charset="utf-8" linux/kvm.h is not available on all platforms. Let us move s390_machine_inject_pv_error into pv.c as it uses KVM structures. Fixes: 49fc3220175e ("s390x: protvirt: Support unpack facility") Reported-by: Bruce Rogers Signed-off-by: Christian Borntraeger --- hw/s390x/ipl.h | 1 + hw/s390x/pv.c | 11 +++++++++++ hw/s390x/s390-virtio-ccw.c | 10 ---------- include/hw/s390x/pv.h | 3 +++ 4 files changed, 15 insertions(+), 10 deletions(-) diff --git a/hw/s390x/ipl.h b/hw/s390x/ipl.h index 89b3044d7a..53cc9eb5ac 100644 --- a/hw/s390x/ipl.h +++ b/hw/s390x/ipl.h @@ -14,6 +14,7 @@ #define HW_S390_IPL_H =20 #include "cpu.h" +#include "exec/address-spaces.h" #include "hw/qdev-core.h" =20 struct IPLBlockPVComp { diff --git a/hw/s390x/pv.c b/hw/s390x/pv.c index d3333d6e13..18f785b09e 100644 --- a/hw/s390x/pv.c +++ b/hw/s390x/pv.c @@ -13,8 +13,10 @@ =20 #include =20 +#include "cpu.h" #include "qemu/error-report.h" #include "sysemu/kvm.h" +#include "hw/s390x/ipl.h" #include "hw/s390x/pv.h" =20 static int __s390_pv_cmd(uint32_t cmd, const char *cmdname, void *data) @@ -100,3 +102,12 @@ void s390_pv_unshare(void) { s390_pv_cmd_exit(KVM_PV_VM_UNSHARE_ALL, NULL); } + +void s390_machine_inject_pv_error(CPUState *cs) +{ + int r1 =3D (cs->kvm_run->s390_sieic.ipa & 0x00f0) >> 4; + CPUS390XState *env =3D &S390_CPU(cs)->env; + + /* Report that we are unable to enter protected mode */ + env->regs[r1 + 1] =3D DIAG_308_RC_INVAL_FOR_PV; +} diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index b268907395..0e8b0c63a1 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -45,7 +45,6 @@ #include "sysemu/sysemu.h" #include "sysemu/balloon.h" #include "hw/s390x/pv.h" -#include #include "migration/blocker.h" =20 static Error *pv_mig_blocker; @@ -390,15 +389,6 @@ out_err: return rc; } =20 -static void s390_machine_inject_pv_error(CPUState *cs) -{ - int r1 =3D (cs->kvm_run->s390_sieic.ipa & 0x00f0) >> 4; - CPUS390XState *env =3D &S390_CPU(cs)->env; - - /* Report that we are unable to enter protected mode */ - env->regs[r1 + 1] =3D DIAG_308_RC_INVAL_FOR_PV; -} - static void s390_pv_prepare_reset(S390CcwMachineState *ms) { CPUState *cs; diff --git a/include/hw/s390x/pv.h b/include/hw/s390x/pv.h index c6cb360f2f..b0fbed9bae 100644 --- a/include/hw/s390x/pv.h +++ b/include/hw/s390x/pv.h @@ -13,6 +13,7 @@ #define HW_S390_PV_H =20 #ifdef CONFIG_KVM +#include "cpu.h" #include "hw/s390x/s390-virtio-ccw.h" =20 static inline bool s390_is_pv(void) @@ -41,6 +42,7 @@ int s390_pv_unpack(uint64_t addr, uint64_t size, uint64_t= tweak); void s390_pv_perf_clear_reset(void); int s390_pv_verify(void); void s390_pv_unshare(void); +void s390_machine_inject_pv_error(CPUState *cs); #else /* CONFIG_KVM */ static inline bool s390_is_pv(void) { return false; } static inline int s390_pv_vm_enable(void) { return 0; } @@ -50,6 +52,7 @@ static inline int s390_pv_unpack(uint64_t addr, uint64_t = size, uint64_t tweak) { static inline void s390_pv_perf_clear_reset(void) {} static inline int s390_pv_verify(void) { return 0; } static inline void s390_pv_unshare(void) {} +static inline void s390_machine_inject_pv_error(CPUState *cs) {}; #endif /* CONFIG_KVM */ =20 #endif /* HW_S390_PV_H */ --=20 2.25.1