From patchwork Fri Mar 4 11:17:59 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: 63576 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp13633lbc; Fri, 4 Mar 2016 03:19:06 -0800 (PST) X-Received: by 10.140.180.207 with SMTP id b198mr9382310qha.41.1457090346549; Fri, 04 Mar 2016 03:19:06 -0800 (PST) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id c68si3212470qge.29.2016.03.04.03.19.06 for (version=TLS1 cipher=AES128-SHA bits=128/128); Fri, 04 Mar 2016 03:19:06 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) client-ip=2001:4830:134:3::11; Authentication-Results: mx.google.com; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 2001:4830:134:3::11 as permitted sender) smtp.mailfrom=qemu-devel-bounces+patch=linaro.org@nongnu.org; dkim=fail header.i=@linaro.org Received: from localhost ([::1]:40341 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abnlB-0006ff-Ri for patch@linaro.org; Fri, 04 Mar 2016 06:19:05 -0500 Received: from eggs.gnu.org ([2001:4830:134:3::10]:35189) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abnkR-00060D-1e for qemu-devel@nongnu.org; Fri, 04 Mar 2016 06:18:19 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1abnkO-0003qL-M5 for qemu-devel@nongnu.org; Fri, 04 Mar 2016 06:18:18 -0500 Received: from mail-wm0-x230.google.com ([2a00:1450:400c:c09::230]:35342) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1abnkO-0003qE-GA for qemu-devel@nongnu.org; Fri, 04 Mar 2016 06:18:16 -0500 Received: by mail-wm0-x230.google.com with SMTP id l68so30068091wml.0 for ; Fri, 04 Mar 2016 03:18:16 -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-transfer-encoding; bh=wn4kcgypuudLN1ycGcbB/VJFaOLMfBGD4SmklaTPhzA=; b=c3sN4D5O3KxEpSHepHqVrw78s16gbQ04I7OZif+2fCkvdzu5phBtOud2pkKLHXBKHM wed5/jhpFTO6rRYXkAqRl7q2bK+6IeOgg2AVyft1v9MNdPVC4nbyuvLGLy5wVUI5KxQc uH6eNOzoJUc1iizMU2PrjPII1LmNXm/9sahUQ= 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-transfer-encoding; bh=wn4kcgypuudLN1ycGcbB/VJFaOLMfBGD4SmklaTPhzA=; b=auDAT5k6eqxDgKyO1rCP4SpWua6E4ra+jlZFFehWbsARLNoIbH2UX8XY2R03x2fuFp ln+EQKjOWkpfrD5yEUW3RbRVgP5+uPZfUdtvEV/XuW5wdzecGsxhHFEnP4brQSzu48lY CL12RYe3BkdRYAZ0uki6/Gjn/O4b3tGWbss8EO//A8rC6waQ74nAs1vj3geNRBhb1yMc QbwELwIG9qzVkZBB+gzCRh97/cJaMSAmAYtbX3fM9tuhkN9mV7BkpDfTJw1ZLlxOq3i7 +UAH7sD4VM68WBE+3uH+U5pDE3BAHvJIxmLMZqbrrJ1NB5dd+DoCAxv1/zGq5zjvbkMR aQCw== X-Gm-Message-State: AD7BkJL1f1Q/Ayyz6kiQ/l6lc4XM6+EKn61mgM8Wz1+wQy27w7rAO0pYvr7uLlsOClQDq9qu X-Received: by 10.194.248.200 with SMTP id yo8mr8515829wjc.38.1457090295964; Fri, 04 Mar 2016 03:18:15 -0800 (PST) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id ka4sm2818239wjc.47.2016.03.04.03.18.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 04 Mar 2016 03:18:14 -0800 (PST) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 460CE3E01EB; Fri, 4 Mar 2016 11:18:13 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Fri, 4 Mar 2016 11:17:59 +0000 Message-Id: <1457090287-8021-2-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.7.2 In-Reply-To: <1457090287-8021-1-git-send-email-alex.bennee@linaro.org> References: <1457090287-8021-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::230 Cc: Peter Crosthwaite , crosthwaitepeter@gmail.com, pbonzini@redhat.com, =?UTF-8?q?Alex=20Benn=C3=A9e?= , aurelien@aurel32.net, rth@twiddle.net Subject: [Qemu-devel] [PATCH v8 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.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 Reviewed-by: Richard Henderson --- v1 - checkpatch fixes v5 - much simplified due to changes since last posting v6 - remove needless tweaking of gen_code_buf in tb_gen_code v8 - Add r-b tag --- tcg/tcg.c | 6 +++--- tcg/tcg.h | 2 +- translate-all.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) -- 2.7.2 diff --git a/tcg/tcg.c b/tcg/tcg.c index 550671b..bbe3835 100644 --- a/tcg/tcg.c +++ b/tcg/tcg.c @@ -2328,7 +2328,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; @@ -2387,8 +2387,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 b83f763..40c8fbe 100644 --- a/tcg/tcg.h +++ b/tcg/tcg.h @@ -636,7 +636,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; }