From: Cornelia Huck <cohuck@redhat.com>
To: qemu-devel@nongnu.org
Cc: borntraeger@de.ibm.com, agraf@suse.de, david@redhat.com,
zyimin@linux.vnet.ibm.com, pasic@linux.vnet.ibm.com,
jjherne@linux.vnet.ibm.com, dgilbert@redhat.com,
Cornelia Huck <cohuck@redhat.com>
Subject: [Qemu-devel] [PATCH 1/1] s390x: create a compat s390 phb for <=2.10
Date: Tue, 26 Sep 2017 18:20:58 +0200 [thread overview]
Message-ID: <20170926162058.30772-2-cohuck@redhat.com> (raw)
In-Reply-To: <20170926162058.30772-1-cohuck@redhat.com>
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 <borntraeger@de.ibm.com>
Fixes: d32bd032d8 ("s390x/ccw: create s390 phb conditionally")
Signed-off-by: Cornelia Huck <cohuck@redhat.com>
---
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)
}
}
+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);
- if (s390_has_feat(S390_FEAT_ZPCI)) {
+ if (s390_has_feat(S390_FEAT_ZPCI) || get_machine_class()->phb_compat) {
DeviceState *dev = 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, void *data)
s390mc->cpu_model_allowed = true;
s390mc->css_migration_enabled = true;
s390mc->gs_allowed = true;
+ s390mc->phb_compat = false;
mc->init = ccw_init;
mc->reset = s390_machine_reset;
mc->hot_add_cpu = s390_hot_add_cpu;
@@ -716,6 +719,9 @@ static void ccw_machine_2_10_instance_options(MachineState *machine)
static void ccw_machine_2_10_class_options(MachineClass *mc)
{
+ S390CcwMachineClass *s390mc = S390_MACHINE_CLASS(mc);
+
+ s390mc->phb_compat = 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-virtio-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;
/* runtime-instrumentation allowed by the machine */
--
2.13.5
next prev parent reply other threads:[~2017-09-26 16:21 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2017-09-26 16:20 [Qemu-devel] [PATCH 0/1] s390x: more zpci compat fun Cornelia Huck
2017-09-26 16:20 ` Cornelia Huck [this message]
2017-09-26 17:07 ` [Qemu-devel] [PATCH 1/1] s390x: create a compat s390 phb for <=2.10 Christian Borntraeger
2017-09-26 18:40 ` David Hildenbrand
2017-09-27 9:47 ` Cornelia Huck
2017-09-27 10:25 ` Yi Min Zhao
2017-09-27 10:56 ` Cornelia Huck
2017-09-27 10:59 ` Christian Borntraeger
2017-09-27 12:21 ` David Hildenbrand
2017-09-27 12:26 ` Christian Borntraeger
2017-09-27 14:28 ` Dr. David Alan Gilbert
2017-09-27 14:46 ` Cornelia Huck
2017-09-27 14:49 ` Dr. David Alan Gilbert
2017-09-27 15:03 ` Cornelia Huck
2017-09-28 10:34 ` Christian Borntraeger
2017-09-28 10:41 ` Christian Borntraeger
2017-09-28 12:07 ` Cornelia Huck
2017-09-28 12:17 ` Christian Borntraeger
2017-09-28 12:27 ` Cornelia Huck
2017-09-28 12:33 ` David Hildenbrand
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20170926162058.30772-2-cohuck@redhat.com \
--to=cohuck@redhat.com \
--cc=agraf@suse.de \
--cc=borntraeger@de.ibm.com \
--cc=david@redhat.com \
--cc=dgilbert@redhat.com \
--cc=jjherne@linux.vnet.ibm.com \
--cc=pasic@linux.vnet.ibm.com \
--cc=qemu-devel@nongnu.org \
--cc=zyimin@linux.vnet.ibm.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).