From: David Hildenbrand <david@redhat.com>
To: Collin Walling <walling@linux.ibm.com>,
Cornelia Huck <cohuck@redhat.com>,
Christian Borntraeger <borntraeger@de.ibm.com>
Cc: mst@redhat.com, qemu-devel@nongnu.org, pasic@linux.ibm.com,
qemu-s390x@nongnu.org, pbonzini@redhat.com, rth@twiddle.net
Subject: Re: [Qemu-devel] [qemu-s390x] [PATCH v5 2/2] s390: diagnose 318 info reset and migration support
Date: Wed, 26 Jun 2019 16:30:21 +0200 [thread overview]
Message-ID: <96450f1c-650e-828c-a833-9f7881ae8f87@redhat.com> (raw)
In-Reply-To: <a33d2dea-a053-c102-38cf-fb639b01fc5a@linux.ibm.com>
On 26.06.19 16:22, Collin Walling wrote:
> On 6/26/19 8:14 AM, Cornelia Huck wrote:
>> On Wed, 26 Jun 2019 11:12:04 +0200
>> Christian Borntraeger <borntraeger@de.ibm.com> wrote:
>>
>>> On 25.06.19 17:17, Collin Walling wrote:
>>>> index a606547..4c26754 100644
>>>> --- a/target/s390x/cpu.h
>>>> +++ b/target/s390x/cpu.h
>>>> @@ -39,7 +39,13 @@
>>>>
>>>> #define MMU_USER_IDX 0
>>>>
>>>> -#define S390_MAX_CPUS 248
>>>> +/*
>>>> + * HACK: The introduction of additional facility bytes in the Read Info
>>>> + * struct consumes space used for CPU entries, thus we must reduce the
>>>> + * original maximum CPUs of 248 by one for each new byte or risk smashing
>>>> + * the stack.
>>>> + */
>>>> +#define S390_MAX_CPUS 247
>>>
>>> I think we decided to not change that. Only if the cpu model contains the diag318
>>> feature we are limited to 247 but only for the sclp response.
>>> So we said:
>>> - we continue to allow 248 cpus
>>> - the sclp response will be limited to 247 CPUs if the feature is one
>>> - (optional) we print a warning that the guest might not see all CPUs
>>>
>>
>> Yes, that's what I remember as well... and printing/logging a warning
>> is a good idea.
>>
>
> I recall this conversation, but I encountered a bit of a hangup when
> running some tests with the new changes.
>
> Since we're adding a new field in the ReadInfo struct, we're permanently
> intruding on the space used for CPU entries. A machine with these
> changes and 248 CPUs resulted in stack smash when the guest would start
> up. This happened with diag318 on *and* off. This is a limitation to the
> 4k SCCB size right now :/
I think we discussed to only indicate 247 CPUs, which should solve the
issue?
>
> Prior to these patches, I was restricting the max_cpus depending on the
> compat version. I failed to do some tests with earlier versions to catch
> this error (there are a lot of moving parts... sorry).
>
> I do not think the new byte and the full 248 CPU count can co-exist. We
> might be able to union byte 134 and some extra space with the first CPU
> entry... but that could get messy.
>
>
--
Thanks,
David / dhildenb
next prev parent reply other threads:[~2019-06-26 14:32 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-06-25 15:17 [Qemu-devel] [PATCH v5 0/2] Guest Support for DIAGNOSE 0x318 Collin Walling
2019-06-25 15:17 ` [Qemu-devel] [PATCH v5 1/2] s390/kvm: header sync for diag318 Collin Walling
2019-06-26 9:43 ` David Hildenbrand
2019-06-25 15:17 ` [Qemu-devel] [PATCH v5 2/2] s390: diagnose 318 info reset and migration support Collin Walling
2019-06-26 9:12 ` Christian Borntraeger
2019-06-26 12:14 ` Cornelia Huck
2019-06-26 14:22 ` [Qemu-devel] [qemu-s390x] " Collin Walling
2019-06-26 14:30 ` David Hildenbrand [this message]
2019-06-27 10:29 ` Christian Borntraeger
2019-06-26 12:33 ` [Qemu-devel] " Cornelia Huck
2019-06-26 14:07 ` Collin Walling
2019-07-02 11:05 ` Cornelia Huck
2019-06-25 16:34 ` [Qemu-devel] [PATCH v5 0/2] Guest Support for DIAGNOSE 0x318 no-reply
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=96450f1c-650e-828c-a833-9f7881ae8f87@redhat.com \
--to=david@redhat.com \
--cc=borntraeger@de.ibm.com \
--cc=cohuck@redhat.com \
--cc=mst@redhat.com \
--cc=pasic@linux.ibm.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=qemu-s390x@nongnu.org \
--cc=rth@twiddle.net \
--cc=walling@linux.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).