From: Thomas Huth <thuth@redhat.com>
To: David Hildenbrand <david@redhat.com>,
Richard Henderson <richard.henderson@linaro.org>,
Nicholas Piggin <npiggin@gmail.com>,
qemu-s390x@nongnu.org
Cc: Halil Pasic <pasic@linux.ibm.com>,
Christian Borntraeger <borntraeger@linux.ibm.com>,
Peter Xu <peterx@redhat.com>, Fabiano Rosas <farosas@suse.de>,
Laurent Vivier <lvivier@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
qemu-devel@nongnu.org
Subject: Re: [RFC PATCH 1/3] hw/intc/s390_flic: Migrate pending state
Date: Mon, 27 May 2024 07:51:13 +0200 [thread overview]
Message-ID: <88f79ea3-8b83-45c2-bd15-cdf16ffeac9a@redhat.com> (raw)
In-Reply-To: <22e05fc7-6256-41b3-9f0d-f983f169b08c@redhat.com>
On 26/05/2024 22.33, David Hildenbrand wrote:
> Am 26.05.24 um 21:44 schrieb Richard Henderson:
>> On 5/26/24 08:53, David Hildenbrand wrote:
>>> Am 25.05.24 um 15:12 schrieb Nicholas Piggin:
>>>> The flic pending state is not migrated, so if the machine is migrated
>>>> while an interrupt is pending, it can be lost. This shows up in
>>>> qtest migration test, an extint is pending (due to console writes?)
>>>> and the CPU waits via s390_cpu_set_psw and expects the interrupt to
>>>> wake it. However when the flic pending state is lost, s390_cpu_has_int
>>>> returns false, so s390_cpu_exec_interrupt falls through to halting
>>>> again.
>>>>
>>>> Fix this by migrating pending. This prevents the qtest from hanging.
>>>> Does service_param need to be migrated? Or the IO lists?
>>>>
>>>> Signed-off-by: Nicholas Piggin <npiggin@gmail.com>
>>>> ---
>>>> hw/intc/s390_flic.c | 1 +
>>>> 1 file changed, 1 insertion(+)
>>>>
>>>> diff --git a/hw/intc/s390_flic.c b/hw/intc/s390_flic.c
>>>> index 6771645699..b70cf2295a 100644
>>>> --- a/hw/intc/s390_flic.c
>>>> +++ b/hw/intc/s390_flic.c
>>>> @@ -369,6 +369,7 @@ static const VMStateDescription
>>>> qemu_s390_flic_vmstate = {
>>>> .fields = (const VMStateField[]) {
>>>> VMSTATE_UINT8(simm, QEMUS390FLICState),
>>>> VMSTATE_UINT8(nimm, QEMUS390FLICState),
>>>> + VMSTATE_UINT32(pending, QEMUS390FLICState),
>>>> VMSTATE_END_OF_LIST()
>>>> }
>>>> };
>>>
>>> Likely you have to handle this using QEMU compat machines.
>>
>> Well, since existing migration is broken, I don't think you have to preserve
>
> Migration is broken only in some case "while an interrupt is pending, it can
> be lost".
>
>> compatibility. But you do have to bump the version number.
>
> Looking at it, this is TCG only, so likely we don't care that much about
> migration compatibility. But I have no idea what level of compatibility we
> want to support there.
Yes, this seems to only affect the TCG-only flic device, where migration has
never been working very reliably. So I think we don't really need the whole
compat-machine dance here. But I think we should at least bump the
version_id to 2 now and then use
VMSTATE_UINT32_V(pending, QEMUS390FLICState, 2);
for the new field. That way we would at least support forward migrations
without too much hassle.
Thomas
next prev parent reply other threads:[~2024-05-27 5:51 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-05-25 13:12 [RFC PATCH 0/3] Fix s390x flic migration and add some more qtests Nicholas Piggin
2024-05-25 13:12 ` [RFC PATCH 1/3] hw/intc/s390_flic: Migrate pending state Nicholas Piggin
2024-05-26 15:53 ` David Hildenbrand
2024-05-26 19:44 ` Richard Henderson
2024-05-26 20:33 ` David Hildenbrand
2024-05-27 5:51 ` Thomas Huth [this message]
2024-05-27 7:11 ` Nicholas Piggin
2024-05-25 13:12 ` [RFC PATCH 2/3] tests/qtest/migration-test: enable on s390x Nicholas Piggin
2024-05-27 5:46 ` Prasad Pandit
2024-05-27 7:04 ` Nicholas Piggin
2024-05-27 7:40 ` Prasad Pandit
2024-05-25 13:12 ` [RFC PATCH 3/3] tests/qtest/migration-test: Enable test_ignore_shared Nicholas Piggin
2024-05-27 12:42 ` Fabiano Rosas
2024-05-27 14:56 ` Peter Xu
2024-05-27 15:11 ` Fabiano Rosas
2024-05-27 15:41 ` Peter Xu
2024-05-27 7:13 ` [RFC PATCH 0/3] Fix s390x flic migration and add some more qtests Thomas Huth
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=88f79ea3-8b83-45c2-bd15-cdf16ffeac9a@redhat.com \
--to=thuth@redhat.com \
--cc=borntraeger@linux.ibm.com \
--cc=david@redhat.com \
--cc=farosas@suse.de \
--cc=lvivier@redhat.com \
--cc=npiggin@gmail.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=peterx@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=richard.henderson@linaro.org \
/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).