From patchwork Thu Feb 11 10:40:57 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Alex_Benn=C3=A9e?= X-Patchwork-Id: 581813 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [IPv6:2001:4830:134:3::11]) (using TLSv1 with cipher AES256-SHA (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id D5B7514030E for ; Thu, 11 Feb 2016 21:43:54 +1100 (AEDT) Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (1024-bit key; unprotected) header.d=linaro.org header.i=@linaro.org header.b=ifDLrjLg; dkim-atps=neutral Received: from localhost ([::1]:48535 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aToj2-0004mZ-W7 for incoming@patchwork.ozlabs.org; Thu, 11 Feb 2016 05:43:53 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:59217) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTogi-0000GN-Ox for qemu-devel@nongnu.org; Thu, 11 Feb 2016 05:41:29 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aTogh-0004p1-4F for qemu-devel@nongnu.org; Thu, 11 Feb 2016 05:41:28 -0500 Received: from mail-wm0-x236.google.com ([2a00:1450:400c:c09::236]:35353) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aTogg-0004ou-U6 for qemu-devel@nongnu.org; Thu, 11 Feb 2016 05:41:27 -0500 Received: by mail-wm0-x236.google.com with SMTP id c200so66677139wme.0 for ; Thu, 11 Feb 2016 02:41:26 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-type:content-transfer-encoding; bh=9lN3V+3KNaWUyLeDVHuiFws8TpfPefdHQI84/k5nKGo=; b=ifDLrjLg7dKYIQkbqUm8U72uwvXWqcbyT4daoHOz9tNoFN8ubRukT6YK8XqugzlN8c ccVGu65/Eou3tfg6C5UcUee9t+Mp7VdthtTA6XMSYIUIbww8HfY7g9yvWrNAAdFjOBO5 a+FPY5rY5vz3cisfCwj6T3ojSV4Jz2RwYtZHw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-type:content-transfer-encoding; bh=9lN3V+3KNaWUyLeDVHuiFws8TpfPefdHQI84/k5nKGo=; b=PGyKLJhylnR6b1IpGuYKQAdVGj+aa8cueJC9fYeQgQp8y6kunNzp/Tl69V4xhMIQ/H tujOAahYR4o002jk6JLAEIIeqx16aNO78LgncSn0oWlDbmlC7nGvNsQ2gUse8OrqzPY6 uKGO+69Kli2KXWXKAuNbjQBFmzSLW/ZV/QlevcQDRMwXws00LUP4WYlIwvsbq8uK2ZyA I2oNM2HAysq4E7IH+l5glWmAEC9FpHTMcJDgSqE2uM8ECJym5eKRf1m33EdsgCgarW3e heiqgpd0Vggx2JXZXUON/XXAko27xu3xdo8NVqC1Dd4SOWWqbPNWIuKCOiuWjvCbIfOp Pyow== X-Gm-Message-State: AG10YOT0aZSvJR4d6Ho6GRu4gvioYwhDaC+DbwJUIidbfAOosRgs4aNGgsRvmDUIAU6jUwrF X-Received: by 10.195.11.193 with SMTP id ek1mr23528292wjd.23.1455187286315; Thu, 11 Feb 2016 02:41:26 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id jc7sm6967886wjb.33.2016.02.11.02.41.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 11 Feb 2016 02:41:24 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id A50043E01E5; Thu, 11 Feb 2016 10:41:22 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Thu, 11 Feb 2016 10:40:57 +0000 Message-Id: <1455187265-26631-2-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.7.0 In-Reply-To: <1455187265-26631-1-git-send-email-alex.bennee@linaro.org> References: <1455187265-26631-1-git-send-email-alex.bennee@linaro.org> MIME-Version: 1.0 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2a00:1450:400c:c09::236 Cc: Peter Crosthwaite , dgilbert@redhat.com, crosthwaitepeter@gmail.com, pbonzini@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , aurelien@aurel32.net, rth@twiddle.net Subject: [Qemu-devel] [PATCH v6 1/9] tcg: pass down TranslationBlock to tcg_code_gen 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+incoming=patchwork.ozlabs.org@nongnu.org Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org My later debugging patches need access to the origin PC which is held in the TranslationBlock structure. Pass down the whole structure as it also holds the information about the code start point. Signed-off-by: Alex Bennée --- v1 - checkpatch fixes v5 - much simplified due to changes since last posting v6 - remove needless tweaking of gen_code_buf in tb_gen_code --- tcg/tcg.c | 6 +++--- tcg/tcg.h | 2 +- translate-all.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/tcg/tcg.c b/tcg/tcg.c index 0317c9e..b76d978 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2269,7 +2269,7 @@ void tcg_dump_op_count(FILE *f, fprintf_function cpu_fprintf) #endif -int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf) +int tcg_gen_code(TCGContext *s, TranslationBlock *tb) { int i, oi, oi_next, num_insns; @@ -2328,8 +2328,8 @@ int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf) tcg_reg_alloc_start(s); - s->code_buf = gen_code_buf; - s->code_ptr = gen_code_buf; + s->code_buf = tb->tc_ptr; + s->code_ptr = tb->tc_ptr; tcg_out_tb_init(s); diff --git a/tcg/tcg.h b/tcg/tcg.h index 83da5fb..10af870 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -626,7 +626,7 @@ void tcg_context_init(TCGContext *s); void tcg_prologue_init(TCGContext *s); void tcg_func_start(TCGContext *s); -int tcg_gen_code(TCGContext *s, tcg_insn_unit *gen_code_buf); +int tcg_gen_code(TCGContext *s, TranslationBlock *tb); void tcg_set_frame(TCGContext *s, TCGReg reg, intptr_t start, intptr_t size); diff --git a/translate-all.c b/translate-all.c index e9f409b..b3207fe 100644 --- a/translate-all.c +++ b/translate-all.c @@ -1120,7 +1120,7 @@ TranslationBlock *tb_gen_code(CPUState *cpu, the tcg optimization currently hidden inside tcg_gen_code. All that should be required is to flush the TBs, allocate a new TB, re-initialize it per above, and re-do the actual code generation. */ - gen_code_size = tcg_gen_code(&tcg_ctx, gen_code_buf); + gen_code_size = tcg_gen_code(&tcg_ctx, tb); if (unlikely(gen_code_size < 0)) { goto buffer_overflow; }