qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Hildenbrand <david@redhat.com>
To: "Philippe Mathieu-Daudé" <f4bug@amsat.org>,
	"Stefan Weil" <sw@weilnetz.de>,
	"Richard Henderson" <rth@twiddle.net>,
	"Alexander Graf" <agraf@suse.de>
Cc: Christian Borntraeger <borntraeger@de.ibm.com>,
	qemu-devel@nongnu.org, Bruce Rogers <brogers@suse.com>,
	David Hildenbrand <dahi@linux.vnet.ibm.com>,
	Cornelia Huck <cornelia.huck@de.ibm.com>,
	Aurelien Jarno <aurelien@aurel32.net>,
	Peter Maydell <peter.maydell@linaro.org>
Subject: Re: [Qemu-devel] [PATCH v2] target/s390x: Fix broken user mode
Date: Thu, 16 Mar 2017 15:48:32 +0100	[thread overview]
Message-ID: <60e58838-d550-4e60-7b85-7079eb2c72b3@redhat.com> (raw)
In-Reply-To: <4e1a0f31-c9a8-f504-11a0-191158390e3d@amsat.org>

On 16.03.2017 15:46, Philippe Mathieu-Daudé wrote:
> Hi Stefan, Richard.
> 
> On 03/16/2017 10:28 AM, David Hildenbrand wrote:
>> On 02.03.2017 20:56, David Hildenbrand wrote:
>>> Am 30.01.2017 um 14:15 schrieb Stefan Weil:
>>>> Returning NULL from get_max_cpu_model results in a SIGSEGV runtime error.
>>>>
>>>> Signed-off-by: Stefan Weil <sw@weilnetz.de>
>>>> ---
>>>>
>>>> v2: Re-sent as v1 was damaged by my mailer.
>>>>
>>>> This is also broken in Debian.
>>>>
>>>> In addition, there is no default CPU ("any"), so binfmt and related
>>>> actions currently don't work. I hacked my local installation by
>>>> duplicating the "qemu" cpu definition for "any", but maybe there is
>>>> a better solution.
>>>
>>> That should then already work.
>>>
>>>>
>>>> Regards
>>>> Stefan
>>>>
>>>>  target/s390x/cpu_models.c | 2 --
>>>>  1 file changed, 2 deletions(-)
>>>>
>>>> diff --git a/target/s390x/cpu_models.c b/target/s390x/cpu_models.c
>>>> index 2a894ee..6e34763 100644
>>>> --- a/target/s390x/cpu_models.c
>>>> +++ b/target/s390x/cpu_models.c
>>>> @@ -660,7 +660,6 @@ static void check_compatibility(const S390CPUModel *max_model,
>>>>
>>>>  static S390CPUModel *get_max_cpu_model(Error **errp)
>>>>  {
>>>> -#ifndef CONFIG_USER_ONLY
>>>>      static S390CPUModel max_model;
>>>>      static bool cached;
>>>>
>>>> @@ -680,7 +679,6 @@ static S390CPUModel *get_max_cpu_model(Error **errp)
>>>>          cached = true;
>>>>          return &max_model;
>>>>      }
>>>> -#endif
>>>>      return NULL;
>>>>  }
>>>>
>>>>
>>>
>>> I thought this was already picked up for stable...
>>> But looks like only the "any" model fixup got.
>>>
>>> So
>>>
>>> Acked-by: David Hildenbrand <david@redhat.com>
>>>
>>
>> Ping, can somebody please pick this up?
> 
> I see at least two possible changes:
> 
> the nasty one to catch bug:
> 
> @@ -681,7 +681,7 @@ static S390CPUModel *get_max_cpu_model(Error **errp)
>           return &max_model;
>       }
>   #endif
> -    return NULL;
> +    abort();
>   }
> 
> and the nicer one to avoid SIGSEGV:
> 
> @@ -734,8 +734,10 @@ void s390_realize_cpu_model(CPUState *cs, Error **errp)
>       }
> 
>       max_model = get_max_cpu_model(errp);
> -    if (*errp) {
> -        error_prepend(errp, "CPU models are not available: ");
> +    if (max_model == NULL) {
> +        if (*errp) {
> +            error_prepend(errp, "CPU models are not available: ");
> +        } else {
> +            error_setg(errp, "CPU models are not available");
> +        }
>           return;
>       }
> 

As already discussed, user mode should behave just like tcg. No special
handling. So the original patch here is just fine in my opinion.

-- 

Thanks,

David

  reply	other threads:[~2017-03-16 14:48 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-30 13:15 [Qemu-devel] [PATCH v2] target/s390x: Fix broken user mode Stefan Weil
2017-01-30 14:10 ` David Hildenbrand
2017-01-30 14:44   ` Peter Maydell
2017-01-30 14:42 ` David Hildenbrand
2017-03-02 19:56 ` David Hildenbrand
2017-03-16 13:28   ` David Hildenbrand
2017-03-16 14:46     ` Philippe Mathieu-Daudé
2017-03-16 14:48       ` David Hildenbrand [this message]
2017-03-22  9:07 ` Christian Borntraeger
2017-03-22  9:09   ` David Hildenbrand
2017-03-22  9:09 ` 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=60e58838-d550-4e60-7b85-7079eb2c72b3@redhat.com \
    --to=david@redhat.com \
    --cc=agraf@suse.de \
    --cc=aurelien@aurel32.net \
    --cc=borntraeger@de.ibm.com \
    --cc=brogers@suse.com \
    --cc=cornelia.huck@de.ibm.com \
    --cc=dahi@linux.vnet.ibm.com \
    --cc=f4bug@amsat.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@nongnu.org \
    --cc=rth@twiddle.net \
    --cc=sw@weilnetz.de \
    /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).