From nobody Wed Feb 11 04:02:48 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=none dis=none) header.from=linaro.org ARC-Seal: i=1; a=rsa-sha256; t=1770754585; cv=none; d=zohomail.com; s=zohoarc; b=cUvnHB4GzuQCOlNoWpAx01YB+zLSZRw2NuKdixsaueAvI/vP+XsD75ZcoHFWbToec+MACHxVRb6mINDp07sDaxEGp20jpwTtm4xdmyD9eWpAQA7H3XpO5UibhaRtArBMcVqzqc8K3Rh7vSvazVFtL+FCsq81ZSsHCEu/qNvS1TE= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1770754585; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=pB7XVSfYiRDewWhWw/+06EtFsDlqvDtO9a2FWjRT+oU=; b=i/A8tl0EHmxn2QdTUPpsijUi1LDLQ0tRlwxzXNneF2ppPBfFm9hD4KVhg+ruidHCiagMdlbuKlPI4iFXXO52y0MrBFGCOJ01cR9VY7zrU0w9pFKY/MyRXsObQGJFDMwf9VjWGileER8A4STs8QQm6MD2IaVZcxVzdNDi9NRv1oY= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=none dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1770754585832701.1669552231302; Tue, 10 Feb 2026 12:16:25 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vpu9f-0000Gb-UJ; Tue, 10 Feb 2026 15:16:15 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vpu9P-00081A-Du for qemu-devel@nongnu.org; Tue, 10 Feb 2026 15:15:59 -0500 Received: from mail-pl1-x642.google.com ([2607:f8b0:4864:20::642]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1vpu9N-0008Cc-0a for qemu-devel@nongnu.org; Tue, 10 Feb 2026 15:15:58 -0500 Received: by mail-pl1-x642.google.com with SMTP id d9443c01a7336-2aaed195901so12617155ad.0 for ; Tue, 10 Feb 2026 12:15:55 -0800 (PST) Received: from pc.taild8403c.ts.net (216-71-219-44.dyn.novuscom.net. [216.71.219.44]) by smtp.gmail.com with ESMTPSA id d9443c01a7336-2ab0b392cb5sm38523225ad.70.2026.02.10.12.15.53 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 10 Feb 2026 12:15:54 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1770754554; x=1771359354; darn=nongnu.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:from:to:cc:subject:date :message-id:reply-to; bh=pB7XVSfYiRDewWhWw/+06EtFsDlqvDtO9a2FWjRT+oU=; b=irrrB2zIeJtnvCVRQfBSZiUVMIT/hKz28wY4PrNtubutckwp+TU9dT1FnPw8a008rQ k/nszvbpKJjkFBBRcfUhJ4wTjeRXE4qgkrBpJKwNSjS1vkS0LDPvGtLpQUE5011JwZqw 7FPb+QuKtK5MaaLMOlL4HScILRYayhJ6zpKJ4zZ+FkXRnpyLmPCl5exWVB3uVb6KS/Ud cPkjojxSXiiMbsJU2HVTdpmQRJSN3tH1wNOPdQWQa1N7WheFO5ObZlqGNV+P+VV9mKrb 2HkU55r+JXIizG4PsL9a5TYr3Z5fPZtbWBEP32X09+XhZr8JRpC6svmcBwT+jpQ/AMCE w3PA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1770754554; x=1771359354; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=pB7XVSfYiRDewWhWw/+06EtFsDlqvDtO9a2FWjRT+oU=; b=N1Gs2sd7bAMFwlAHJzbGgiQFSPuMore6wu8AUNaK3LnkhOq/03AqZyIYjSWDyxJkoG H9JYBhaA4Z5e4f7WqTdd/sBIgNpJMDdUs5jWi7QVzyBLPrQ0GwPukvWqjUa4nw0n41ih 8MVrdEUnJBBZdFXnZlRwlFUDm50hLl+pBLRX8tgkfkg1eSrG1Yc+gVELRQrDSghtRDEc k6yb9iNxGNanfiSgl99IgdkF3Upt1Qrymo+6Nx7gbB5pH1u4CyaFZMI9U1UPU+M3cV+W Y6UvfsWJ6BECdpxoLEZUQh2k0LkkLNGQHWSYwwtSZfHDDYkFwlr0AXDPD++Z6X7vOkNO 8bkg== X-Gm-Message-State: AOJu0YysKtSzkMVGDJb0A/9AH+BAyVQoB388bLOhYnRj+5zWQQOefmUW RCPgu0RtH25ZcxQGGGmwKUJRBeqAVJjTh+BreR71hrY9PC51UTrGT0AijlbHpghUtAXrxEa//eJ J3jtwwJg= X-Gm-Gg: AZuq6aKHLCezIfW4XmAgtMP44w/alT1CPThSdracZeCfERSjg2zw817UG2cm5TDtjIm D1Rbi/FIsFMT1i0C+8UBSXPObbcB6k8XWtQrU78aY5P7QNbTEysUkiv6KKCWSBNhoFmQNLEO/sk gYY0ZK1pGG+23rl1ytLscCeVfD3eC68C6x1Ag+I7Ko/R94teftrWDYPNNxILAe/R9+IwJ9rVen7 LmLhSxRtMzNfUQxE7bEe+0TO+ggTBbpYMNaV7x9ZEkP/qAn00ZmYvLPLkqc9swc9Hh69juOdI24 ygZe2LVFoYHE1hy8f54hIoQoSjTWBpnTwYUyu2syvzuBY6KghU8zYUShevTJ1Y9DrQKP7f+2EtD q57uqKXhreZOttR01KYxCuSPwfGQw/H4rOl1zhmbcE1HrDVTieoAzbmtTqJJ59dHRXvwS5Fj/oC /2Je/jprLL+LL2EFLR5vsBF3IsH6MfLFM3xSaFez4wzz4HSzOIUxlulVe+EEpQY6LVYHLBtAnNx n8O X-Received: by 2002:a17:903:b43:b0:2a9:e8b:5326 with SMTP id d9443c01a7336-2ab1034e18dmr33560565ad.23.1770754554449; Tue, 10 Feb 2026 12:15:54 -0800 (PST) From: Pierrick Bouvier To: qemu-devel@nongnu.org Cc: anjo@rev.ng, Jim MacArthur , kvm@vger.kernel.org, Paolo Bonzini , =?UTF-8?q?Alex=20Benn=C3=A9e?= , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= , Pierrick Bouvier , Peter Maydell , qemu-arm@nongnu.org, Richard Henderson Subject: [PATCH v3 11/12] target/arm/tcg/translate.h: replace target_long with int64_t Date: Tue, 10 Feb 2026 12:15:39 -0800 Message-ID: <20260210201540.1405424-12-pierrick.bouvier@linaro.org> X-Mailer: git-send-email 2.47.3 In-Reply-To: <20260210201540.1405424-1-pierrick.bouvier@linaro.org> References: <20260210201540.1405424-1-pierrick.bouvier@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=2607:f8b0:4864:20::642; envelope-from=pierrick.bouvier@linaro.org; helo=mail-pl1-x642.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity @linaro.org) X-ZM-MESSAGEID: 1770754588066154100 target_long is used to represent a pc diff. Checked all call sites to make sure we were already passing signed values, so extending works as expected. Use vaddr for pc_curr and pc_save. Reviewed-by: Richard Henderson Reviewed-by: Philippe Mathieu-Daud=C3=A9 Signed-off-by: Pierrick Bouvier --- target/arm/tcg/translate-a32.h | 2 +- target/arm/tcg/translate.h | 12 ++++++------ target/arm/tcg/translate.c | 18 +++++++++--------- 3 files changed, 16 insertions(+), 16 deletions(-) diff --git a/target/arm/tcg/translate-a32.h b/target/arm/tcg/translate-a32.h index 0b1fa57965c..a8df364171b 100644 --- a/target/arm/tcg/translate-a32.h +++ b/target/arm/tcg/translate-a32.h @@ -40,7 +40,7 @@ void write_neon_element64(TCGv_i64 src, int reg, int ele,= MemOp memop); TCGv_i32 add_reg_for_lit(DisasContext *s, int reg, int ofs); void gen_set_cpsr(TCGv_i32 var, uint32_t mask); void gen_set_condexec(DisasContext *s); -void gen_update_pc(DisasContext *s, target_long diff); +void gen_update_pc(DisasContext *s, int64_t diff); void gen_lookup_tb(DisasContext *s); long vfp_reg_offset(bool dp, unsigned reg); long neon_full_reg_offset(unsigned reg); diff --git a/target/arm/tcg/translate.h b/target/arm/tcg/translate.h index 2c8358dd7fa..3e3094a463e 100644 --- a/target/arm/tcg/translate.h +++ b/target/arm/tcg/translate.h @@ -27,8 +27,8 @@ typedef struct DisasLabel { typedef struct DisasDelayException { struct DisasDelayException *next; TCGLabel *lab; - target_long pc_curr; - target_long pc_save; + vaddr pc_curr; + vaddr pc_save; int condexec_mask; int condexec_cond; uint32_t excp; @@ -359,14 +359,14 @@ static inline int curr_insn_len(DisasContext *s) =20 #ifdef TARGET_AARCH64 void a64_translate_init(void); -void gen_a64_update_pc(DisasContext *s, target_long diff); +void gen_a64_update_pc(DisasContext *s, int64_t diff); extern const TranslatorOps aarch64_translator_ops; #else static inline void a64_translate_init(void) { } =20 -static inline void gen_a64_update_pc(DisasContext *s, target_long diff) +static inline void gen_a64_update_pc(DisasContext *s, int64_t diff) { } #endif @@ -377,9 +377,9 @@ void arm_gen_test_cc(int cc, TCGLabel *label); MemOp pow2_align(unsigned i); void unallocated_encoding(DisasContext *s); void gen_exception_internal(int excp); -void gen_exception_insn_el(DisasContext *s, target_long pc_diff, int excp, +void gen_exception_insn_el(DisasContext *s, int64_t pc_diff, int excp, uint32_t syn, uint32_t target_el); -void gen_exception_insn(DisasContext *s, target_long pc_diff, +void gen_exception_insn(DisasContext *s, int64_t pc_diff, int excp, uint32_t syn); TCGLabel *delay_exception_el(DisasContext *s, int excp, uint32_t syn, uint32_t target_el); diff --git a/target/arm/tcg/translate.c b/target/arm/tcg/translate.c index 982c83ef42a..42b2785fb06 100644 --- a/target/arm/tcg/translate.c +++ b/target/arm/tcg/translate.c @@ -250,12 +250,12 @@ static inline int get_a32_user_mem_index(DisasContext= *s) } =20 /* The pc_curr difference for an architectural jump. */ -static target_long jmp_diff(DisasContext *s, target_long diff) +static int64_t jmp_diff(DisasContext *s, int64_t diff) { return diff + (s->thumb ? 4 : 8); } =20 -static void gen_pc_plus_diff(DisasContext *s, TCGv_i32 var, target_long di= ff) +static void gen_pc_plus_diff(DisasContext *s, TCGv_i32 var, int64_t diff) { assert(s->pc_save !=3D -1); if (tb_cflags(s->base.tb) & CF_PCREL) { @@ -735,7 +735,7 @@ void gen_set_condexec(DisasContext *s) } } =20 -void gen_update_pc(DisasContext *s, target_long diff) +void gen_update_pc(DisasContext *s, int64_t diff) { gen_pc_plus_diff(s, cpu_R[15], diff); s->pc_save =3D s->pc_curr + diff; @@ -1055,7 +1055,7 @@ static void gen_exception(int excp, uint32_t syndrome) tcg_constant_i32(syndrome)); } =20 -static void gen_exception_insn_el_v(DisasContext *s, target_long pc_diff, +static void gen_exception_insn_el_v(DisasContext *s, int64_t pc_diff, int excp, uint32_t syn, TCGv_i32 tcg_e= l) { if (s->aarch64) { @@ -1068,14 +1068,14 @@ static void gen_exception_insn_el_v(DisasContext *s= , target_long pc_diff, s->base.is_jmp =3D DISAS_NORETURN; } =20 -void gen_exception_insn_el(DisasContext *s, target_long pc_diff, int excp, +void gen_exception_insn_el(DisasContext *s, int64_t pc_diff, int excp, uint32_t syn, uint32_t target_el) { gen_exception_insn_el_v(s, pc_diff, excp, syn, tcg_constant_i32(target_el)); } =20 -void gen_exception_insn(DisasContext *s, target_long pc_diff, +void gen_exception_insn(DisasContext *s, int64_t pc_diff, int excp, uint32_t syn) { if (s->aarch64) { @@ -1310,7 +1310,7 @@ static void gen_goto_ptr(void) * cpu_loop_exec. Any live exit_requests will be processed as we * enter the next TB. */ -static void gen_goto_tb(DisasContext *s, unsigned tb_slot_idx, target_long= diff) +static void gen_goto_tb(DisasContext *s, unsigned tb_slot_idx, int64_t dif= f) { if (translator_use_goto_tb(&s->base, s->pc_curr + diff)) { /* @@ -1337,7 +1337,7 @@ static void gen_goto_tb(DisasContext *s, unsigned tb_= slot_idx, target_long diff) } =20 /* Jump, specifying which TB number to use if we gen_goto_tb() */ -static void gen_jmp_tb(DisasContext *s, target_long diff, int tbno) +static void gen_jmp_tb(DisasContext *s, int64_t diff, int tbno) { if (unlikely(s->ss_active)) { /* An indirect jump so that we still trigger the debug exception. = */ @@ -1380,7 +1380,7 @@ static void gen_jmp_tb(DisasContext *s, target_long d= iff, int tbno) } } =20 -static inline void gen_jmp(DisasContext *s, target_long diff) +static inline void gen_jmp(DisasContext *s, int64_t diff) { gen_jmp_tb(s, diff, 0); } --=20 2.47.3