From patchwork Mon Jan 27 10:26:13 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= X-Patchwork-Id: 860228 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:18c8:b0:385:e875:8a9e with SMTP id w8csp1946779wrq; Mon, 27 Jan 2025 02:28:15 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCVW8WmDGXKPFJ0sN8BsNn6IQbxFtQIndomKZ/lIsx0PkkMBntWHRUr+BlL4ntFN7XSjb5gfTw==@linaro.org X-Google-Smtp-Source: AGHT+IGHSGJtXzbOG75SnVaoYSC8yqrmkMwwpp0z7Lsp3tSqg3bheMIvm6sjUXcU6QrkUbrS8MHQ X-Received: by 2002:a05:620a:2726:b0:7b6:d51b:819a with SMTP id af79cd13be357-7be9af2533emr1901754585a.5.1737973695389; Mon, 27 Jan 2025 02:28:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737973695; cv=none; d=google.com; s=arc-20240605; b=J2no750paqbjuEK5oOzC+H27PlekzwUtYkbjzYNLVdMYIrLWTwOaI/0zvD7fX7PjX6 jmZOsqFz3QBjTXxgBGB7PnQgQ101TJXyHRugU8WCVNZMf60wgYQVDTt8v6KZZ6JNTvaD Hgb3MYEs/Sobr7ML7J+dGXG3JHbTjJfFN2PZHPZpzypOtysc0Hyt1MvKnEVrG+ZqHGIz sEMXtur9kOELsqukN8LOwdGkcrNTcyNtW6U/poVRKzIKrm4+wmyDwYQDn7dQgMdZevP+ SnUqjNSu6hgHxNrClP5ZqZzziBQXAg6MtQ4wrLTH678VkOQBX6SvSFpzAA104V5b0KB5 aIyw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=sender:errors-to:list-subscribe:list-help:list-post:list-archive :list-unsubscribe:list-id:precedence:content-transfer-encoding :mime-version:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=6f/oCQzbSHImCkqqj0iWpdHWh0qIumN7VF7msGHxoiQ=; fh=G3zkgtM0+U9rHQHdLuIT+YnPlKRaM6qSFCr7Ftnx4LQ=; b=YjzJiZjmDYLCl+4wXhvHcp5Tg3KraWEse6gdJMFdZkbUvRSpC3EyfHJzbspVOqj1EO i5VFV7bSW+kII5lgad5Umbj/5V7S75I9mHGWiWF9EOuyZEs1fsG/BPUGAnhRLGAuiLOj MpPYattzJbLPy+rK4+TO4+f+MSHJCWDh+SwOFynh1JPw6NEb/JgKKMANrRlA2ebC/W8v M9+4r9sU4fuSiZOZzYMxy1mPifneEK6XYxojNl5dsHQCqUJQLmBf1mNRtN7gqhYkjs5u BXzDwALabQC+rwANdLIWMHmQirphTubdUVp8ngBpbDQ+2pXQTToTfay76K2LUthE7qUr JdoQ==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WVsimMEr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org Return-Path: Received: from lists.gnu.org (lists.gnu.org. [209.51.188.17]) by mx.google.com with ESMTPS id af79cd13be357-7be9ae9339bsi910207585a.153.2025.01.27.02.28.15 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Mon, 27 Jan 2025 02:28:15 -0800 (PST) Received-SPF: pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; Authentication-Results: mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=WVsimMEr; spf=pass (google.com: domain of qemu-devel-bounces+patch=linaro.org@nongnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom="qemu-devel-bounces+patch=linaro.org@nongnu.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org; dara=neutral header.i=@linaro.org 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) 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-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) 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) From: =?utf-8?q?Philippe_Mathieu-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_Mathieu-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 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+patch=linaro.org@nongnu.org Sender: qemu-devel-bounces+patch=linaro.org@nongnu.org Move exception helpers to tcg-excp_helper.c so they are only built when TCG is selected. Signed-off-by: Philippe Mathieu-Daudé --- 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 interrupt_request) #endif /* !CONFIG_USER_ONLY */ -/*****************************************************************************/ -/* Exceptions processing helpers */ - -void raise_exception_err_ra(CPUPPCState *env, uint32_t exception, - uint32_t error_code, uintptr_t raddr) -{ - CPUState *cs = env_cpu(env); - - cs->exception_index = exception; - env->error_code = 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); -} #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" +#include "helper_regs.h" #include "hw/ppc/ppc.h" #include "internal.h" #include "cpu.h" #include "trace.h" +/*****************************************************************************/ +/* Exceptions processing helpers */ + +void raise_exception_err_ra(CPUPPCState *env, uint32_t exception, + uint32_t error_code, uintptr_t raddr) +{ + CPUState *cs = env_cpu(env); + + cs->exception_index = exception; + env->error_code = 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 +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)