From nobody Thu May 2 21:45:33 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 1505470815694773.1404515579366; Fri, 15 Sep 2017 03:20:15 -0700 (PDT) Received: from localhost ([::1]:52379 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsnjK-00039H-Uz for importer@patchew.org; Fri, 15 Sep 2017 06:20:14 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:38524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dsndc-0006LE-ML for qemu-devel@nongnu.org; Fri, 15 Sep 2017 06:14:25 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dsndb-0008Tx-Mv for qemu-devel@nongnu.org; Fri, 15 Sep 2017 06:14:20 -0400 Received: from mx1.redhat.com ([209.132.183.28]:42276) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dsndb-0008T7-Es for qemu-devel@nongnu.org; Fri, 15 Sep 2017 06:14:19 -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 82DAE821C1; Fri, 15 Sep 2017 10:14:18 +0000 (UTC) Received: from localhost (ovpn-117-60.ams2.redhat.com [10.36.117.60]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 676DF6375D; Fri, 15 Sep 2017 10:14:15 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 82DAE821C1 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=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Fri, 15 Sep 2017 12:14:06 +0200 Message-Id: <20170915101406.27823-2-cohuck@redhat.com> In-Reply-To: <20170915101406.27823-1-cohuck@redhat.com> References: <20170915101406.27823-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]); Fri, 15 Sep 2017 10:14:18 +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 1/1] s390x/ccw: create s390 phb for compat reasons as well 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, pasic@linux.vnet.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" d32bd032d8 ("s390x/ccw: create s390 phb conditionally") made registering the s390 pci host bridge conditional on presense of the zpci facility bit. Sadly, that breaks migration from some old machines. Create the s390 phb if we need it for compat reasons, even if we don't provide the zpci facility. Fixes: d32bd032d8 ("s390x/ccw: create s390 phb conditionally") Signed-off-by: Cornelia Huck --- hw/s390x/s390-virtio-ccw.c | 6 +++++- include/hw/s390x/s390-virtio-ccw.h | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 0471407187..7e3148eb4a 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -269,6 +269,8 @@ static void s390_create_virtio_net(BusState *bus, const= char *name) } } =20 +static S390CcwMachineClass *get_machine_class(void); + static void ccw_init(MachineState *machine) { int ret; @@ -288,7 +290,7 @@ static void ccw_init(MachineState *machine) machine->initrd_filename, "s390-ccw.img", "s390-netboot.img", true); =20 - if (s390_has_feat(S390_FEAT_ZPCI)) { + if (s390_has_feat(S390_FEAT_ZPCI) || get_machine_class()->pci_compat) { DeviceState *dev =3D qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE); object_property_add_child(qdev_get_machine(), TYPE_S390_PCI_HOST_BRIDGE, @@ -429,6 +431,7 @@ static void ccw_machine_class_init(ObjectClass *oc, voi= d *data) s390mc->cpu_model_allowed =3D true; s390mc->css_migration_enabled =3D true; s390mc->gs_allowed =3D true; + s390mc->pci_compat =3D false; mc->init =3D ccw_init; mc->reset =3D s390_machine_reset; mc->hot_add_cpu =3D s390_hot_add_cpu; @@ -784,6 +787,7 @@ static void ccw_machine_2_7_class_options(MachineClass = *mc) S390CcwMachineClass *s390mc =3D S390_MACHINE_CLASS(mc); =20 s390mc->cpu_model_allowed =3D false; + s390mc->pci_compat =3D pci_available; ccw_machine_2_8_class_options(mc); SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_7); } diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index a9a90c2022..9978c89e90 100644 --- a/include/hw/s390x/s390-virtio-ccw.h +++ b/include/hw/s390x/s390-virtio-ccw.h @@ -41,6 +41,7 @@ typedef struct S390CcwMachineClass { bool cpu_model_allowed; bool css_migration_enabled; bool gs_allowed; + bool pci_compat; } S390CcwMachineClass; =20 /* runtime-instrumentation allowed by the machine */ --=20 2.13.5