From nobody Fri May 3 05:03:43 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 1501860991565410.0011021370011; Fri, 4 Aug 2017 08:36:31 -0700 (PDT) Received: from localhost ([::1]:46703 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddeeL-0005Vq-R8 for importer@patchew.org; Fri, 04 Aug 2017 11:36:29 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52194) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddsH-0002fm-3L for qemu-devel@nongnu.org; Fri, 04 Aug 2017 10:47:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddanl-0003MZ-RO for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:31:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58730) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddanl-0003L8-DX for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:29: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 25EFF356E2; Fri, 4 Aug 2017 11:29:56 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 811E88BE35; Fri, 4 Aug 2017 11:29:53 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 25EFF356E2 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=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 4 Aug 2017 13:29:38 +0200 Message-Id: <20170804112946.5247-2-cohuck@redhat.com> In-Reply-To: <20170804112946.5247-1-cohuck@redhat.com> References: <20170804112946.5247-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.30]); Fri, 04 Aug 2017 11:29: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 v4 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. Also, to make this more obvious, guard them via a pci_available boolean (which also can be reused in other places). 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 --- accel/kvm/kvm-all.c | 6 +++--- hw/pci/pci-stub.c | 13 +++++++++++++ hw/pci/pci.c | 2 ++ include/hw/pci/pci.h | 2 ++ 4 files changed, 20 insertions(+), 3 deletions(-) diff --git a/accel/kvm/kvm-all.c b/accel/kvm/kvm-all.c index 46ce479dc3..f85553a851 100644 --- a/accel/kvm/kvm-all.c +++ b/accel/kvm/kvm-all.c @@ -1248,7 +1248,7 @@ int kvm_irqchip_add_msi_route(KVMState *s, int vector= , PCIDevice *dev) int virq; MSIMessage msg =3D {0, 0}; =20 - if (dev) { + if (pci_available && dev) { msg =3D pci_get_msi_message(dev, vector); } =20 @@ -1271,7 +1271,7 @@ int kvm_irqchip_add_msi_route(KVMState *s, int vector= , PCIDevice *dev) kroute.u.msi.address_lo =3D (uint32_t)msg.address; kroute.u.msi.address_hi =3D msg.address >> 32; kroute.u.msi.data =3D le32_to_cpu(msg.data); - if (kvm_msi_devid_required()) { + if (pci_available && kvm_msi_devid_required()) { kroute.flags =3D KVM_MSI_VALID_DEVID; kroute.u.msi.devid =3D pci_requester_id(dev); } @@ -1309,7 +1309,7 @@ int kvm_irqchip_update_msi_route(KVMState *s, int vir= q, MSIMessage msg, kroute.u.msi.address_lo =3D (uint32_t)msg.address; kroute.u.msi.address_hi =3D msg.address >> 32; kroute.u.msi.data =3D le32_to_cpu(msg.data); - if (kvm_msi_devid_required()) { + if (pci_available && kvm_msi_devid_required()) { kroute.flags =3D KVM_MSI_VALID_DEVID; kroute.u.msi.devid =3D pci_requester_id(dev); } diff --git a/hw/pci/pci-stub.c b/hw/pci/pci-stub.c index ecad664946..877c5d165e 100644 --- a/hw/pci/pci-stub.c +++ b/hw/pci/pci-stub.c @@ -23,10 +23,12 @@ #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 bool msi_nonbroken; +bool pci_available; =20 PciInfoList *qmp_query_pci(Error **errp) { @@ -38,3 +40,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); +} diff --git a/hw/pci/pci.c b/hw/pci/pci.c index 258fbe51e2..26f346db2c 100644 --- a/hw/pci/pci.c +++ b/hw/pci/pci.c @@ -49,6 +49,8 @@ # define PCI_DPRINTF(format, ...) do { } while (0) #endif =20 +bool pci_available =3D true; + static void pcibus_dev_print(Monitor *mon, DeviceState *dev, int indent); static char *pcibus_get_dev_path(DeviceState *dev); static char *pcibus_get_fw_dev_path(DeviceState *dev); diff --git a/include/hw/pci/pci.h b/include/hw/pci/pci.h index e598b095eb..8bb6449dd7 100644 --- a/include/hw/pci/pci.h +++ b/include/hw/pci/pci.h @@ -10,6 +10,8 @@ =20 #include "hw/pci/pcie.h" =20 +extern bool pci_available; + /* PCI bus */ =20 #define PCI_DEVFN(slot, func) ((((slot) & 0x1f) << 3) | ((func) & 0x07)) --=20 2.13.3 From nobody Fri May 3 05:03:43 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 1501860041848585.8198371992328; Fri, 4 Aug 2017 08:20:41 -0700 (PDT) Received: from localhost ([::1]:44961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddeP2-0002FD-3T for importer@patchew.org; Fri, 04 Aug 2017 11:20:40 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddsL-0000tu-TB for qemu-devel@nongnu.org; Fri, 04 Aug 2017 10:47:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddanp-0003SL-95 for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:31:07 -0400 Received: from mx1.redhat.com ([209.132.183.28]:58616) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddanp-0003Qr-0o for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:30:01 -0400 Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id CB3816147A; Fri, 4 Aug 2017 11:29:59 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 96F5960A9B; Fri, 4 Aug 2017 11:29:57 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com CB3816147A Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx10.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 4 Aug 2017 13:29:39 +0200 Message-Id: <20170804112946.5247-3-cohuck@redhat.com> In-Reply-To: <20170804112946.5247-1-cohuck@redhat.com> References: <20170804112946.5247-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.39]); Fri, 04 Aug 2017 11:30:00 +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 v4 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 Fri May 3 05:03:43 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 1501857586313473.03961942023693; Fri, 4 Aug 2017 07:39:46 -0700 (PDT) Received: from localhost ([::1]:34871 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddlQ-00077r-9C for importer@patchew.org; Fri, 04 Aug 2017 10:39:44 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:39651) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddjG-0005Pw-Fp for qemu-devel@nongnu.org; Fri, 04 Aug 2017 10:37:40 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddanr-0003VZ-Jr for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:31:31 -0400 Received: from mx1.redhat.com ([209.132.183.28]:34658) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddanr-0003U0-2E for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:30:03 -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 AD20DC0587D1; Fri, 4 Aug 2017 11:30:01 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 47B508BE2F; Fri, 4 Aug 2017 11:30:01 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com AD20DC0587D1 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 4 Aug 2017 13:29:40 +0200 Message-Id: <20170804112946.5247-4-cohuck@redhat.com> In-Reply-To: <20170804112946.5247-1-cohuck@redhat.com> References: <20170804112946.5247-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.32]); Fri, 04 Aug 2017 11:30:01 +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 v4 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 Fri May 3 05:03:43 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 1501858204935271.18611208050913; Fri, 4 Aug 2017 07:50:04 -0700 (PDT) Received: from localhost ([::1]:37039 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddvP-0000Ri-Ir for importer@patchew.org; Fri, 04 Aug 2017 10:50:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:52926) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddap2-0004Bx-2g for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:32:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddanx-0003hi-Ld for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:31:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:40024) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddanx-0003fk-EI for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:30:09 -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 48FD680E75; Fri, 4 Aug 2017 11:30:08 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 218BD67CF7; Fri, 4 Aug 2017 11:30:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 48FD680E75 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=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 4 Aug 2017 13:29:41 +0200 Message-Id: <20170804112946.5247-5-cohuck@redhat.com> In-Reply-To: <20170804112946.5247-1-cohuck@redhat.com> References: <20170804112946.5247-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.25]); Fri, 04 Aug 2017 11:30:08 +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 v4 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 Reviewed-by: David Hildenbrand --- target/s390x/kvm.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index c4c5791d27..bc62bba5b7 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2662,7 +2662,9 @@ 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); + if (pci_available) { + set_bit(S390_FEAT_ZPCI, model->features); + } set_bit(S390_FEAT_ADAPTER_EVENT_NOTIFICATION, model->features); =20 if (s390_known_cpu_type(cpu_type)) { --=20 2.13.3 From nobody Fri May 3 05:03:43 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 1501860576421430.21781323952655; Fri, 4 Aug 2017 08:29:36 -0700 (PDT) Received: from localhost ([::1]:45873 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddeXe-00047g-N8 for importer@patchew.org; Fri, 04 Aug 2017 11:29:34 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58424) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddKI-0005VR-E0 for qemu-devel@nongnu.org; Fri, 04 Aug 2017 10:11:52 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddao2-0003ru-KZ for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:31:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41396) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddao2-0003pj-80 for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:30:14 -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 1369213A5D; Fri, 4 Aug 2017 11:30:13 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id B564C8F34D; Fri, 4 Aug 2017 11:30:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1369213A5D Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 4 Aug 2017 13:29:42 +0200 Message-Id: <20170804112946.5247-6-cohuck@redhat.com> In-Reply-To: <20170804112946.5247-1-cohuck@redhat.com> References: <20170804112946.5247-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.29]); Fri, 04 Aug 2017 11:30:13 +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 v4 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 Acked-by: Christian Borntraeger Signed-off-by: Cornelia Huck --- 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 Fri May 3 05:03:43 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 1501859857065986.5250021662629; Fri, 4 Aug 2017 08:17:37 -0700 (PDT) Received: from localhost ([::1]:44650 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddeM3-0007ok-5g for importer@patchew.org; Fri, 04 Aug 2017 11:17:35 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:50398) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddsI-0001f0-H7 for qemu-devel@nongnu.org; Fri, 04 Aug 2017 10:47:36 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddao6-0003ze-Ha for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:31:24 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57136) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddao6-0003xs-46 for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:30:18 -0400 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id E1F94C047B7B; Fri, 4 Aug 2017 11:30:16 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 80FFC7D6A0; Fri, 4 Aug 2017 11:30:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E1F94C047B7B Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx07.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 4 Aug 2017 13:29:43 +0200 Message-Id: <20170804112946.5247-7-cohuck@redhat.com> In-Reply-To: <20170804112946.5247-1-cohuck@redhat.com> References: <20170804112946.5247-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Fri, 04 Aug 2017 11:30: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 v4 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 Fri May 3 05:03:43 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 1501861059425497.9527496150324; Fri, 4 Aug 2017 08:37:39 -0700 (PDT) Received: from localhost ([::1]:46833 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddefS-0006lG-1M for importer@patchew.org; Fri, 04 Aug 2017 11:37:38 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51533) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddsI-0002Eu-5l for qemu-devel@nongnu.org; Fri, 04 Aug 2017 10:47:39 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddao8-000439-JJ for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:31:26 -0400 Received: from mx1.redhat.com ([209.132.183.28]:41624) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddao8-00041E-5H for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:30:20 -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 E0FBC13A43; Fri, 4 Aug 2017 11:30:18 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 52E586046D; Fri, 4 Aug 2017 11:30:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E0FBC13A43 Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 4 Aug 2017 13:29:44 +0200 Message-Id: <20170804112946.5247-8-cohuck@redhat.com> In-Reply-To: <20170804112946.5247-1-cohuck@redhat.com> References: <20170804112946.5247-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.29]); Fri, 04 Aug 2017 11:30:19 +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 v4 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 bc62bba5b7..9de165d8b1 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 Fri May 3 05:03:43 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 1501860635900875.4026222769205; Fri, 4 Aug 2017 08:30:35 -0700 (PDT) Received: from localhost ([::1]:46029 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ddeYa-0006WG-49 for importer@patchew.org; Fri, 04 Aug 2017 11:30:32 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48105) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddDG-0006HA-1h for qemu-devel@nongnu.org; Fri, 04 Aug 2017 10:04:42 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddaoC-0004AR-GS for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:31:30 -0400 Received: from mx1.redhat.com ([209.132.183.28]:60082) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddaoC-00047z-70 for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:30:24 -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 EF5D568691; Fri, 4 Aug 2017 11:30:22 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 5A06691E82; Fri, 4 Aug 2017 11:30:20 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com EF5D568691 Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx03.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 4 Aug 2017 13:29:45 +0200 Message-Id: <20170804112946.5247-9-cohuck@redhat.com> In-Reply-To: <20170804112946.5247-1-cohuck@redhat.com> References: <20170804112946.5247-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.27]); Fri, 04 Aug 2017 11:30:23 +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 v4 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 | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 9de165d8b1..d8db1cbf6e 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2424,6 +2424,12 @@ 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)) { + /* How can we get here without pci enabled? */ + g_assert(false); + 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 Fri May 3 05:03:43 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 1501857004911925.2204608492285; Fri, 4 Aug 2017 07:30:04 -0700 (PDT) Received: from localhost ([::1]:34016 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddc3-0005eG-DC for importer@patchew.org; Fri, 04 Aug 2017 10:30:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56493) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dddZp-000446-8e for qemu-devel@nongnu.org; Fri, 04 Aug 2017 10:28:26 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ddaoG-0004Ie-TQ for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:31:54 -0400 Received: from mx1.redhat.com ([209.132.183.28]:35450) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1ddaoG-0004H0-L0 for qemu-devel@nongnu.org; Fri, 04 Aug 2017 07:30:28 -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 D682DC058EC1; Fri, 4 Aug 2017 11:30:26 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6D11B5C544; Fri, 4 Aug 2017 11:30:24 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D682DC058EC1 Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx08.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 4 Aug 2017 13:29:46 +0200 Message-Id: <20170804112946.5247-10-cohuck@redhat.com> In-Reply-To: <20170804112946.5247-1-cohuck@redhat.com> References: <20170804112946.5247-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.32]); Fri, 04 Aug 2017 11:30:27 +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 v4 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 Reviewed-by: David Hildenbrand --- 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