From patchwork Wed Aug 30 16:52:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Cornelia Huck X-Patchwork-Id: 9930231 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 4491960309 for ; Wed, 30 Aug 2017 17:03:42 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2E60827D29 for ; Wed, 30 Aug 2017 17:03:42 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 232B1286F5; Wed, 30 Aug 2017 17:03:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id B864127D29 for ; Wed, 30 Aug 2017 17:03:41 +0000 (UTC) Received: from localhost ([::1]:51665 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn6Oy-0001wf-WF for patchwork-qemu-devel@patchwork.kernel.org; Wed, 30 Aug 2017 13:03:41 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:56893) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dn6Fe-00022x-Mp for qemu-devel@nongnu.org; Wed, 30 Aug 2017 12:54:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dn6Fc-0005Hv-Cd for qemu-devel@nongnu.org; Wed, 30 Aug 2017 12:54:02 -0400 Received: from mx1.redhat.com ([209.132.183.28]:56948) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dn6Fc-0005HJ-3A for qemu-devel@nongnu.org; Wed, 30 Aug 2017 12:54:00 -0400 Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 0170281DFE; Wed, 30 Aug 2017 16:53:59 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 0170281DFE 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 Received: from localhost (ovpn-116-210.ams2.redhat.com [10.36.116.210]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 6A2DB5E24A; Wed, 30 Aug 2017 16:53:58 +0000 (UTC) From: Cornelia Huck To: peter.maydell@linaro.org Date: Wed, 30 Aug 2017 18:52:23 +0200 Message-Id: <20170830165252.13421-16-cohuck@redhat.com> In-Reply-To: <20170830165252.13421-1-cohuck@redhat.com> References: <20170830165252.13421-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.25]); Wed, 30 Aug 2017 16:53:59 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PULL 15/44] 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, david@redhat.com, Cornelia Huck , agraf@suse.de, qemu-devel@nongnu.org, borntraeger@de.ibm.com, rth@twiddle.net Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: "Qemu-devel" X-Virus-Scanned: ClamAV using ClamSMTP Some non-pci code calls into zpci code. Provide some stubs for builds without pci. Reviewed-by: Thomas Huth Acked-by: Christian Borntraeger Acked-by: Halil Pasic Signed-off-by: Cornelia Huck --- hw/s390x/Makefile.objs | 3 +- hw/s390x/s390-pci-stub.c | 76 ++++++++++++++++++++++++++++++++++++++++++++++++ include/hw/s390x/sclp.h | 1 + 3 files changed, 79 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 += 3270-ccw.o obj-y += virtio-ccw.o obj-y += css-bridge.o obj-y += ccw-device.o -obj-y += s390-pci-bus.o s390-pci-inst.o +obj-$(CONFIG_PCI) += s390-pci-bus.o s390-pci-inst.o +obj-$(call lnot,$(CONFIG_PCI)) += s390-pci-stub.o obj-y += s390-skeys.o obj-y += s390-stattrib.o obj-$(CONFIG_KVM) += 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..48f8b4e8a3 --- /dev/null +++ b/hw/s390x/s390-pci-stub.c @@ -0,0 +1,76 @@ +/* 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) +{ + sccb->h.response_code = cpu_to_be16(SCLP_RC_ADAPTER_TYPE_NOT_RECOGNIZED); +} + +void s390_pci_sclp_deconfigure(SCCB *sccb) +{ + sccb->h.response_code = cpu_to_be16(SCLP_RC_ADAPTER_TYPE_NOT_RECOGNIZED); +} + +/* 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 gaddr, + uint8_t ar) +{ + return -1; +} + +int mpcifc_service_call(S390CPU *cpu, uint8_t r1, uint64_t fiba, uint8_t ar) +{ + return -1; +} + +S390pciState *s390_get_phb(void) +{ + return NULL; +} + +S390PCIBusDevice *s390_pci_find_dev_by_idx(S390pciState *s, uint32_t idx) +{ + return NULL; +} diff --git a/include/hw/s390x/sclp.h b/include/hw/s390x/sclp.h index e71d526605..fe54442ecd 100644 --- a/include/hw/s390x/sclp.h +++ b/include/hw/s390x/sclp.h @@ -59,6 +59,7 @@ #define SCLP_RC_INSUFFICIENT_SCCB_LENGTH 0x0300 #define SCLP_RC_STANDBY_READ_COMPLETION 0x0410 #define SCLP_RC_ADAPTER_IN_RESERVED_STATE 0x05f0 +#define SCLP_RC_ADAPTER_TYPE_NOT_RECOGNIZED 0x06f0 #define SCLP_RC_ADAPTER_ID_NOT_RECOGNIZED 0x09f0 #define SCLP_RC_INVALID_FUNCTION 0x40f0 #define SCLP_RC_NO_EVENT_BUFFERS_STORED 0x60f0