From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:45804) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anrKA-0003i4-H6 for qemu-devel@nongnu.org; Wed, 06 Apr 2016 13:33:03 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1anrK6-0007lq-F5 for qemu-devel@nongnu.org; Wed, 06 Apr 2016 13:33:02 -0400 Received: from out5-smtp.messagingengine.com ([66.111.4.29]:60381) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anrK5-0007le-Q7 for qemu-devel@nongnu.org; Wed, 06 Apr 2016 13:32:58 -0400 Received: from compute4.internal (compute4.nyi.internal [10.202.2.44]) by mailout.nyi.internal (Postfix) with ESMTP id 6B4FF213F4 for ; Wed, 6 Apr 2016 13:32:56 -0400 (EDT) Date: Wed, 6 Apr 2016 13:32:55 -0400 From: "Emilio G. Cota" Message-ID: <20160406173255.GA27512@flamenco> References: <1459834253-8291-1-git-send-email-cota@braap.org> <1459834253-8291-8-git-send-email-cota@braap.org> <5703DCB7.50302@twiddle.net> <5703F3B4.6030108@twiddle.net> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Subject: Re: [Qemu-devel] [PATCH 07/10] tb hash: hash phys_pc, pc, and flags with xxhash List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Laurent Desnogues Cc: MTTCG Devel , Peter Maydell , Peter Crosthwaite , QEMU Developers , Paolo Bonzini , Sergey Fedorov , Alex =?iso-8859-1?Q?Benn=E9e?= , Richard Henderson On Wed, Apr 06, 2016 at 08:06:57 +0200, Laurent Desnogues wrote: > On Tue, Apr 5, 2016 at 7:19 PM, Richard Henderson wrote: > > On 04/05/2016 09:33 AM, Laurent Desnogues wrote: > >> The 'flags' field is 64-bit. You're thinking of cflags, I guess. > > > > Well that's silly. Since it's filled in via > > > > static inline void cpu_get_tb_cpu_state(CPUMIPSState *env, target_ulong *pc, > > target_ulong *cs_base, int *flags) > > > > and passed back in to generate code with > > > > TranslationBlock *tb_gen_code(CPUState *cpu, > > target_ulong pc, target_ulong cs_base, int flags, > > int cflags); > > > > So while TranslationBlock stores "uint64_t", the producer and consumer see "int". > > I agree. I guess TranslationBlock should be fixed to use uint32_t > (note several functions have to be changed from using int to uint32_t > or aarch64-softmmu will fail). Can you please elaborate on this? FWIW aarch64-softmmu boots OK for me with the patch below. I'm booting it as per the instructions in http://www.bennee.com/~alex/blog/2014/05/09/running-linux-in-qemus-aarch64-system-emulation-mode/ Thanks, Emilio commit e70474788fa37a85df21e1c63101a879103758f5 Author: Emilio G. Cota Date: Tue Apr 5 13:55:16 2016 -0400 tb: consistently use 'int' type for tb->flags Reported-by: Richard Henderson Signed-off-by: Emilio G. Cota diff --git a/cpu-exec.c b/cpu-exec.c index bbfcbfb..5abbf57 100644 --- a/cpu-exec.c +++ b/cpu-exec.c @@ -220,7 +220,7 @@ static void cpu_exec_nocache(CPUState *cpu, int max_cycles, static TranslationBlock *tb_find_physical(CPUState *cpu, target_ulong pc, target_ulong cs_base, - uint64_t flags) + int flags) { CPUArchState *env = (CPUArchState *)cpu->env_ptr; TranslationBlock *tb, **ptb1; @@ -271,7 +271,7 @@ static TranslationBlock *tb_find_physical(CPUState *cpu, static TranslationBlock *tb_find_slow(CPUState *cpu, target_ulong pc, target_ulong cs_base, - uint64_t flags) + int flags) { TranslationBlock *tb; diff --git a/include/exec/exec-all.h b/include/exec/exec-all.h index 7362095..277e6f1 100644 --- a/include/exec/exec-all.h +++ b/include/exec/exec-all.h @@ -235,7 +235,7 @@ static inline void tlb_flush_by_mmuidx(CPUState *cpu, ...) struct TranslationBlock { target_ulong pc; /* simulated PC corresponding to this block (EIP + CS base) */ target_ulong cs_base; /* CS base for this block */ - uint64_t flags; /* flags defining in which context the code was generated */ + int flags; /* flags defining in which context the code was generated */ uint16_t size; /* size of target code for this block (1 <= size <= TARGET_PAGE_SIZE) */ uint16_t icount; diff --git a/target-i386/translate.c b/target-i386/translate.c index 1a1214d..4024ad4 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -8178,7 +8178,7 @@ void gen_intermediate_code(CPUX86State *env, TranslationBlock *tb) CPUState *cs = CPU(cpu); DisasContext dc1, *dc = &dc1; target_ulong pc_ptr; - uint64_t flags; + int flags; target_ulong pc_start; target_ulong cs_base; int num_insns; diff --git a/translate-all.c b/translate-all.c index 8329ea6..27b4d57 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1593,7 +1593,7 @@ void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr) TranslationBlock *tb; uint32_t n, cflags; target_ulong pc, cs_base; - uint64_t flags; + int flags; tb = tb_find_pc(retaddr); if (!tb) {