From patchwork Wed Apr 6 17:32:55 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Emilio Cota X-Patchwork-Id: 8764051 Return-Path: X-Original-To: patchwork-qemu-devel@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 5D90CC0553 for ; Wed, 6 Apr 2016 17:33:13 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 21BEC20115 for ; Wed, 6 Apr 2016 17:33:12 +0000 (UTC) Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id C3A8620107 for ; Wed, 6 Apr 2016 17:33:10 +0000 (UTC) Received: from localhost ([::1]:44668 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1anrKH-0003iO-Ry for patchwork-qemu-devel@patchwork.kernel.org; Wed, 06 Apr 2016 13:33:09 -0400 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) Received: from frontend2 ([10.202.2.161]) by compute4.internal (MEProxy); Wed, 06 Apr 2016 13:32:56 -0400 DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d=braap.org; h=cc :content-type:date:from:in-reply-to:message-id:mime-version :references:subject:to:x-sasl-enc:x-sasl-enc; s=mesmtp; bh=KQxg2 Zyp7kmaa/l3tYhD4BDXefQ=; b=JOsV9UGoiuepQ3cAeQ9mOcjhebabf2wVlfLfI QVzgyUJfCMIYkCVRQueY0pvTWd+b33SnDKcHjgiPeuZg1NjehbqyGaDweLbHL9Lk BSZ5BOI+afKrN+kDU3yQ7qthmdZ8p9qayutwUfr4yndk8cky8v8zSVEhCnXU6dEj Mj5yho= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-sasl-enc :x-sasl-enc; s=smtpout; bh=KQxg2Zyp7kmaa/l3tYhD4BDXefQ=; b=bAmhv Rs/slKVCU2SlNDgBX1CYF2cbsKE/sI2oM2LRdvAVdyTuJdbgwPfcZSixRhMxn9ZD edQO0Ci7GyMmOFxagmlmu/E318zTFTBBcWYjkMb0y/v8IaUsRBeM0DjU3gqUEc7y mszafAE9b4udO2++XUgHg9h+sY5wGNqH1HB8dY= X-Sasl-enc: VeZs7RdkZ7wLYzgdtWrY6FLoyej6uuG2QG5YBU/0UhcS 1459963976 Received: from localhost (flamenco.cs.columbia.edu [128.59.20.216]) by mail.messagingengine.com (Postfix) with ESMTPA id 23292680224; Wed, 6 Apr 2016 13:32:56 -0400 (EDT) Date: Wed, 6 Apr 2016 13:32:55 -0400 From: "Emilio G. Cota" To: Laurent Desnogues 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-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 66.111.4.29 Cc: MTTCG Devel , Peter Maydell , Peter Crosthwaite , QEMU Developers , Paolo Bonzini , Sergey Fedorov , Alex =?iso-8859-1?Q?Benn=E9e?= , Richard Henderson Subject: Re: [Qemu-devel] [PATCH 07/10] tb hash: hash phys_pc, pc, and flags with xxhash X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org Sender: qemu-devel-bounces+patchwork-qemu-devel=patchwork.kernel.org@nongnu.org X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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) {