qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Qemu-devel] [PATCH v2] target/s390x: Fix broken user mode


From: David Hildenbrand
Subject: Re: [Qemu-devel] [PATCH v2] target/s390x: Fix broken user mode
Date: Mon, 30 Jan 2017 15:10:01 +0100
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.6.0

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 <address@hidden>
> ---
> 
> 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.

we have the "qemu" model for that (or simply drop the -cpu parameter
completely). Eduardo currently proposed "max" as an alternative for x86.
There is also no "any" model on x86.

> 
> 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;
>  }
>  
> 

Okay, the main problem is that get_max_cpu_model() doesn't return an
error in this case, therefor s390_realize_cpu_model() doesn't fail
correctly.

But it seems like cpu models also make sense for user mode (as you
recognized, we tried to not touch it but failed). However, for now, just
as for ordinary tcg, only "qemu"/z900 is supported, until proper support
for tcg is implemented.

Then, also the CONFIG_USER_ONLY in apply_cpu_model() has to go.

So this makes sense to me and should fix the current problem.

-- 

David



reply via email to

[Prev in Thread] Current Thread [Next in Thread]