From nobody Tue Apr 7 09:01:54 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=1773594557; cv=none; d=zohomail.com; s=zohoarc; b=fkC2gUIwwbdgsFyxFsYp7yecnSkPhhko3w3gvz6LhSuFj8sVu2UN1cUOl57xEscw9Z/irY20jRLGMSBbwyH/TFCdbp44/Sg5YTQza/5DwcuT5zxy8s5qaZba74osGiollSSmwY/8OgwqWmOQDjqvP+9wQAQkn+JBtzq/q7HcVbI= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1773594557; 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=aV0uPjxZ6bWki0zMCXJl76aFzyARhWh3CQmy3CpQ/eM=; b=QiIyiQcbFkb7SfMPqcoCx99HZ1+JphADpwQ92Ox5mKJJtj5cU5uRwqg0Xl74z8mIYuRjx09UMZfbvvlHN2Tfhweo6xNv0I+3VlMWqiKfL/mHlBERd7PFZONK3en1f4Mjq3bxb2WnGM553aEJ1E24kIyQatSvRk8lHmd+U6sDxcw= 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 1773594556987574.8214407934406; Sun, 15 Mar 2026 10:09:16 -0700 (PDT) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1w1oxQ-00064q-JD; Sun, 15 Mar 2026 13:08:52 -0400 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 1w1oxN-00062r-Sr for qemu-devel@nongnu.org; Sun, 15 Mar 2026 13:08:49 -0400 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1w1oxK-0007DE-3a for qemu-devel@nongnu.org; Sun, 15 Mar 2026 13:08:48 -0400 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-4852ff06541so42215595e9.2 for ; Sun, 15 Mar 2026 10:08:44 -0700 (PDT) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-485564043a2sm101688075e9.2.2026.03.15.10.08.40 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Sun, 15 Mar 2026 10:08:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1773594523; x=1774199323; 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=aV0uPjxZ6bWki0zMCXJl76aFzyARhWh3CQmy3CpQ/eM=; b=RJCkXhM1qsLtbcGOYpDSh6YUeyuS1VlEWOg5ybDCZWhncs8bapskAcxNwQnRjAxWet ldFI58157NS0BIkeAf3QUUvjQ0a4Idkd5vuqAXPCXoO+hTDxS/8gkNDnrjDIeaCrEFmq bv2Y7pWC9R3NtiX5z5Z/fvkyRAST6wN0ei/sYDO7Uzu5nc2VgMOHZwB7aJvyBq/OYuXt QavPLaR2SPRFdzuk5evCWSzDfzA4F7N5fRtX7LeR9jh+4lbSe422JUHjBiP2kHzput8Q LJnmserxcgunlUvNX2vVWRuwUTZKNRkzMSa54jC5t/7J+GSsFxvf2IokOOVSoO/Ub7AW 4HDw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773594523; x=1774199323; 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=aV0uPjxZ6bWki0zMCXJl76aFzyARhWh3CQmy3CpQ/eM=; b=Yxn4NzW9gwkYFF9r141+POkCho43JifjEdmCnAV8pm0GzhHBnVCginA/i+iaoli4s4 WtwG9cdwE73NwMVIwrq/OnFC+Z0YPk5xU0S57ROx85D8lpaoHwCaNPlPVYc8sExJcuBK 32uIiNysvdb9AmteKiyeiym+Cuo40m+S/JrILarpfPBvOzvhlEiihBo4qosm4Cdly+SA nrwNOeBI8Ww8PKGiwYKsyW3KyXagOYf5Kxx1sBdg3uwnbMrzbXMzXntlYB/rXO8DW32C WTPGftO/9wnH9NNley5hur4xLQYf4aXLou8pH0QMkW4tjPz6bmxZvAK3EWARCfe+lWFx N+Bg== X-Gm-Message-State: AOJu0YxgGXSiH37Yu4hu3hipW0K3QEjqfSzQnW6kx77T3TF+3wsKuuy9 9Ff2axsVrUF90nLFzV8t7zMQJ1LEqFDJ5p3ea7Wn49BIKPDKYfmOZgEl6RgeuR0kUMgVslMAv2A 3vpFtzpY= X-Gm-Gg: ATEYQzz5rUqRN3rgVvoqSAn99SlgyDfjllb/qn48Bh54/E86b9C/m8uXxJAsD2Dct2q C09czvIAL+SNjTxjS6w3GhwnJH4NgjyeLWYm21PC3dKn+U7jTxSXWGzRyRRiQr4AOdA3+zrLUJ4 e/x2S01vp5RA7jfbd354sBGY0AccaPjW9w4WZS7hT6H0PUaEdb2tOT07W0TwhqgFlTJArn8Rkja SyrjuZbjeciaipZzE+sgmOea446RgnE+8hhklA1FrbQhiGqrThAnrN66nXlx0xydc7Aljrbb9Gf RiSGowQxNMD78a4PMLIGQdGTLBJYLmVReKeFqPUaguiA19RbQjXu+fVcljbIc6R7wtE0tQKxJgQ xnCaJTT+plBYYWMK13M4tHePrMD4W8SCONKVzIEmvHTd1sY1jZHYRd7LVepDUdEPQ+GLGmoqb5V sV5BdQpuys4rejQlLopGaKXnyHgGcnAAW8R61P/5G88dG220SWCGP1Ps6cF5Aht603gS1GIHdq X-Received: by 2002:a05:600c:8b6f:b0:477:5c58:3d42 with SMTP id 5b1f17b1804b1-485566d92f3mr168031225e9.10.1773594523252; Sun, 15 Mar 2026 10:08:43 -0700 (PDT) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: qemu-ppc@nongnu.org, Pierrick Bouvier , Chinmay Rath , Anton Johansson , Glenn Miles , Nicholas Piggin , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH 1/3] target/ppc: Explicitly declare CFAR register as 64-bit Date: Sun, 15 Mar 2026 18:08:29 +0100 Message-ID: <20260315170832.40331-2-philmd@linaro.org> X-Mailer: git-send-email 2.53.0 In-Reply-To: <20260315170832.40331-1-philmd@linaro.org> References: <20260315170832.40331-1-philmd@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=2a00:1450:4864:20::32c; envelope-from=philmd@linaro.org; helo=mail-wm1-x32c.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: 1773594559181154100 The Come-From Address Register (CFAR) register is only available on 64-bit CPUs, and is 64-bit wide. Prefer the 64-bit APIs over the 'target-long' one. No logical change intended. Signed-off-by: Philippe Mathieu-Daud=C3=A9 Reviewed-by: Anton Johansson Reviewed-by: Glenn Miles --- target/ppc/cpu.h | 2 +- target/ppc/translate.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h index aba8109bbba..63c8fa25acc 100644 --- a/target/ppc/cpu.h +++ b/target/ppc/cpu.h @@ -1285,7 +1285,7 @@ struct CPUArchState { target_ulong ctr; uint32_t crf[8]; /* condition register */ #if defined(TARGET_PPC64) - target_ulong cfar; + uint64_t cfar; #endif target_ulong xer; /* XER (with SO, OV, CA split out) */ target_ulong so; diff --git a/target/ppc/translate.c b/target/ppc/translate.c index f26b0281737..0fc81570a8b 100644 --- a/target/ppc/translate.c +++ b/target/ppc/translate.c @@ -69,7 +69,7 @@ static TCGv cpu_msr; static TCGv cpu_ctr; static TCGv cpu_lr; #if defined(TARGET_PPC64) -static TCGv cpu_cfar; +static TCGv_i64 cpu_cfar; #endif static TCGv cpu_xer, cpu_so, cpu_ov, cpu_ca, cpu_ov32, cpu_ca32; static TCGv cpu_reserve; @@ -124,8 +124,8 @@ void ppc_translate_init(void) offsetof(CPUPPCState, lr), "lr"); =20 #if defined(TARGET_PPC64) - cpu_cfar =3D tcg_global_mem_new(tcg_env, - offsetof(CPUPPCState, cfar), "cfar"); + cpu_cfar =3D tcg_global_mem_new_i64(tcg_env, + offsetof(CPUPPCState, cfar), "cfar"); #endif =20 cpu_xer =3D tcg_global_mem_new(tcg_env, @@ -626,12 +626,12 @@ void spr_write_lr(DisasContext *ctx, int sprn, int gp= rn) /* CFAR */ void spr_read_cfar(DisasContext *ctx, int gprn, int sprn) { - tcg_gen_mov_tl(cpu_gpr[gprn], cpu_cfar); + tcg_gen_mov_i64(cpu_gpr[gprn], cpu_cfar); } =20 void spr_write_cfar(DisasContext *ctx, int sprn, int gprn) { - tcg_gen_mov_tl(cpu_cfar, cpu_gpr[gprn]); + tcg_gen_mov_i64(cpu_cfar, cpu_gpr[gprn]); } =20 /* Breakpoint */ --=20 2.53.0