From nobody Sun Apr 28 23:27:36 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.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 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=fail(p=none dis=none) header.from=redhat.com Return-Path: Received: from lists.gnu.org (209.51.188.17 [209.51.188.17]) by mx.zohomail.com with SMTPS id 1549884876554818.101020234692; Mon, 11 Feb 2019 03:34:36 -0800 (PST) Received: from localhost ([127.0.0.1]:48494 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gt9r0-0001FB-DX for importer@patchew.org; Mon, 11 Feb 2019 06:34:26 -0500 Received: from eggs.gnu.org ([209.51.188.92]:59247) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1gt9pq-0000of-5G for qemu-devel@nongnu.org; Mon, 11 Feb 2019 06:33:15 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1gt9pm-0005vQ-At for qemu-devel@nongnu.org; Mon, 11 Feb 2019 06:33:12 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39450) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1gt9pk-0005sv-Cg; Mon, 11 Feb 2019 06:33:10 -0500 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 4C32280F7B; Mon, 11 Feb 2019 11:33:03 +0000 (UTC) Received: from localhost (ovpn-116-67.ams2.redhat.com [10.36.116.67]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9945D1019629; Mon, 11 Feb 2019 11:33:00 +0000 (UTC) From: Cornelia Huck To: qemu-devel@nongnu.org, qemu-s390x@nongnu.org Date: Mon, 11 Feb 2019 12:32:55 +0100 Message-Id: <20190211113255.3837-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Mon, 11 Feb 2019 11:33:03 +0000 (UTC) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.132.183.28 Subject: [Qemu-devel] [PATCH] s390x: always provide pci support 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: Thomas Huth , David Hildenbrand , Cornelia Huck , Collin Walling , Halil Pasic , Christian Borntraeger , Richard Henderson Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" We tried to make pci support optional on s390x in the past; unfortunately, we still require the s390 phb to be created unconditionally due to backwards compatibility issues. Instead of sinking more effort into this (including compat handling for older machines etc.) for non-obvious gains, let's just make CONFIG_PCI something that is always set on s390x. Note that you can still fence off pci for the _guest_ if you provide a cpu model without the zpci feature. Signed-off-by: Cornelia Huck Acked-by: Christian Borntraeger Reviewed-by: David Hildenbrand Reviewed-by: Thomas Huth --- Follow-up patch to the discussion around "hw/s390x: Fix the function arguments in the pci stub file". I've done a quick sanity test with tcg only so far. --- hw/s390x/Makefile.objs | 3 +- hw/s390x/s390-pci-stub.c | 77 ------------------------------------- hw/s390x/s390-virtio-ccw.c | 4 -- target/s390x/cpu_models.c | 5 --- target/s390x/gen-features.c | 1 - target/s390x/kvm.c | 4 +- 6 files changed, 2 insertions(+), 92 deletions(-) delete mode 100644 hw/s390x/s390-pci-stub.c diff --git a/hw/s390x/Makefile.objs b/hw/s390x/Makefile.objs index a18c4719137e..bfd5326d7c3d 100644 --- a/hw/s390x/Makefile.objs +++ b/hw/s390x/Makefile.objs @@ -21,8 +21,7 @@ obj-$(call land,$(CONFIG_VIRTIO_9P),$(CONFIG_VIRTFS)) += =3D virtio-ccw-9p.o obj-$(CONFIG_VHOST_VSOCK) +=3D vhost-vsock-ccw.o obj-y +=3D css-bridge.o obj-y +=3D ccw-device.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-pci-bus.o s390-pci-inst.o obj-y +=3D s390-skeys.o obj-y +=3D s390-stattrib.o obj-y +=3D tod.o diff --git a/hw/s390x/s390-pci-stub.c b/hw/s390x/s390-pci-stub.c deleted file mode 100644 index ad4c5a77198f..000000000000 --- a/hw/s390x/s390-pci-stub.c +++ /dev/null @@ -1,77 +0,0 @@ -/* 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 pci_chsc_sei_nt2_get_event(void *res) -{ - return 1; -} - -int pci_chsc_sei_nt2_have_event(void) -{ - return 0; -} - -/* hw/s390x/sclp.c */ -void s390_pci_sclp_configure(SCCB *sccb) -{ - sccb->h.response_code =3D cpu_to_be16(SCLP_RC_ADAPTER_TYPE_NOT_RECOGNI= ZED); -} - -void s390_pci_sclp_deconfigure(SCCB *sccb) -{ - sccb->h.response_code =3D cpu_to_be16(SCLP_RC_ADAPTER_TYPE_NOT_RECOGNI= ZED); -} - -/* 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_target(S390pciState *s, - const char *target) -{ - return NULL; -} diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 811fdf913dd6..3fb5c88af9cc 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -272,10 +272,6 @@ static void ccw_init(MachineState *machine) machine->initrd_filename, "s390-ccw.img", "s390-netboot.img", true); =20 - /* - * We cannot easily make the pci host bridge conditional as older QEMUs - * always created it. Doing so would break migration across QEMU versi= ons. - */ 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); diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c index 7c253ff308c5..249011fd62f5 100644 --- a/target/s390x/cpu_models.c +++ b/target/s390x/cpu_models.c @@ -1314,11 +1314,6 @@ static void register_types(void) =20 /* init all bitmaps from gnerated data initially */ s390_init_feat_bitmap(qemu_max_cpu_feat_init, qemu_max_cpu_feat); -#ifndef CONFIG_USER_ONLY - if (!pci_available) { - clear_bit(S390_FEAT_ZPCI, qemu_max_cpu_feat); - } -#endif for (i =3D 0; i < ARRAY_SIZE(s390_cpu_defs); i++) { s390_init_feat_bitmap(s390_cpu_defs[i].base_init, s390_cpu_defs[i].base_feat); diff --git a/target/s390x/gen-features.c b/target/s390x/gen-features.c index 70015eaaf5df..b0e9b271e228 100644 --- a/target/s390x/gen-features.c +++ b/target/s390x/gen-features.c @@ -598,7 +598,6 @@ static uint16_t qemu_MAX[] =3D { S390_FEAT_STFLE_53, /* generates a dependency warning, leave it out for now */ S390_FEAT_MSA_EXT_5, - /* only with CONFIG_PCI */ S390_FEAT_ZPCI, }; =20 diff --git a/target/s390x/kvm.c b/target/s390x/kvm.c index 9ff80c8461d0..15fdc168e1c5 100644 --- a/target/s390x/kvm.c +++ b/target/s390x/kvm.c @@ -2278,9 +2278,7 @@ void kvm_s390_get_host_cpu_model(S390CPUModel *model,= Error **errp) } =20 /* We emulate a zPCI bus and AEN, therefore we don't need HW support */ - if (pci_available) { - set_bit(S390_FEAT_ZPCI, model->features); - } + 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.17.2