Received: from eggs.gnu.org ([2001:4830:134:3::10]:37785) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO6lD-00070V-Lv for qemu-devel@nongnu.org; Mon, 23 Sep 2013 10:05:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1VO6l7-00077z-Lw for qemu-devel@nongnu.org; Mon, 23 Sep 2013 10:05:11 -0400 Received: from mail-pa0-x232.google.com ([2607:f8b0:400e:c03::232]:64100) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1VO6l7-00075n-EV for qemu-devel@nongnu.org; Mon, 23 Sep 2013 10:05:05 -0400 Received: by mail-pa0-f50.google.com with SMTP id fb1so2325316pad.23 for ; Mon, 23 Sep 2013 07:05:04 -0700 (PDT) Sender: Richard Henderson From: Richard Henderson Date: Mon, 23 Sep 2013 07:04:42 -0700 Message-Id: <1379945085-29086-8-git-send-email-rth@twiddle.net> In-Reply-To: <1379945085-29086-1-git-send-email-rth@twiddle.net> References: <1379945085-29086-1-git-send-email-rth@twiddle.net> Subject: [Qemu-devel] [PATCH 07/10] target-s390: Fix STIDP List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: agraf@suse.de The implementation had been incomplete, as we did not store the machine type. Signed-off-by: Richard Henderson --- target-s390x/cpu.c | 2 ++ target-s390x/cpu.h | 14 +++++++++++++- target-s390x/translate.c | 2 +- 3 files changed, 16 insertions(+), 2 deletions(-) diff --git a/target-s390x/cpu.c b/target-s390x/cpu.c index 01ff49b..d003dcf 100644 --- a/target-s390x/cpu.c +++ b/target-s390x/cpu.c @@ -257,6 +257,8 @@ static void s390_cpu_initfn(Object *obj) env->facilities[0] |= FAC0_Z9_109; #endif + env->machine_type = 0x20940000; /* ??? Also Z9-109. */ + if (tcg_enabled() && !inited) { inited = true; s390x_translate_init(); diff --git a/target-s390x/cpu.h b/target-s390x/cpu.h index a0bafef..95f9cab 100644 --- a/target-s390x/cpu.h +++ b/target-s390x/cpu.h @@ -197,7 +197,19 @@ typedef struct CPUS390XState { /* reset does memset(0) up to here */ uint64_t facilities[2]; - int cpu_num; + union { + uint64_t cpuid; + struct { +#ifdef HOST_WORDS_BIGENDIAN + uint32_t cpu_num; + uint32_t machine_type; +#else + uint32_t machine_type; + uint32_t cpu_num; +#endif + }; + }; + uint8_t *storage_keys; uint64_t tod_offset; diff --git a/target-s390x/translate.c b/target-s390x/translate.c index 192d54e..25a6537 100644 --- a/target-s390x/translate.c +++ b/target-s390x/translate.c @@ -3242,7 +3242,7 @@ static ExitStatus op_stctl(DisasContext *s, DisasOps *o) static ExitStatus op_stidp(DisasContext *s, DisasOps *o) { check_privileged(s); - tcg_gen_ld32u_i64(o->out, cpu_env, offsetof(CPUS390XState, cpu_num)); + tcg_gen_ld_i64(o->out, cpu_env, offsetof(CPUS390XState, cpuid)); return NO_EXIT; } -- 1.8.1.4