qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Christian Borntraeger <borntraeger@de.ibm.com>
To: David Hildenbrand <david@redhat.com>, Cornelia Huck <cohuck@redhat.com>
Cc: Richard Henderson <rth@twiddle.net>,
	Alexander Graf <agraf@suse.de>,
	Yi Min Zhao <zyimin@linux.vnet.ibm.com>,
	Halil Pasic <pasic@linux.vnet.ibm.com>,
	qemu-devel <qemu-devel@nongnu.org>,
	"Jason J . Herne" <jjherne@linux.vnet.ibm.com>,
	"Dr. David Alan Gilbert" <dgilbert@redhat.com>
Subject: Re: [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat machines
Date: Tue, 26 Sep 2017 15:45:36 +0200	[thread overview]
Message-ID: <932ad4e2-a10c-77fc-fcb7-5dbbed0d2c7c@de.ibm.com> (raw)
In-Reply-To: <cb323145-86e9-04b9-cb61-90bfabcf2c3a@de.ibm.com>



On 09/26/2017 03:32 PM, Christian Borntraeger wrote:
> 
> 
> On 09/26/2017 03:00 PM, David Hildenbrand wrote:
> 
>>
>> Wonder when we can finally let go of these hacks. The host cpu model is
>> not migration safe, therefore such things are expected to not work. Just
>> think about trying to migrate from a kernel without AIS support to a
>> kernel with AIS support. It is broken.
>>
>> AIS is just one feature that actually tells you that you are currently
>> doing something evil. Other CPU features you lose on the way simply
>> don't result in an error, but still migration could break silently
>> afterwards, when the guest assumes it has certain CPU features.
>>
>>
>> The main problem is that we have machines <= 2.7 that had no CPU model
>> support. For these machines, migration should work just fine, as
>> 	s390_has_feat(S390_FEAT_ADAPTER_INT_SUPPRESSION)
>> will always return false.
>> However, the guest will be presented the AIS bit, as soon as the
>> capability is enabled (as we then don't manually set the stfle bitmap
>> from QEMU), which is bad.
>>
>> So my point would be: don't turn on these new facilities if the cpu
>> model is not allowed (<=2.7), but don't add ais_allowed() compat
>> handling for any newer machines. If they use the host model, they have
>> to assume that migration can break.
>>
>> I think using cpu_model_allowed() would be just fine to be used instead
>> of ais_allowed().
> 
> Let me thing about that. I will send 2 (with fs->ais_supported gone) and 3
> and we can then decide if we only want to apply 2 or both.
> 
> Now: regarding your -cpu host comment:
> 
> I checked all the migration stuff now with -cpu z13 and it seems that
> migration is now broken for qemu 2.10->qemu 2.11 when using the s390-ccw-virtio-2.9
> machine due to the PCI fencing from Conny.
> 
> qemu-system-s390x: Unknown savevm section or instance 'PCIBUS' 0
> qemu-system-s390x: load of migration failed: Invalid argument
> 

A very dirty hack like this seems to do the trick

diff --git a/hw/s390x/s390-virtio-ccw.c b/hw/s390x/s390-virtio-ccw.c
index 41b770a..3d49044 100644
--- a/hw/s390x/s390-virtio-ccw.c
+++ b/hw/s390x/s390-virtio-ccw.c
@@ -294,7 +294,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) || !ais_allowed()) {
         DeviceState *dev = qdev_create(NULL, TYPE_S390_PCI_HOST_BRIDGE);
         object_property_add_child(qdev_get_machine(),
                                   TYPE_S390_PCI_HOST_BRIDGE,

Basic idea is that for compat_machines <= 2.10 we enable the PCI host bridge
(and I abused ais_allowed to check for <= 2.10). 
Not sure what to do for for CONFIG_PCI = off case, but the normal case is
broken right now.

  parent reply	other threads:[~2017-09-26 13:47 UTC|newest]

Thread overview: 30+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-22  8:38 [Qemu-devel] [PATCH/RFC 0/3] ais fixups for 2.11 Christian Borntraeger
2017-09-22  8:38 ` [Qemu-devel] [PATCH/RFC 1/3] s390x/ais: disable ais facility as it is broken Christian Borntraeger
2017-09-26 12:01   ` David Hildenbrand
2017-09-22  8:38 ` [Qemu-devel] [PATCH/RFC 2/3] s390x/ais: enable ais when migration is available Christian Borntraeger
2017-09-22 12:13   ` Pierre Morel
2017-09-22 12:40     ` Christian Borntraeger
2017-09-22 13:49       ` Cornelia Huck
2017-09-22 14:02       ` Pierre Morel
2017-09-22 14:07         ` Christian Borntraeger
2017-09-22 14:27           ` Halil Pasic
2017-09-25 10:07             ` Cornelia Huck
2017-09-25 10:12               ` Christian Borntraeger
2017-09-25 11:45                 ` Cornelia Huck
2017-09-25 11:47                   ` Christian Borntraeger
2017-09-26  9:14                     ` Yi Min Zhao
2017-09-26 13:04                       ` Boris Fiuczynski
2017-09-22 14:38           ` Pierre Morel
2017-09-26 12:23   ` David Hildenbrand
2017-09-26 12:29     ` Christian Borntraeger
2017-09-26 12:33       ` David Hildenbrand
2017-09-26 12:33       ` Christian Borntraeger
2017-09-22  8:38 ` [Qemu-devel] [PATCH/RFC 3/3] s390x/ais: disable ais for compat machines Christian Borntraeger
2017-09-26 12:26   ` David Hildenbrand
2017-09-26 12:45     ` Christian Borntraeger
2017-09-26 13:00       ` David Hildenbrand
2017-09-26 13:32         ` Christian Borntraeger
2017-09-26 13:43           ` Cornelia Huck
2017-09-26 13:45           ` Christian Borntraeger [this message]
2017-09-22 11:27 ` [Qemu-devel] [PATCH/RFC 0/3] ais fixups for 2.11 Christian Borntraeger
2017-09-22 13:08   ` Christian Borntraeger

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=932ad4e2-a10c-77fc-fcb7-5dbbed0d2c7c@de.ibm.com \
    --to=borntraeger@de.ibm.com \
    --cc=agraf@suse.de \
    --cc=cohuck@redhat.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=rth@twiddle.net \
    --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).