From nobody Sun Apr 28 16:26:27 2024 Delivered-To: importer@patchew.org Received-SPF: temperror (zoho.com: Error in retrieving data from DNS) 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=temperror (zoho.com: Error in retrieving data from DNS) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org Return-Path: Received: from lists.gnu.org (208.118.235.17 [208.118.235.17]) by mx.zohomail.com with SMTPS id 1506442978804395.58828632514303; Tue, 26 Sep 2017 09:22:58 -0700 (PDT) Received: from localhost ([::1]:49231 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwsdI-00019w-Q4 for importer@patchew.org; Tue, 26 Sep 2017 12:22:52 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:51537) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dwsbe-00005e-4x for qemu-devel@nongnu.org; Tue, 26 Sep 2017 12:21:11 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dwsbb-00089j-Q6 for qemu-devel@nongnu.org; Tue, 26 Sep 2017 12:21:10 -0400 Received: from mx1.redhat.com ([209.132.183.28]:39402) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1dwsbb-00086c-Bt for qemu-devel@nongnu.org; Tue, 26 Sep 2017 12:21:07 -0400 Received: from smtp.corp.redhat.com (int-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.12]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 1F359A78B; Tue, 26 Sep 2017 16:21:06 +0000 (UTC) Received: from localhost (dhcp-192-215.str.redhat.com [10.33.192.215]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 0A04377D42; Tue, 26 Sep 2017 16:21:02 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mx1.redhat.com 1F359A78B Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; dmarc=none (p=none dis=none) header.from=redhat.com Authentication-Results: ext-mx05.extmail.prod.ext.phx2.redhat.com; spf=fail smtp.mailfrom=cohuck@redhat.com From: Cornelia Huck To: qemu-devel@nongnu.org Date: Tue, 26 Sep 2017 18:20:58 +0200 Message-Id: <20170926162058.30772-2-cohuck@redhat.com> In-Reply-To: <20170926162058.30772-1-cohuck@redhat.com> References: <20170926162058.30772-1-cohuck@redhat.com> X-Scanned-By: MIMEDefang 2.79 on 10.5.11.12 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.29]); Tue, 26 Sep 2017 16:21: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 1/1] s390x: create a compat s390 phb for <=2.10 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: pasic@linux.vnet.ibm.com, zyimin@linux.vnet.ibm.com, david@redhat.com, Cornelia Huck , agraf@suse.de, dgilbert@redhat.com, borntraeger@de.ibm.com, jjherne@linux.vnet.ibm.com Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_6 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 creating the s390 phb dependant on the zpci facility. This broke migration from pre-cpu model machines which was fixed with 8ad9087c4a ("s390x/ccw: create s390 phb for compat reasons as well"). However, that is not enough: Migration from 2.10 with -cpu z13 breaks as well. Let's create a phb for all pre-2.11 compat machines to fix this. We leave the zpci facility off to avoid a guest-visible change with cpu models on. Reported-by: Christian Borntraeger Fixes: d32bd032d8 ("s390x/ccw: create s390 phb conditionally") Signed-off-by: Cornelia Huck Tested-by: Christian Borntraeger --- hw/s390x/s390-virtio-ccw.c | 8 +++++++- include/hw/s390x/s390-virtio-ccw.h | 1 + 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c index 1bcb7000ab..981f1c4336 100644 --- a/hw/s390x/s390-virtio-ccw.c +++ b/hw/s390x/s390-virtio-ccw.c @@ -247,6 +247,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; @@ -266,7 +268,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()->phb_compat) { DeviceState *dev =3D qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE); object_property_add_child(qdev_get_machine(), TYPE_S390_PCI_HOST_BRIDGE, @@ -407,6 +409,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->phb_compat =3D false; mc->init =3D ccw_init; mc->reset =3D s390_machine_reset; mc->hot_add_cpu =3D s390_hot_add_cpu; @@ -716,6 +719,9 @@ static void ccw_machine_2_10_instance_options(MachineSt= ate *machine) =20 static void ccw_machine_2_10_class_options(MachineClass *mc) { + S390CcwMachineClass *s390mc =3D S390_MACHINE_CLASS(mc); + + s390mc->phb_compat =3D pci_available; ccw_machine_2_11_class_options(mc); SET_MACHINE_COMPAT(mc, CCW_COMPAT_2_10); } diff --git a/include/hw/s390x/s390-virtio-ccw.h b/include/hw/s390x/s390-vir= tio-ccw.h index a9a90c2022..fb717afe92 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 phb_compat; } S390CcwMachineClass; =20 /* runtime-instrumentation allowed by the machine */ --=20 2.13.5