From nobody Mon Apr 29 07:03:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500996962370345.5336179328332; Tue, 25 Jul 2017 08:36:02 -0700 (PDT) Received: from localhost ([::1]:33251 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1sL-0001OG-Fg for importer@patchew.org; Tue, 25 Jul 2017 11:35:57 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52326) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1qI-00005v-IE for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:33:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da1qG-0007yW-8b for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:33:50 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42068) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1da1qG-0007y8-2u for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:33:48 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0720E7DD0A; Tue, 25 Jul 2017 15:33:47 +0000 (UTC) Received: from localhost (ovpn-116-214.ams2.redhat.com [10.36.116.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3DFC95D961; Tue, 25 Jul 2017 15:33:46 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0720E7DD0A Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 25 Jul 2017 17:33:22 +0200 Message-Id: <20170725153330.14966-2-cohuck@redhat.com> In-Reply-To: <20170725153330.14966-1-cohuck@redhat.com> References: <20170725153330.14966-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 25 Jul 2017 15:33:47 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 1/9] kvm: remove hard dependency on pci X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, zyimin@linux.vnet.ibm.com, david@redhat.com, Cornelia Huck , pmorel@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The msi routing code in kvm calls some pci functions: provide some stubs to enable builds without pci. Fixes: e1d4fb2de ("kvm-irqchip: x86: add msi route notify fn") Fixes: 767a554a0 ("kvm-all: Pass requester ID to MSI routing functions") Signed-off-by: Cornelia Huck --- hw/pci/pci-stub.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c index ecad664946..bc228ce91e 100644 --- a/hw/pci/pci-stub.c +++ b/hw/pci/pci-stub.c @@ -23,6 +23,7 @@ #include "monitor/monitor.h" #include "qapi/qmp/qerror.h" #include "hw/pci/pci.h" +#include "hw/pci/msi.h" #include "qmp-commands.h" #include "hw/pci/msi.h" =20 @@ -38,3 +39,14 @@ void hmp_pcie_aer_inject_error(Monitor *mon, const QDict= *qdict) { monitor_printf(mon, "PCI devices not supported\n"); } + +/* kvm-all wants this */ +MSIMessage pci_get_msi_message(PCIDevice *dev, int vector) +{ + assert(false); +} + +uint16_t pci_requester_id(PCIDevice *dev) +{ + assert(false); +} --=20 2.13.3 From nobody Mon Apr 29 07:03:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500997073017901.3211904694087; Tue, 25 Jul 2017 08:37:53 -0700 (PDT) Received: from localhost ([::1]:33258 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1uA-0002vx-GL for importer@patchew.org; Tue, 25 Jul 2017 11:37:50 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52371) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1qL-00006C-IV for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:33:54 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da1qK-00080l-Pk for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:33:53 -0400 Received: from mx1.redhat.com ([209.132.183.28]:36902) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1da1qK-00080H-K5 for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:33:52 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 96F287AEB5; Tue, 25 Jul 2017 15:33:51 +0000 (UTC) Received: from localhost (ovpn-116-214.ams2.redhat.com [10.36.116.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id AF59F96532; Tue, 25 Jul 2017 15:33:48 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 96F287AEB5 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 25 Jul 2017 17:33:23 +0200 Message-Id: <20170725153330.14966-3-cohuck@redhat.com> In-Reply-To: <20170725153330.14966-1-cohuck@redhat.com> References: <20170725153330.14966-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 25 Jul 2017 15:33:51 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 2/9] s390x/pci: add stubs X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, zyimin@linux.vnet.ibm.com, david@redhat.com, Cornelia Huck , pmorel@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Some non-pci code calls into zpci code. Provide some stubs for builds without pci. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/Makefile.objs | 3 +- hw/s390x/s390-pci-stub.c | 74 ++++++++++++++++++++++++++++++++++++++++++++= ++++ 2 files changed, 76 insertions(+), 1 deletion(-) create mode 100644 hw/s390x/s390-pci-stub.c diff --git a/hw/s390x/Makefile.objs b/hw/s390x/Makefile.objs index b2aade2466..7ee19d3abc 100644 --- a/hw/s390x/Makefile.objs +++ b/hw/s390x/Makefile.objs @@ -11,7 +11,8 @@ obj-y +=3D 3270-ccw.o obj-y +=3D virtio-ccw.o obj-y +=3D css-bridge.o obj-y +=3D ccw-device.o -obj-y +=3D s390-pci-bus.o s390-pci-inst.o +obj-$(CONFIG_PCI) +=3D s390-pci-bus.o s390-pci-inst.o +obj-$(call lnot,$(CONFIG_PCI)) +=3D s390-pci-stub.o obj-y +=3D s390-skeys.o obj-y +=3D s390-stattrib.o obj-$(CONFIG_KVM) +=3D s390-skeys-kvm.o diff --git a/hw/s390x/s390-pci-stub.c b/hw/s390x/s390-pci-stub.c new file mode 100644 index 0000000000..2e7e42a2af --- /dev/null +++ b/hw/s390x/s390-pci-stub.c @@ -0,0 +1,74 @@ +/* stubs for non-pci builds */ + +#include "qemu/osdep.h" +#include "qemu-common.h" +#include "cpu.h" +#include "s390-pci-inst.h" +#include "s390-pci-bus.h" + +/* target/s390x/ioinst.c */ +int chsc_sei_nt2_get_event(void *res) +{ + return 1; +} + +int chsc_sei_nt2_have_event(void) +{ + return 0; +} + +/* hw/s390x/sclp.c */ +void s390_pci_sclp_configure(SCCB *sccb) +{ +} + +void s390_pci_sclp_deconfigure(SCCB *sccb) +{ +} + +/* target/s390x/kvm.c */ +int clp_service_call(S390CPU *cpu, uint8_t r2) +{ + return -1; +} + +int pcilg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2) +{ + return -1; +} + +int pcistg_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2) +{ + return -1; +} + +int stpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t = ar) +{ + return -1; +} + +int rpcit_service_call(S390CPU *cpu, uint8_t r1, uint8_t r2) +{ + return -1; +} + +int pcistb_service_call(S390CPU *cpu, uint8_t r1, uint8_t r3, uint64_t gad= dr, + uint8_t ar) +{ + return -1; +} + +int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t a= r) +{ + return -1; +} + +S390pciState *s390_get_phb(void) +{ + return NULL; +} + +S390PCIBusDevice *s390_pci_find_dev_by_idx(S390pciState *s, uint32_t idx) +{ + return NULL; +} --=20 2.13.3 From nobody Mon Apr 29 07:03:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500996967700645.1574268326043; Tue, 25 Jul 2017 08:36:07 -0700 (PDT) Received: from localhost ([::1]:33252 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1sT-0001Vx-7G for importer@patchew.org; Tue, 25 Jul 2017 11:36:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52387) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1qO-00007o-0V for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:01 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da1qN-00081s-1S for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:33:56 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37244) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1da1qM-00081Z-Oq for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:33:54 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BA08FA0B57; Tue, 25 Jul 2017 15:33:53 +0000 (UTC) Received: from localhost (ovpn-116-214.ams2.redhat.com [10.36.116.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4C84895A74; Tue, 25 Jul 2017 15:33:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com BA08FA0B57 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 25 Jul 2017 17:33:24 +0200 Message-Id: <20170725153330.14966-4-cohuck@redhat.com> In-Reply-To: <20170725153330.14966-1-cohuck@redhat.com> References: <20170725153330.14966-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 25 Jul 2017 15:33:53 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 3/9] s390x: chsc nt2 events are pci-only X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, zyimin@linux.vnet.ibm.com, david@redhat.com, Cornelia Huck , pmorel@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" The nt2 event class is pci-only - don't look for events if pci is not in the active cpu model. Signed-off-by: Cornelia Huck --- hw/s390x/s390-pci-bus.c | 4 ++-- hw/s390x/s390-pci-bus.h | 4 ++-- hw/s390x/s390-pci-stub.c | 4 ++-- target/s390x/ioinst.c | 16 ++++++++++++++++ 4 files changed, 22 insertions(+), 6 deletions(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index 61cfd2138f..c57f6ebae0 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -47,7 +47,7 @@ S390pciState *s390_get_phb(void) return phb; } =20 -int chsc_sei_nt2_get_event(void *res) +int pci_chsc_sei_nt2_get_event(void *res) { ChscSeiNt2Res *nt2_res =3D (ChscSeiNt2Res *)res; PciCcdfAvail *accdf; @@ -87,7 +87,7 @@ int chsc_sei_nt2_get_event(void *res) return rc; } =20 -int chsc_sei_nt2_have_event(void) +int pci_chsc_sei_nt2_have_event(void) { S390pciState *s =3D s390_get_phb(); =20 diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h index 67af2c12ff..5df6292509 100644 --- a/hw/s390x/s390-pci-bus.h +++ b/hw/s390x/s390-pci-bus.h @@ -319,8 +319,8 @@ typedef struct S390pciState { } S390pciState; =20 S390pciState *s390_get_phb(void); -int chsc_sei_nt2_get_event(void *res); -int chsc_sei_nt2_have_event(void); +int pci_chsc_sei_nt2_get_event(void *res); +int pci_chsc_sei_nt2_have_event(void); void s390_pci_sclp_configure(SCCB *sccb); void s390_pci_sclp_deconfigure(SCCB *sccb); void s390_pci_iommu_enable(S390PCIIOMMU *iommu); diff --git a/hw/s390x/s390-pci-stub.c b/hw/s390x/s390-pci-stub.c index 2e7e42a2af..cc7278a865 100644 --- a/hw/s390x/s390-pci-stub.c +++ b/hw/s390x/s390-pci-stub.c @@ -7,12 +7,12 @@ #include "s390-pci-bus.h" =20 /* target/s390x/ioinst.c */ -int chsc_sei_nt2_get_event(void *res) +int pci_chsc_sei_nt2_get_event(void *res) { return 1; } =20 -int chsc_sei_nt2_have_event(void) +int pci_chsc_sei_nt2_have_event(void) { return 0; } diff --git a/target/s390x/ioinst.c b/target/s390x/ioinst.c index 51fbea620d..3fa3301f50 100644 --- a/target/s390x/ioinst.c +++ b/target/s390x/ioinst.c @@ -599,6 +599,22 @@ static int chsc_sei_nt0_have_event(void) return 0; } =20 +static int chsc_sei_nt2_get_event(void *res) +{ + if (s390_has_feat(S390_FEAT_ZPCI)) { + return pci_chsc_sei_nt2_get_event(res); + } + return 1; +} + +static int chsc_sei_nt2_have_event(void) +{ + if (s390_has_feat(S390_FEAT_ZPCI)) { + return pci_chsc_sei_nt2_have_event(); + } + return 0; +} + #define CHSC_SEI_NT0 (1ULL << 63) #define CHSC_SEI_NT2 (1ULL << 61) static void ioinst_handle_chsc_sei(ChscReq *req, ChscResp *res) --=20 2.13.3 From nobody Mon Apr 29 07:03:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500997122802820.1297527275303; Tue, 25 Jul 2017 08:38:42 -0700 (PDT) Received: from localhost ([::1]:33261 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1ux-0003YP-4c for importer@patchew.org; Tue, 25 Jul 2017 11:38:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52407) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1qT-0000CL-3g for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:02 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da1qP-00082b-52 for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:37192) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1da1qO-00082O-VJ for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:33:57 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D06BB4A6E6; Tue, 25 Jul 2017 15:33:55 +0000 (UTC) Received: from localhost (ovpn-116-214.ams2.redhat.com [10.36.116.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6DA3D5D961; Tue, 25 Jul 2017 15:33:55 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D06BB4A6E6 Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx09.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 25 Jul 2017 17:33:25 +0200 Message-Id: <20170725153330.14966-5-cohuck@redhat.com> In-Reply-To: <20170725153330.14966-1-cohuck@redhat.com> References: <20170725153330.14966-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.38]); Tue, 25 Jul 2017 15:33:56 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 4/9] s390x/pci: do not advertise pci on non-pci builds X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, zyimin@linux.vnet.ibm.com, david@redhat.com, Cornelia Huck , pmorel@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Only set the zpci feature bit on builds that actually support pci. Signed-off-by: Cornelia Huck Acked-by: Christian Borntraeger Reviewed-by: Thomas Huth --- hw/s390x/s390-pci-bus.c | 5 +++++ hw/s390x/s390-pci-bus.h | 1 + hw/s390x/s390-pci-stub.c | 4 ++++ target/s390x/kvm.c | 2 +- 4 files changed, 11 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-pci-bus.c b/hw/s390x/s390-pci-bus.c index c57f6ebae0..7b30d4c7bd 100644 --- a/hw/s390x/s390-pci-bus.c +++ b/hw/s390x/s390-pci-bus.c @@ -34,6 +34,11 @@ } \ } while (0) =20 +void pci_enable_zpci_feature(S390CPUModel *model) +{ + set_bit(S390_FEAT_ZPCI, model->features); +} + S390pciState *s390_get_phb(void) { static S390pciState *phb; diff --git a/hw/s390x/s390-pci-bus.h b/hw/s390x/s390-pci-bus.h index 5df6292509..d8796536b0 100644 --- a/hw/s390x/s390-pci-bus.h +++ b/hw/s390x/s390-pci-bus.h @@ -333,4 +333,5 @@ S390PCIBusDevice *s390_pci_find_dev_by_fid(S390pciState= *s, uint32_t fid); S390PCIBusDevice *s390_pci_find_next_avail_dev(S390pciState *s, S390PCIBusDevice *pbdev); =20 +void pci_enable_zpci_feature(S390CPUModel *model); #endif diff --git a/hw/s390x/s390-pci-stub.c b/hw/s390x/s390-pci-stub.c index cc7278a865..8ceaf482e7 100644 --- a/hw/s390x/s390-pci-stub.c +++ b/hw/s390x/s390-pci-stub.c @@ -72,3 +72,7 @@ S390PCIBusDevice *s390_pci_find_dev_by_idx(S390pciState *= s, uint32_t idx) { return NULL; } + +void pci_enable_zpci_feature(S390CPUModel *model) +{ +} diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index c4c5791d27..866ac3d414 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2662,7 +2662,7 @@ void kvm_s390_get_host_cpu_model(S390CPUModel *model,= Error **errp) } =20 /* We emulate a zPCI bus and AEN, therefore we don't need HW support */ - set_bit(S390_FEAT_ZPCI, model->features); + pci_enable_zpci_feature(model); set_bit(S390_FEAT_ADAPTER_EVENT_NOTIFICATION, model->features); =20 if (s390_known_cpu_type(cpu_type)) { --=20 2.13.3 From nobody Mon Apr 29 07:03:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500997283125371.7833233789096; Tue, 25 Jul 2017 08:41:23 -0700 (PDT) Received: from localhost ([::1]:33280 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1xY-0005zG-Dm for importer@patchew.org; Tue, 25 Jul 2017 11:41:20 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52418) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1qT-0000Cz-Nh for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:06 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da1qS-00088S-V5 for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:01 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55158) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1da1qS-00086i-OY for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id AA12B80462; Tue, 25 Jul 2017 15:33:59 +0000 (UTC) Received: from localhost (ovpn-116-214.ams2.redhat.com [10.36.116.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 846C65D961; Tue, 25 Jul 2017 15:33:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AA12B80462 Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx04.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 25 Jul 2017 17:33:26 +0200 Message-Id: <20170725153330.14966-6-cohuck@redhat.com> In-Reply-To: <20170725153330.14966-1-cohuck@redhat.com> References: <20170725153330.14966-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.28]); Tue, 25 Jul 2017 15:33:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 5/9] s390x/ccw: create s390 phb conditionally X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, zyimin@linux.vnet.ibm.com, david@redhat.com, Cornelia Huck , pmorel@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Don't create the s390 pci host bridge if we do not provide the zpci facility. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck Acked-by: Christian Borntraeger --- hw/s390x/s390-virtio-ccw.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 1c7af39ce6..8be4a541c1 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -118,7 +118,6 @@ static void ccw_init(MachineState *machine) { int ret; VirtualCssBus *css_bus; - DeviceState *dev; =20 s390_sclp_init(); s390_memory_init(machine->ram_size); @@ -134,10 +133,13 @@ static void ccw_init(MachineState *machine) machine->initrd_filename, "s390-ccw.img", "s390-netboot.img", true); =20 - dev =3D qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE); - object_property_add_child(qdev_get_machine(), TYPE_S390_PCI_HOST_BRIDG= E, - OBJECT(dev), NULL); - qdev_init_nofail(dev); + if (s390_has_feat(S390_FEAT_ZPCI)) { + DeviceState *dev =3D qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE); + object_property_add_child(qdev_get_machine(), + TYPE_S390_PCI_HOST_BRIDGE, + OBJECT(dev), NULL); + qdev_init_nofail(dev); + } =20 /* register hypercalls */ virtio_ccw_register_hcalls(); --=20 2.13.3 From nobody Mon Apr 29 07:03:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500997483252570.3925420598979; Tue, 25 Jul 2017 08:44:43 -0700 (PDT) Received: from localhost ([::1]:33295 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da20m-0000Vo-U8 for importer@patchew.org; Tue, 25 Jul 2017 11:44:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52469) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1qf-0000LE-9S for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da1qa-0008HH-Bf for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:38016) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1da1qa-0008Gk-5C for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:08 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 277277F3F2; Tue, 25 Jul 2017 15:34:07 +0000 (UTC) Received: from localhost (ovpn-116-214.ams2.redhat.com [10.36.116.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 53E1596533; Tue, 25 Jul 2017 15:34:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 277277F3F2 Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx01.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 25 Jul 2017 17:33:27 +0200 Message-Id: <20170725153330.14966-7-cohuck@redhat.com> In-Reply-To: <20170725153330.14966-1-cohuck@redhat.com> References: <20170725153330.14966-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.25]); Tue, 25 Jul 2017 15:34:07 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 6/9] s390x/sclp: properly guard pci-specific functions X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, zyimin@linux.vnet.ibm.com, david@redhat.com, Cornelia Huck , pmorel@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If we do not provide zpci, pci reconfiguration via sclp is not available either. Don't indicate it in the sclp facilities and return an invalid command if the guest tries to issue pci configure/deconfigure. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- hw/s390x/sclp.c | 19 +++++++++++++++---- 1 file changed, 15 insertions(+), 4 deletions(-) diff --git a/hw/s390x/sclp.c b/hw/s390x/sclp.c index 9253dbbc64..d0104cd784 100644 --- a/hw/s390x/sclp.c +++ b/hw/s390x/sclp.c @@ -59,6 +59,7 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) int rnsize, rnmax; int slots =3D MIN(machine->ram_slots, s390_get_memslot_count(kvm_state= )); IplParameterBlock *ipib =3D s390_ipl_get_iplb(); + uint64_t sclp_facilities =3D SCLP_HAS_CPU_INFO; =20 CPU_FOREACH(cpu) { cpu_count++; @@ -79,8 +80,10 @@ static void read_SCP_info(SCLPDevice *sclp, SCCB *sccb) =20 prepare_cpu_entries(sclp, read_info->entries, cpu_count); =20 - read_info->facilities =3D cpu_to_be64(SCLP_HAS_CPU_INFO | - SCLP_HAS_PCI_RECONFIG); + if (s390_has_feat(S390_FEAT_ZPCI)) { + sclp_facilities |=3D SCLP_HAS_PCI_RECONFIG; + } + read_info->facilities =3D cpu_to_be64(sclp_facilities); =20 /* Memory Hotplug is only supported for the ccw machine type */ if (mhd) { @@ -385,10 +388,18 @@ static void sclp_execute(SCLPDevice *sclp, SCCB *sccb= , uint32_t code) sclp_c->unassign_storage(sclp, sccb); break; case SCLP_CMDW_CONFIGURE_PCI: - s390_pci_sclp_configure(sccb); + if (s390_has_feat(S390_FEAT_ZPCI)) { + s390_pci_sclp_configure(sccb); + } else { + sccb->h.response_code =3D cpu_to_be16(SCLP_RC_INVALID_SCLP_COM= MAND); + } break; case SCLP_CMDW_DECONFIGURE_PCI: - s390_pci_sclp_deconfigure(sccb); + if (s390_has_feat(S390_FEAT_ZPCI)) { + s390_pci_sclp_deconfigure(sccb); + } else { + sccb->h.response_code =3D cpu_to_be16(SCLP_RC_INVALID_SCLP_COM= MAND); + } break; default: efc->command_handler(ef, sccb, code); --=20 2.13.3 From nobody Mon Apr 29 07:03:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1500997561953827.507552949142; Tue, 25 Jul 2017 08:46:01 -0700 (PDT) Received: from localhost ([::1]:33305 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da21z-0001Qq-JU for importer@patchew.org; Tue, 25 Jul 2017 11:45:55 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52470) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1qf-0000LG-9T for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da1qe-0008Kz-9L for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:43464) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1da1qe-0008JT-0g for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:12 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 05DE3883B9; Tue, 25 Jul 2017 15:34:11 +0000 (UTC) Received: from localhost (ovpn-116-214.ams2.redhat.com [10.36.116.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id CC1778F34A; Tue, 25 Jul 2017 15:34:08 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 05DE3883B9 Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx02.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 25 Jul 2017 17:33:28 +0200 Message-Id: <20170725153330.14966-8-cohuck@redhat.com> In-Reply-To: <20170725153330.14966-1-cohuck@redhat.com> References: <20170725153330.14966-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.26]); Tue, 25 Jul 2017 15:34:11 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 7/9] s390x/pci: fence off instructions for non-pci X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, zyimin@linux.vnet.ibm.com, david@redhat.com, Cornelia Huck , pmorel@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If a guest running on a machine without zpci issues a pci instruction, throw them an exception. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- target/s390x/kvm.c | 54 +++++++++++++++++++++++++++++++++++++++++---------= ---- 1 file changed, 41 insertions(+), 13 deletions(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 866ac3d414..dc3f940b95 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -1191,7 +1191,11 @@ static int kvm_clp_service_call(S390CPU *cpu, struct= kvm_run *run) { uint8_t r2 =3D (run->s390_sieic.ipb & 0x000f0000) >> 16; =20 - return clp_service_call(cpu, r2); + if (s390_has_feat(S390_FEAT_ZPCI)) { + return clp_service_call(cpu, r2); + } else { + return -1; + } } =20 static int kvm_pcilg_service_call(S390CPU *cpu, struct kvm_run *run) @@ -1199,7 +1203,11 @@ static int kvm_pcilg_service_call(S390CPU *cpu, stru= ct kvm_run *run) uint8_t r1 =3D (run->s390_sieic.ipb & 0x00f00000) >> 20; uint8_t r2 =3D (run->s390_sieic.ipb & 0x000f0000) >> 16; =20 - return pcilg_service_call(cpu, r1, r2); + if (s390_has_feat(S390_FEAT_ZPCI)) { + return pcilg_service_call(cpu, r1, r2); + } else { + return -1; + } } =20 static int kvm_pcistg_service_call(S390CPU *cpu, struct kvm_run *run) @@ -1207,7 +1215,11 @@ static int kvm_pcistg_service_call(S390CPU *cpu, str= uct kvm_run *run) uint8_t r1 =3D (run->s390_sieic.ipb & 0x00f00000) >> 20; uint8_t r2 =3D (run->s390_sieic.ipb & 0x000f0000) >> 16; =20 - return pcistg_service_call(cpu, r1, r2); + if (s390_has_feat(S390_FEAT_ZPCI)) { + return pcistg_service_call(cpu, r1, r2); + } else { + return -1; + } } =20 static int kvm_stpcifc_service_call(S390CPU *cpu, struct kvm_run *run) @@ -1216,10 +1228,14 @@ static int kvm_stpcifc_service_call(S390CPU *cpu, s= truct kvm_run *run) uint64_t fiba; uint8_t ar; =20 - cpu_synchronize_state(CPU(cpu)); - fiba =3D get_base_disp_rxy(cpu, run, &ar); + if (s390_has_feat(S390_FEAT_ZPCI)) { + cpu_synchronize_state(CPU(cpu)); + fiba =3D get_base_disp_rxy(cpu, run, &ar); =20 - return stpcifc_service_call(cpu, r1, fiba, ar); + return stpcifc_service_call(cpu, r1, fiba, ar); + } else { + return -1; + } } =20 static int kvm_sic_service_call(S390CPU *cpu, struct kvm_run *run) @@ -1247,7 +1263,11 @@ static int kvm_rpcit_service_call(S390CPU *cpu, stru= ct kvm_run *run) uint8_t r1 =3D (run->s390_sieic.ipb & 0x00f00000) >> 20; uint8_t r2 =3D (run->s390_sieic.ipb & 0x000f0000) >> 16; =20 - return rpcit_service_call(cpu, r1, r2); + if (s390_has_feat(S390_FEAT_ZPCI)) { + return rpcit_service_call(cpu, r1, r2); + } else { + return -1; + } } =20 static int kvm_pcistb_service_call(S390CPU *cpu, struct kvm_run *run) @@ -1257,10 +1277,14 @@ static int kvm_pcistb_service_call(S390CPU *cpu, st= ruct kvm_run *run) uint64_t gaddr; uint8_t ar; =20 - cpu_synchronize_state(CPU(cpu)); - gaddr =3D get_base_disp_rsy(cpu, run, &ar); + if (s390_has_feat(S390_FEAT_ZPCI)) { + cpu_synchronize_state(CPU(cpu)); + gaddr =3D get_base_disp_rsy(cpu, run, &ar); =20 - return pcistb_service_call(cpu, r1, r3, gaddr, ar); + return pcistb_service_call(cpu, r1, r3, gaddr, ar); + } else { + return -1; + } } =20 static int kvm_mpcifc_service_call(S390CPU *cpu, struct kvm_run *run) @@ -1269,10 +1293,14 @@ static int kvm_mpcifc_service_call(S390CPU *cpu, st= ruct kvm_run *run) uint64_t fiba; uint8_t ar; =20 - cpu_synchronize_state(CPU(cpu)); - fiba =3D get_base_disp_rxy(cpu, run, &ar); + if (s390_has_feat(S390_FEAT_ZPCI)) { + cpu_synchronize_state(CPU(cpu)); + fiba =3D get_base_disp_rxy(cpu, run, &ar); =20 - return mpcifc_service_call(cpu, r1, fiba, ar); + return mpcifc_service_call(cpu, r1, fiba, ar); + } else { + return -1; + } } =20 static int handle_b9(S390CPU *cpu, struct kvm_run *run, uint8_t ipa1) --=20 2.13.3 From nobody Mon Apr 29 07:03:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150099712573092.32215479067577; Tue, 25 Jul 2017 08:38:45 -0700 (PDT) Received: from localhost ([::1]:33262 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1uz-0003Zb-4U for importer@patchew.org; Tue, 25 Jul 2017 11:38:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52498) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1qi-0000PG-Vl for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da1qi-0008RE-CC for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50050) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1da1qi-0008Qp-5j for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:16 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 056F9369C4; Tue, 25 Jul 2017 15:34:15 +0000 (UTC) Received: from localhost (ovpn-116-214.ams2.redhat.com [10.36.116.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B194A65E82; Tue, 25 Jul 2017 15:34:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 056F9369C4 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 25 Jul 2017 17:33:29 +0200 Message-Id: <20170725153330.14966-9-cohuck@redhat.com> In-Reply-To: <20170725153330.14966-1-cohuck@redhat.com> References: <20170725153330.14966-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 25 Jul 2017 15:34:15 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 8/9] s390x/kvm: msi route fixup for non-pci X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, zyimin@linux.vnet.ibm.com, david@redhat.com, Cornelia Huck , pmorel@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" If we don't provide pci, we cannot have a pci device for which we have to translate to adapter routes: just return -ENODEV. Signed-off-by: Cornelia Huck --- target/s390x/kvm.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index dc3f940b95..fb3e21a3a4 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2424,6 +2424,11 @@ int kvm_arch_fixup_msi_route(struct kvm_irq_routing_= entry *route, uint32_t idx =3D data >> ZPCI_MSI_VEC_BITS; uint32_t vec =3D data & ZPCI_MSI_VEC_MASK; =20 + if (!s390_has_feat(S390_FEAT_ZPCI)) { + DPRINTF("fixup_msi_route on non-pci machine?!\n"); + return -ENODEV; + } + pbdev =3D s390_pci_find_dev_by_idx(s390_get_phb(), idx); if (!pbdev) { DPRINTF("add_msi_route no dev\n"); --=20 2.13.3 From nobody Mon Apr 29 07:03:31 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 150099723253241.10189057127343; Tue, 25 Jul 2017 08:40:32 -0700 (PDT) Received: from localhost ([::1]:33271 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1wj-0005G2-1Z for importer@patchew.org; Tue, 25 Jul 2017 11:40:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52521) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1da1qk-0000RK-Rt for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:23 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1da1qk-0008S2-9s for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:50232) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1da1qk-0008Rf-3f for qemu-devel@nongnu.org; Tue, 25 Jul 2017 11:34:18 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 182AF356F3; Tue, 25 Jul 2017 15:34:17 +0000 (UTC) Received: from localhost (ovpn-116-214.ams2.redhat.com [10.36.116.214]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A74068F34A; Tue, 25 Jul 2017 15:34:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 182AF356F3 Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx06.extmail.prod.ext.phx2.redhat.com; spf=pass smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 25 Jul 2017 17:33:30 +0200 Message-Id: <20170725153330.14966-10-cohuck@redhat.com> In-Reply-To: <20170725153330.14966-1-cohuck@redhat.com> References: <20170725153330.14966-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Tue, 25 Jul 2017 15:34:17 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH v3 9/9] s390x: refine pci dependencies X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: thuth@redhat.com, zyimin@linux.vnet.ibm.com, david@redhat.com, Cornelia Huck , pmorel@linux.vnet.ibm.com, agraf@suse.de, borntraeger@de.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" VIRTIO_PCI should properly depend on CONFIG_PCI. With this change, we can switch off pci for s390x by removing 'CONFIG_PCI=3Dy' from the default config. Reviewed-by: Thomas Huth Signed-off-by: Cornelia Huck --- default-configs/s390x-softmmu.mak | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/default-configs/s390x-softmmu.mak b/default-configs/s390x-soft= mmu.mak index b227a36179..7adaa4a4fe 100644 --- a/default-configs/s390x-softmmu.mak +++ b/default-configs/s390x-softmmu.mak @@ -1,5 +1,5 @@ CONFIG_PCI=3Dy -CONFIG_VIRTIO_PCI=3Dy +CONFIG_VIRTIO_PCI=3D$(CONFIG_PCI) CONFIG_VHOST_USER_SCSI=3D$(CONFIG_LINUX) CONFIG_VIRTIO=3Dy CONFIG_SCLPCONSOLE=3Dy --=20 2.13.3