From nobody Sat Apr 5 17:29:31 2025 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=1737973695; cv=none; d=zohomail.com; s=zohoarc; b=bSYHBLUQJ5sFoVmUl5kEcpalL5lPSKGgYPprAbvJ+ifbD3K1nynYKPhV1bbjFA+cuDwH1Kh5ZV6jIkwelClc0G6FYnp0+yoBHwnpc8BUq1cmEvIzPZhcShGm8j//8k4Or6c+SNkg4+MmGHlyInr8Fu9A/zJCvY9QZ4AePb7IMlg= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1737973695; 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=6f/oCQzbSHImCkqqj0iWpdHWh0qIumN7VF7msGHxoiQ=; b=JkqeMKjhhBL9d9Pp0ve2qg9xjbNuJdLhVrFHBAYE7v8i3gVCyMHBj26yxsxvfM7xWoHaK33yp7FQFcJMeG3s5ONkEwSxsl1ietBXHlLqg3HRzLK8jsi6WVuX/OM6El6vU/kPduFX+0qtN0Mj73Ki3zsdJpznlFszNdX3r37TwDo= 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 1737973695605515.2409935489114; Mon, 27 Jan 2025 02:28:15 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1tcMKj-0001ou-3m; Mon, 27 Jan 2025 05:27:09 -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 1tcMKh-0001nl-Ik for qemu-devel@nongnu.org; Mon, 27 Jan 2025 05:27:07 -0500 Received: from mail-wr1-x434.google.com ([2a00:1450:4864:20::434]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tcMKg-00020L-08 for qemu-devel@nongnu.org; Mon, 27 Jan 2025 05:27:07 -0500 Received: by mail-wr1-x434.google.com with SMTP id ffacd0b85a97d-3862ca8e0bbso3740627f8f.0 for ; Mon, 27 Jan 2025 02:27:05 -0800 (PST) Received: from localhost.localdomain (88-187-86-199.subs.proxad.net. [88.187.86.199]) by smtp.gmail.com with ESMTPSA id ffacd0b85a97d-38c2a17d6casm10931501f8f.30.2025.01.27.02.27.03 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Mon, 27 Jan 2025 02:27:03 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737973624; x=1738578424; 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=6f/oCQzbSHImCkqqj0iWpdHWh0qIumN7VF7msGHxoiQ=; b=WVsimMEr5Q8ALD1rQSewmMpV/y4QRt8cEACLKRFlhGjyZAPxGSWmCCjwRVFp82uW9g yuCFyCly6FPXXYDbl32vzpZGZ5XKYSViREQlJOnTbTs5V5WFaoglVoyARSTdhAWcPnfC FPaTkg/0vYtEnVlmJrdKEzoKLpETBeO/OPQyZliJ4Xmqag1HqiBpW+IvG2BFnZMwW8SR W92qC8/ryI1St5QN91mR43ceE0zR9Ho9m7FlSGET3zCbEHAK1//RTn4NpXiVCcpK+SfZ T+1HZk47s0BI1gIpE2Y6MG1LBFVwyuogeM4kixlN8Y1rBX6WB/vdeilwyu9o0p7BIIWO UqrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737973624; x=1738578424; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=6f/oCQzbSHImCkqqj0iWpdHWh0qIumN7VF7msGHxoiQ=; b=fVZHmkFh5z640vOlsco3fMCrUv2Uy4fGxKLqNy5GGhZuSI2vt3nB10jmrNCgyLV6a1 PJ6nBNaNFEehjcH1Dyay3kYO8X1XQXjhW6ImUx8yLOvKGxsSs8rdQcKQB4UNzj4Vo8Nb 5PIh4HfjtFiD+HMZtwevg+ZGJxJQWiJ1LQA8qR/j6sH5Yglx/Eh6J/Peu2CmnYQnbC7u tmJCdLGexNRPd+z5c7rFc2tkfNIjgZzjMyAHvjx7PEjvy4JcKffaU01uk/MR1W0vlit4 Y9LlDqrSOsiJfPnlyZxqSX3AczvVGjd+nV8lmtIoehHWUXZ9YxZlBELvMr74okpph5eQ kNcA== X-Gm-Message-State: AOJu0YyqrSDE5gAL8ertdQMkdhc74c4uSmpOfeP7Et4+pVgp3X7vxjtj 0K7Gkr7voomYT8nm5Xlym8NiXP3/T0CyB/EMWPcZga4BXHR8gc9k/H1vYAs+Dgejfq/iIhzdmwJ 0XiA= X-Gm-Gg: ASbGncvrARFXAocdaECYP7HpDMgsFIDKJs1+6S7GXMW4Wl/KCNZabg3gSObOhD0ebse dLm/27ZldzBzA+T7xIn13TT/siAYIqJ7A14SA9IRnDKfcRKHQVUj5LP2282dMx+3hpGoFywXE6D xomhxehDhkMkBiR0uCGSQxhkSxyNrmAh+EdPxRdFgyaJUxTmxie4IcL2RFxmCJPR6ywhD1tBKzI ZBaapG7CtPaiUWaZVqptA3FdM7YdGoKmMEXTCIMKAx4Wr2YzZUVGRfKGSwaQn+XrXGQJWEgBNzp 8my3YiZ6yY7T1IXX1Vj5BzjA0ie8JtO+J+untKG36mY+wZDQypt8B9o= X-Google-Smtp-Source: AGHT+IHKY4zpJ+Gd7D4UzSDXFDjqa/RMfwPhSQuRiDfLCbdZnsx5rGuZannld7SpPTG2q2HrZrxhCQ== X-Received: by 2002:a5d:588f:0:b0:38a:418e:1179 with SMTP id ffacd0b85a97d-38bf5649b27mr38869506f8f.2.1737973624175; Mon, 27 Jan 2025 02:27:04 -0800 (PST) From: =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Richard Henderson , Harsh Prateek Bora , qemu-ppc@nongnu.org, Nicholas Piggin , =?UTF-8?q?Philippe=20Mathieu-Daud=C3=A9?= Subject: [PATCH v2 09/15] target/ppc: Restrict exception helpers to TCG Date: Mon, 27 Jan 2025 11:26:13 +0100 Message-ID: <20250127102620.39159-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250127102620.39159-1-philmd@linaro.org> References: <20250127102620.39159-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::434; envelope-from=philmd@linaro.org; helo=mail-wr1-x434.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, T_SCC_BODY_TEXT_LINE=-0.01 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: 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: 1737973697220019000 Move exception helpers to tcg-excp_helper.c so they are only built when TCG is selected. Signed-off-by: Philippe Mathieu-Daud=C3=A9 --- target/ppc/excp_helper.c | 34 -------------------------------- target/ppc/tcg-excp_helper.c | 38 ++++++++++++++++++++++++++++++++++++ 2 files changed, 38 insertions(+), 34 deletions(-) diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c index 9e1a2ecc36f..6a12402b23a 100644 --- a/target/ppc/excp_helper.c +++ b/target/ppc/excp_helper.c @@ -2504,41 +2504,7 @@ bool ppc_cpu_exec_interrupt(CPUState *cs, int interr= upt_request) =20 #endif /* !CONFIG_USER_ONLY */ =20 -/*************************************************************************= ****/ -/* Exceptions processing helpers */ - -void raise_exception_err_ra(CPUPPCState *env, uint32_t exception, - uint32_t error_code, uintptr_t raddr) -{ - CPUState *cs =3D env_cpu(env); - - cs->exception_index =3D exception; - env->error_code =3D error_code; - cpu_loop_exit_restore(cs, raddr); -} - -void raise_exception_err(CPUPPCState *env, uint32_t exception, - uint32_t error_code) -{ - raise_exception_err_ra(env, exception, error_code, 0); -} - -void raise_exception(CPUPPCState *env, uint32_t exception) -{ - raise_exception_err_ra(env, exception, 0, 0); -} - #ifdef CONFIG_TCG -void helper_raise_exception_err(CPUPPCState *env, uint32_t exception, - uint32_t error_code) -{ - raise_exception_err_ra(env, exception, error_code, 0); -} - -void helper_raise_exception(CPUPPCState *env, uint32_t exception) -{ - raise_exception_err_ra(env, exception, 0, 0); -} =20 #ifndef CONFIG_USER_ONLY void helper_store_msr(CPUPPCState *env, target_ulong val) diff --git a/target/ppc/tcg-excp_helper.c b/target/ppc/tcg-excp_helper.c index 93c2d6b5a03..268a1614597 100644 --- a/target/ppc/tcg-excp_helper.c +++ b/target/ppc/tcg-excp_helper.c @@ -19,15 +19,53 @@ #include "qemu/osdep.h" #include "qemu/log.h" #include "exec/cpu_ldst.h" +#include "exec/exec-all.h" +#include "exec/helper-proto.h" #include "system/runstate.h" =20 +#include "helper_regs.h" #include "hw/ppc/ppc.h" #include "internal.h" #include "cpu.h" #include "trace.h" =20 +/*************************************************************************= ****/ +/* Exceptions processing helpers */ + +void raise_exception_err_ra(CPUPPCState *env, uint32_t exception, + uint32_t error_code, uintptr_t raddr) +{ + CPUState *cs =3D env_cpu(env); + + cs->exception_index =3D exception; + env->error_code =3D error_code; + cpu_loop_exit_restore(cs, raddr); +} + +void helper_raise_exception_err(CPUPPCState *env, uint32_t exception, + uint32_t error_code) +{ + raise_exception_err_ra(env, exception, error_code, 0); +} + +void helper_raise_exception(CPUPPCState *env, uint32_t exception) +{ + raise_exception_err_ra(env, exception, 0, 0); +} + #ifndef CONFIG_USER_ONLY =20 +void raise_exception_err(CPUPPCState *env, uint32_t exception, + uint32_t error_code) +{ + raise_exception_err_ra(env, exception, error_code, 0); +} + +void raise_exception(CPUPPCState *env, uint32_t exception) +{ + raise_exception_err_ra(env, exception, 0, 0); +} + void ppc_cpu_do_unaligned_access(CPUState *cs, vaddr vaddr, MMUAccessType access_type, int mmu_idx, uintptr_t retaddr) --=20 2.47.1