From patchwork Tue Mar 15 14:30:16 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: 63874 Delivered-To: patch@linaro.org Received: by 10.112.199.169 with SMTP id jl9csp703820lbc; Tue, 15 Mar 2016 07:34:05 -0700 (PDT) X-Received: by 10.55.71.135 with SMTP id u129mr31913577qka.26.1458052445758; Tue, 15 Mar 2016 07:34:05 -0700 (PDT) Return-Path: Received: from lists.gnu.org (lists.gnu.org. [2001:4830:134:3::11]) by mx.google.com with ESMTPS id t90si26681233qgd.103.2016.03.15.07.34.05 for (version=TLS1 cipher=AES128-SHA bits=128/128); Tue, 15 Mar 2016 07:34:05 -0700 (PDT) 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]:48608 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afq2v-0006AJ-4e for patch@linaro.org; Tue, 15 Mar 2016 10:34:05 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:48252) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afpzX-0000y1-La for qemu-devel@nongnu.org; Tue, 15 Mar 2016 10:30:41 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1afpzU-0005KA-ET for qemu-devel@nongnu.org; Tue, 15 Mar 2016 10:30:35 -0400 Received: from mail-wm0-x232.google.com ([2a00:1450:400c:c09::232]:34549) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1afpzU-0005K6-7Z for qemu-devel@nongnu.org; Tue, 15 Mar 2016 10:30:32 -0400 Received: by mail-wm0-x232.google.com with SMTP id p65so147339877wmp.1 for ; Tue, 15 Mar 2016 07:30:32 -0700 (PDT) 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=CkTuMx7qV1Hw3OUeiwvNP1meg9VKCllYCL4b6Jo0sa7KuSX1vci/s7Pti4oaEajoh+ 2QpG2+Me1ikDGbdZPZAAolMZ1Mwc63/+aysSAdYTnpvRir74LdKaa6a5TqqjcnPz/J9U lSE9H4drOOCcRjhjRAJ9xU7EuDj75cxX8hgmk= 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=G9BTOjJLDPl6PEVH11aqH3TJ1dYkfxQsxNAZY5PJ/g6UifMjhDwLkNDkNibkB+/cw5 pqjs1h2O5UXjs+Iw+DxrxjBPLEdRL5q0eBXCTw9Sk0yT1ij/N+K7Nq/PMfu6RETy+ESV PqJSkXeJHKqbmEGjqi7fGUmzhudv7+xgd90aJyh26dI1UzgMG0tNwNvwKE91PI4uzpKg ++qU07UhQzw1bI21BzywoBA0jFJSmPJh5OHEaaYcY79li294GONHrz55EzA+SKldJ6Bq bzykyJULcNMCJRG6KgalUSOxepNKUclUEOFa/nfXZs8+6G12WVWBixSMdMbab7nGBVEe fpfg== X-Gm-Message-State: AD7BkJJIrLgtoAhtJ3nyWX9Rtz59GiSznj5/HAHF/X6WlY1MSzeVznxVMpdVMe5MCr/wbaRS X-Received: by 10.194.91.205 with SMTP id cg13mr29998528wjb.166.1458052231547; Tue, 15 Mar 2016 07:30:31 -0700 (PDT) Received: from zen.linaro.local ([81.128.185.34]) by smtp.gmail.com with ESMTPSA id hm9sm27305841wjb.34.2016.03.15.07.30.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 15 Mar 2016 07:30:27 -0700 (PDT) Received: from zen.linaroharston (localhost [127.0.0.1]) by zen.linaro.local (Postfix) with ESMTP id 7D77D3E0432; Tue, 15 Mar 2016 14:30:27 +0000 (GMT) From: =?UTF-8?q?Alex=20Benn=C3=A9e?= To: qemu-devel@nongnu.org Date: Tue, 15 Mar 2016 14:30:16 +0000 Message-Id: <1458052224-9316-3-git-send-email-alex.bennee@linaro.org> X-Mailer: git-send-email 2.7.2 In-Reply-To: <1458052224-9316-1-git-send-email-alex.bennee@linaro.org> References: <1458052224-9316-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::232 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 v9 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; }