diff mbox

[v2] target/s390x: Fix broken user mode

Message ID 37b4af98-1658-8dff-0d1f-554d8d1c64d9@redhat.com
State New
Headers show

Commit Message

David Hildenbrand Jan. 30, 2017, 2:42 p.m. UTC
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.
> 

Just tested your patch:

Reviewed-by: David Hildenbrand <david@redhat.com>

> 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.
> 

This should do the trick, will send it as an official patch:

From e7109d1c235e463c12feeaf5d3f1d6763f34be85 Mon Sep 17 00:00:00 2001
From: David Hildenbrand <david@redhat.com>
Date: Mon, 30 Jan 2017 15:33:05 +0100
Subject: [PATCH] target/s390x: "qemu" is the name od the default model

"any" does not exist, therefore resulting in a misleading error message.

Reported-by: Stefan Weil <sw@weilnetz.de>
Signed-off-by: David Hildenbrand <david@redhat.com>
---
 linux-user/main.c | 2 ++
 1 file changed, 2 insertions(+)
diff mbox

Patch

diff --git a/linux-user/main.c b/linux-user/main.c
index 3004958..e588f58 100644
--- a/linux-user/main.c
+++ b/linux-user/main.c
@@ -4322,6 +4322,8 @@  int main(int argc, char **argv, char **envp)
 # endif
 #elif defined TARGET_SH4
         cpu_model = TYPE_SH7785_CPU;
+#elif defined TARGET_S390X
+        cpu_model = "qemu";
 #else
         cpu_model = "any";
 #endif