From patchwork Thu Jan 23 21:56:03 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: 859389 Delivered-To: patch@linaro.org Received: by 2002:a05:6000:18c8:b0:385:e875:8a9e with SMTP id w8csp494497wrq; Thu, 23 Jan 2025 13:57:40 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCXckJT61kII2KXEfkzjrp1QqT2iydxm7tK/MLrtKrozY+2GHAVPy3vPpLUavpIbWwduF8oyZg==@linaro.org X-Google-Smtp-Source: AGHT+IF9ua18tSs7FcXB21EILNDF4ovh0Eq3MjiLwz8fgYPk3vZ/0bdgNFjGWchs6YE090mVgWvb X-Received: by 2002:a05:6214:3382:b0:6d8:893b:2a13 with SMTP id 6a1803df08f44-6e1f9f053f7mr75849296d6.0.1737669460410; Thu, 23 Jan 2025 13:57:40 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1737669460; cv=none; d=google.com; s=arc-20240605; b=BbPz2lILJSCfQx482btMU/lvzY+Eg/Tp9UKi+vn27aWVrTJsovef2pt08Fo8+jL69s ElniW3KCay8jVFybdZmzrFwtbS1gEqXguArHI2XRJSYvyeEl7eBqLlt4wxWyvcj2IFY3 fcualf4QRZcn1EsUFY/J0eAII0dOD5wMbbveh/1yqj12HlISyLrQ1P1VO+VrGJJBnfCI hkVQWAMV8vBmRTYw/NnCJ/2EIKEw6kvwMMOouEZUgub9T6pEprW8po+HfkcKkuVNRaIG +ujbNUEGk5fdVUjdpgmzWtEQIpWjQKkW4PtKItslXf1ZyP1OcG42hlsGArRIBIUQUjNY 5Hrg== 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=f6VbfoskI6VsEtYPQBX0qo8ZjRYhBMT+vpdrU6ZtLU4=; b=FuFAcS1GKfCYWUt7bzxtt4IsLs1G83F7Rq3SxEjR1h/jJxkVqjRvSWqwBbHlg4jnV6 jgeKmhxGXmCXxax+UvUwgDgivBlelc+TPmCG42E3ySDC5KQPp+1oOGOQ3tMVsA9EcnVI Q95i11dxu2YYGcVkN3m5aJcv5FN6/NgFkNGO1HA41keZuZzrlrXtS56wPftkpTggBRVb QaR4xahN0tQEBqBLvTYyrmk8J9VbIx4hnGpUgOo6jjvutm3NSdyfQicTb0K4BuJZc7fK l8p73q51xPAl9tsfWRlapZzhKti7G1o0+BD3zkVQXZ5QXPaQxlMUkNHhF+xdwLKck5pG 01kA==; dara=google.com ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=BTm3CAQ9; 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 6a1803df08f44-6e20611df43si6488366d6.436.2025.01.23.13.57.40 for (version=TLS1_2 cipher=ECDHE-ECDSA-CHACHA20-POLY1305 bits=256/256); Thu, 23 Jan 2025 13:57:40 -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=BTm3CAQ9; 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 1tb5CB-00053A-8x; Thu, 23 Jan 2025 16:57:03 -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 1tb5CA-00052k-1V for qemu-devel@nongnu.org; Thu, 23 Jan 2025 16:57:02 -0500 Received: from mail-wm1-x32d.google.com ([2a00:1450:4864:20::32d]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1tb5C7-0002pq-SW for qemu-devel@nongnu.org; Thu, 23 Jan 2025 16:57:01 -0500 Received: by mail-wm1-x32d.google.com with SMTP id 5b1f17b1804b1-43618283d48so10535395e9.1 for ; Thu, 23 Jan 2025 13:56:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; t=1737669418; x=1738274218; 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=BTm3CAQ9gNi1mjL1hrGVYtOGJ303BmXw8wfU9snOgrLnYcfVXjnaq0Yh6QOR/Xcsfo KlpefdYKvlivcwOKrPCllTpAYiufDLNFmBbbigqMpUzRuqq+nmrJPer3YiHOCNGS5n3S icd5akML7bkilO6QKN+eI8TFawsrB2q7qj0uOvXR8Yqeh5ifDg3fZ7cC7db4MjSQ1omC co4wHky/f+RLZ3E5+O4wEKoPEcfhpMI4N78B3pL11Kygv6IeJu09GtoSfUSqMM4fcHEU 3E8VG7RjdE3qGecFjA0FxOMqW4rDXJ1rzfWstsWqsaXFRAk3AaNVw12kUokrmT7M8533 XF4w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1737669418; x=1738274218; 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=ZghVJKGE8u4AE4q5NsRqqLtN41jVupCv/NK3BmmYeN5a//dCc+eP/tkky4zqxdZyjh hSrlmJvjRWoN55FVh80y+l7DIoeLorJ+uGJbfB4kLAwO9QHfaPpv4jAXY/fP+DEDIL82 AhPmvKBJEYW5zjt6ZKNzaaf/sN/JM8rSXV1PtzhJbVrrHFJKi9GDnFjp2IYO0qix85gh c7i2nVlJJxTuNWTIm1BlYrW8BldPm+qKDdOXuGF7sTGjg1MeP8ZflEPqAalRs+yi5WZV yrJanjBRYmjMIJeQZ2GOlQJv0cHhAmanaJuj9Y3yqGvTrD1bBUZG4AKftLu9v5dkxiZJ wBhw== X-Gm-Message-State: AOJu0YzclEvTFi1ymghqdso1x/agdkRZWzHPiZhXjY//Ybm6oOYO0PL6 fv9fIcd6DGWr5ebkJ0VOWiBpZbEJloxC1sTBiuFUu/tzFSNFImC2GlgZj6iDjkaAtliqAcGFa6V GDy0= X-Gm-Gg: ASbGnct9covRYCLAHI+J/JVwMOPglmuf8cYf6g8qraWQpUiGVhJjLRX7e2yE9xAO+wq WRV5tOHSQs0Z/u42t2sOPlHUkUyfmVw/g5UrZGTUabQrcC2epmZ/3hU+sXOWs0NDEoJInAWh2EA 6mFrhjsCVRdwStgARnec0dwEUBQGZ9SXL7C7CD1mtvvj+SZ6ZPG794NWKaMuz5G4Z48AAVF1UMj yeq9k0PHC3/WhL4lg0hrYGE8CI5G0qWedMDXwCBTNDvzLdKVg81b2wLRq20/AlTI1PAavhirTE2 fszRQhieDpE7L2kQMIh/9LDwVkGxhPKeLpSVx4rY18qhiyoc18zOtCjg+kVmeUIkGQ== X-Received: by 2002:a5d:6a92:0:b0:386:3403:7b63 with SMTP id ffacd0b85a97d-38bf57b3d42mr17860596f8f.36.1737669418137; Thu, 23 Jan 2025 13:56:58 -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-38c2a1bb040sm785629f8f.67.2025.01.23.13.56.56 (version=TLS1_3 cipher=TLS_CHACHA20_POLY1305_SHA256 bits=256/256); Thu, 23 Jan 2025 13:56:57 -0800 (PST) From: =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= To: qemu-devel@nongnu.org Cc: Daniel Henrique Barboza , Harsh Prateek Bora , Richard Henderson , qemu-ppc@nongnu.org, Nicholas Piggin , =?utf-8?q?Philippe_Mathieu-Daud=C3=A9?= Subject: [PATCH 09/15] target/ppc: Restrict exception helpers to TCG Date: Thu, 23 Jan 2025 22:56:03 +0100 Message-ID: <20250123215609.30432-10-philmd@linaro.org> X-Mailer: git-send-email 2.47.1 In-Reply-To: <20250123215609.30432-1-philmd@linaro.org> References: <20250123215609.30432-1-philmd@linaro.org> MIME-Version: 1.0 Received-SPF: pass client-ip=2a00:1450:4864:20::32d; envelope-from=philmd@linaro.org; helo=mail-wm1-x32d.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: 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)