From nobody Sun Apr 28 01:16: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 15003892150761010.2072545559752; Tue, 18 Jul 2017 07:46:55 -0700 (PDT) Received: from localhost ([::1]:56953 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTlw-0002am-Up for importer@patchew.org; Tue, 18 Jul 2017 10:46:48 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58209) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTR1-0006st-LC for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXTQs-0004hS-3n for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56692) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXTQr-0004gw-U8 for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:02 -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 C9B2D80480; Tue, 18 Jul 2017 14:25:00 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 3B5CB60BE7; Tue, 18 Jul 2017 14:25:00 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com C9B2D80480 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 DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com C9B2D80480 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 18 Jul 2017 16:24:47 +0200 Message-Id: <20170718142455.32676-2-cohuck@redhat.com> In-Reply-To: <20170718142455.32676-1-cohuck@redhat.com> References: <20170718142455.32676-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.28]); Tue, 18 Jul 2017 14:25: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 RFC v2 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, 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 Sun Apr 28 01:16: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 150038899107945.122768737243746; Tue, 18 Jul 2017 07:43:11 -0700 (PDT) Received: from localhost ([::1]:56930 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTiO-0006ux-Op for importer@patchew.org; Tue, 18 Jul 2017 10:43:08 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58165) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTQw-0006ko-Bi for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXTQv-0004ii-Ez for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:06 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54894) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXTQv-0004iR-8E for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:05 -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 3D581C04D2B8; Tue, 18 Jul 2017 14:25:04 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4DC347F467; Tue, 18 Jul 2017 14:25:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 3D581C04D2B8 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=pass smtp.mailfrom=cohuck@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 3D581C04D2B8 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 18 Jul 2017 16:24:48 +0200 Message-Id: <20170718142455.32676-3-cohuck@redhat.com> In-Reply-To: <20170718142455.32676-1-cohuck@redhat.com> References: <20170718142455.32676-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.31]); Tue, 18 Jul 2017 14:25:04 +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 RFC v2 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, 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. Signed-off-by: Cornelia Huck Reviewed-by: Thomas Huth --- 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 Sun Apr 28 01:16: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 1500389108433409.2584546206366; Tue, 18 Jul 2017 07:45:08 -0700 (PDT) Received: from localhost ([::1]:56941 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTkF-0000vA-76 for importer@patchew.org; Tue, 18 Jul 2017 10:45:03 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTQy-0006ne-9v for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:09 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXTQx-0004k3-8p for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:54944) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXTQw-0004jG-Vh for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:07 -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 E34B9C04D293; Tue, 18 Jul 2017 14:25:05 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 85C217F467; Tue, 18 Jul 2017 14:25:05 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com E34B9C04D293 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=pass smtp.mailfrom=cohuck@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com E34B9C04D293 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 18 Jul 2017 16:24:49 +0200 Message-Id: <20170718142455.32676-4-cohuck@redhat.com> In-Reply-To: <20170718142455.32676-1-cohuck@redhat.com> References: <20170718142455.32676-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.31]); Tue, 18 Jul 2017 14:25:06 +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 RFC v2 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, 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 d5e6b8066b..a9e5b13292 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 Sun Apr 28 01:16: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 1500389336023118.23589794013662; Tue, 18 Jul 2017 07:48:56 -0700 (PDT) Received: from localhost ([::1]:56961 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTnx-0004g0-UT for importer@patchew.org; Tue, 18 Jul 2017 10:48:53 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTR1-0006t7-On for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:12 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXTQz-0004nQ-1j for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:11 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56466) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXTQy-0004ld-S0 for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:08 -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 D0A9A7CB98; Tue, 18 Jul 2017 14:25:07 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 699F97E594; Tue, 18 Jul 2017 14:25:07 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com D0A9A7CB98 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 DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com D0A9A7CB98 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 18 Jul 2017 16:24:50 +0200 Message-Id: <20170718142455.32676-5-cohuck@redhat.com> In-Reply-To: <20170718142455.32676-1-cohuck@redhat.com> References: <20170718142455.32676-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.26]); Tue, 18 Jul 2017 14:25: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 RFC v2 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, 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 and aen feature bits on builds that actually support pci. Signed-off-by: Cornelia Huck --- target/s390x/kvm.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 831492f9a2..880eccd58a 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2685,8 +2685,10 @@ void kvm_s390_get_host_cpu_model(S390CPUModel *model= , Error **errp) } =20 /* set zpci and aen facilities */ +#ifdef CONFIG_PCI set_bit(S390_FEAT_ZPCI, model->features); set_bit(S390_FEAT_ADAPTER_EVENT_NOTIFICATION, model->features); +#endif =20 if (s390_known_cpu_type(cpu_type)) { /* we want the exact model, even if some features are missing */ --=20 2.13.3 From nobody Sun Apr 28 01:16: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 1500388774247719.7346805113696; Tue, 18 Jul 2017 07:39:34 -0700 (PDT) Received: from localhost ([::1]:56906 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTeq-0002tH-VT for importer@patchew.org; Tue, 18 Jul 2017 10:39:28 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58249) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTR3-0006w5-Ao for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:14 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXTR2-0004ph-9u for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:13 -0400 Received: from mx1.redhat.com ([209.132.183.28]:46762) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXTR2-0004pB-3P for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:12 -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 0E25F7D0C2; Tue, 18 Jul 2017 14:25:11 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 4F2285E243; Tue, 18 Jul 2017 14:25:09 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0E25F7D0C2 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=pass smtp.mailfrom=cohuck@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 0E25F7D0C2 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 18 Jul 2017 16:24:51 +0200 Message-Id: <20170718142455.32676-6-cohuck@redhat.com> In-Reply-To: <20170718142455.32676-1-cohuck@redhat.com> References: <20170718142455.32676-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.27]); Tue, 18 Jul 2017 14:25: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 RFC v2 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, 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. Signed-off-by: Cornelia Huck Reviewed-by: Thomas Huth --- 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 ce3921e4de..bd3ba30c27 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 Sun Apr 28 01:16: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 1500389442159494.4111714747627; Tue, 18 Jul 2017 07:50:42 -0700 (PDT) Received: from localhost ([::1]:56971 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTpe-0005wc-VZ for importer@patchew.org; Tue, 18 Jul 2017 10:50:39 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58292) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTR5-0006yf-OC for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXTR4-0004rk-EC for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:15 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57264) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXTR4-0004qu-7y for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:14 -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 2F15380480; Tue, 18 Jul 2017 14:25: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 856B67A23A; Tue, 18 Jul 2017 14:25:12 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 2F15380480 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 DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 2F15380480 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 18 Jul 2017 16:24:52 +0200 Message-Id: <20170718142455.32676-7-cohuck@redhat.com> In-Reply-To: <20170718142455.32676-1-cohuck@redhat.com> References: <20170718142455.32676-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.28]); Tue, 18 Jul 2017 14:25: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 RFC v2 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, 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. Signed-off-by: Cornelia Huck Reviewed-by: Thomas Huth --- 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 Sun Apr 28 01:16: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 1500388557409791.2072187816135; Tue, 18 Jul 2017 07:35:57 -0700 (PDT) Received: from localhost ([::1]:56886 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTbO-0007sV-3M for importer@patchew.org; Tue, 18 Jul 2017 10:35:54 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58315) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTR7-00070V-Hs for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:20 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXTR6-0004uh-D1 for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:17 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56786) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXTR6-0004se-36 for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:16 -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 069D07CB90; Tue, 18 Jul 2017 14:25:15 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id A5CFF7BAF5; Tue, 18 Jul 2017 14:25:14 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 069D07CB90 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 DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 069D07CB90 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 18 Jul 2017 16:24:53 +0200 Message-Id: <20170718142455.32676-8-cohuck@redhat.com> In-Reply-To: <20170718142455.32676-1-cohuck@redhat.com> References: <20170718142455.32676-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, 18 Jul 2017 14:25: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 RFC v2 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, 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. Signed-off-by: Cornelia Huck Reviewed-by: Thomas Huth --- 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 880eccd58a..60688888c3 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 Sun Apr 28 01:16: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 1500388895494886.0272630014808; Tue, 18 Jul 2017 07:41:35 -0700 (PDT) Received: from localhost ([::1]:56922 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTgr-0004vq-8U for importer@patchew.org; Tue, 18 Jul 2017 10:41:33 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58335) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTRA-000738-9f for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:21 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXTR8-0004x5-8E for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:55452) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXTR8-0004wh-1d for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:18 -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 F1E78C04D2BE; Tue, 18 Jul 2017 14:25: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 9D1C37F8C5; Tue, 18 Jul 2017 14:25:16 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com F1E78C04D2BE 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=pass smtp.mailfrom=cohuck@redhat.com DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com F1E78C04D2BE From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 18 Jul 2017 16:24:54 +0200 Message-Id: <20170718142455.32676-9-cohuck@redhat.com> In-Reply-To: <20170718142455.32676-1-cohuck@redhat.com> References: <20170718142455.32676-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.31]); Tue, 18 Jul 2017 14:25: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 RFC v2 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, 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 | 33 +++++++++++++++++++-------------- 1 file changed, 19 insertions(+), 14 deletions(-) diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 60688888c3..df0e5af151 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2424,22 +2424,27 @@ 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 - pbdev =3D s390_pci_find_dev_by_idx(s390_get_phb(), idx); - if (!pbdev) { - DPRINTF("add_msi_route no dev\n"); - return -ENODEV; - } + if (s390_has_feat(S390_FEAT_ZPCI)) { + pbdev =3D s390_pci_find_dev_by_idx(s390_get_phb(), idx); + if (!pbdev) { + DPRINTF("add_msi_route no dev\n"); + return -ENODEV; + } =20 - pbdev->routes.adapter.ind_offset =3D vec; + pbdev->routes.adapter.ind_offset =3D vec; =20 - route->type =3D KVM_IRQ_ROUTING_S390_ADAPTER; - route->flags =3D 0; - route->u.adapter.summary_addr =3D pbdev->routes.adapter.summary_addr; - route->u.adapter.ind_addr =3D pbdev->routes.adapter.ind_addr; - route->u.adapter.summary_offset =3D pbdev->routes.adapter.summary_offs= et; - route->u.adapter.ind_offset =3D pbdev->routes.adapter.ind_offset; - route->u.adapter.adapter_id =3D pbdev->routes.adapter.adapter_id; - return 0; + route->type =3D KVM_IRQ_ROUTING_S390_ADAPTER; + route->flags =3D 0; + route->u.adapter.summary_addr =3D pbdev->routes.adapter.summary_ad= dr; + route->u.adapter.ind_addr =3D pbdev->routes.adapter.ind_addr; + route->u.adapter.summary_offset =3D pbdev->routes.adapter.summary_= offset; + route->u.adapter.ind_offset =3D pbdev->routes.adapter.ind_offset; + route->u.adapter.adapter_id =3D pbdev->routes.adapter.adapter_id; + return 0; + } else { + DPRINTF("fixup_msi_route on non-pci machine?!\n"); + return -ENODEV; + } } =20 int kvm_arch_add_msi_route_post(struct kvm_irq_routing_entry *route, --=20 2.13.3 From nobody Sun Apr 28 01:16: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 1500388514366415.9012784262826; Tue, 18 Jul 2017 07:35:14 -0700 (PDT) Received: from localhost ([::1]:56875 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTah-0007Fi-3h for importer@patchew.org; Tue, 18 Jul 2017 10:35:11 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:58346) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dXTRB-000741-5F for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:22 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dXTRA-0004xu-CK for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:21 -0400 Received: from mx1.redhat.com ([209.132.183.28]:57560) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dXTRA-0004xU-64 for qemu-devel@nongnu.org; Tue, 18 Jul 2017 10:25:20 -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 1BC7280476; Tue, 18 Jul 2017 14:25:19 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 911FF17538; Tue, 18 Jul 2017 14:25:18 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1BC7280476 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 DKIM-Filter: OpenDKIM Filter v2.11.0 mx1.redhat.com 1BC7280476 From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 18 Jul 2017 16:24:55 +0200 Message-Id: <20170718142455.32676-10-cohuck@redhat.com> In-Reply-To: <20170718142455.32676-1-cohuck@redhat.com> References: <20170718142455.32676-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.28]); Tue, 18 Jul 2017 14:25: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 RFC v2 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, 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. Signed-off-by: Cornelia Huck Reviewed-by: Thomas Huth --- 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