[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 15/44] s390x/pci: add stubs
From: |
Cornelia Huck |
Subject: |
[Qemu-devel] [PULL 15/44] s390x/pci: add stubs |
Date: |
Wed, 30 Aug 2017 18:52:23 +0200 |
Some non-pci code calls into zpci code. Provide some stubs for builds
without pci.
Reviewed-by: Thomas Huth <address@hidden>
Acked-by: Christian Borntraeger <address@hidden>
Acked-by: Halil Pasic <address@hidden>
Signed-off-by: Cornelia Huck <address@hidden>
---
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
--
2.13.5
- [Qemu-devel] [PULL 05/44] tests/boot-sector: Do not overwrite the x86 buffer on other architectures, (continued)
- [Qemu-devel] [PULL 05/44] tests/boot-sector: Do not overwrite the x86 buffer on other architectures, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 06/44] tests/pxe: Check virtio-net-ccw on s390x, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 07/44] tests: Run filter-redirector and -mirror test only on POSIX systems, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 08/44] tests: Add network filter tests to the check-qtest-s390x list, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 10/44] watchdog/wdt_diag288: Mark diag288 watchdog as non-hotpluggable, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 09/44] s390x/tcg: specification exception for unknown diag, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 11/44] s390x: wire up diag288 in tcg, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 12/44] configure: enable --s390-pgste linker option, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 13/44] 9pfs: fix dependencies, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 14/44] kvm: remove hard dependency on pci, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 15/44] s390x/pci: add stubs,
Cornelia Huck <=
- [Qemu-devel] [PULL 16/44] s390x: chsc nt2 events are pci-only, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 17/44] s390x/pci: do not advertise pci on non-pci builds, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 18/44] s390x/ccw: create s390 phb conditionally, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 19/44] s390x/sclp: properly guard pci-specific functions, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 20/44] s390x/pci: fence off instructions for non-pci, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 21/44] s390x: refine pci dependencies, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 22/44] s390x/s390-skeys: Mark the storage key devices with user_creatable = false, Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 23/44] s390x/kvm: drop KVMState parameter from s390_get_memslot_count(), Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 24/44] s390x/kvm: drop KVMState parameter from kvm_s390_set_mem_limit(), Cornelia Huck, 2017/08/30
- [Qemu-devel] [PULL 25/44] target/s390x: simplify ri_allowed(), Cornelia Huck, 2017/08/30