[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PATCH 15/15] target/ppc: Restrict ATTN helper to TCG
From: |
Philippe Mathieu-Daudé |
Subject: |
[PATCH 15/15] target/ppc: Restrict ATTN helper to TCG |
Date: |
Thu, 23 Jan 2025 22:56:09 +0100 |
Move helper_attn() to tcg-excp_helper.c and make
raise_exception_err() static.
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
target/ppc/cpu.h | 2 --
target/ppc/excp_helper.c | 20 --------------------
target/ppc/tcg-excp_helper.c | 13 ++++++++++++-
3 files changed, 12 insertions(+), 23 deletions(-)
diff --git a/target/ppc/cpu.h b/target/ppc/cpu.h
index ca5bbd263cb..35b56368eac 100644
--- a/target/ppc/cpu.h
+++ b/target/ppc/cpu.h
@@ -2752,8 +2752,6 @@ static inline void cpu_get_tb_cpu_state(CPUPPCState *env,
vaddr *pc,
}
#endif
-G_NORETURN void raise_exception_err(CPUPPCState *env, uint32_t exception,
- uint32_t error_code);
G_NORETURN void raise_exception_err_ra(CPUPPCState *env, uint32_t exception,
uint32_t error_code, uintptr_t raddr);
diff --git a/target/ppc/excp_helper.c b/target/ppc/excp_helper.c
index 2d4d47ee384..eedfa2d1de1 100644
--- a/target/ppc/excp_helper.c
+++ b/target/ppc/excp_helper.c
@@ -31,11 +31,6 @@
#include "trace.h"
-#ifdef CONFIG_TCG
-#include "exec/helper-proto.h"
-#include "exec/cpu_ldst.h"
-#endif
-
/*****************************************************************************/
/* Exception processing */
#ifndef CONFIG_USER_ONLY
@@ -400,21 +395,6 @@ static void powerpc_set_excp_state(PowerPCCPU *cpu,
target_ulong vector,
env->reserve_addr = -1;
}
-#ifdef CONFIG_TCG
-#if defined(TARGET_PPC64) && !defined(CONFIG_USER_ONLY)
-void helper_attn(CPUPPCState *env)
-{
- /* POWER attn is unprivileged when enabled by HID, otherwise illegal */
- if ((*env->check_attn)(env)) {
- powerpc_checkstop(env, "host executed attn");
- } else {
- raise_exception_err(env, POWERPC_EXCP_HV_EMU,
- POWERPC_EXCP_INVAL | POWERPC_EXCP_INVAL_INVAL);
- }
-}
-#endif
-#endif /* CONFIG_TCG */
-
static void powerpc_mcheck_checkstop(CPUPPCState *env)
{
/* KVM guests always have MSR[ME] enabled */
diff --git a/target/ppc/tcg-excp_helper.c b/target/ppc/tcg-excp_helper.c
index 072a7fd0947..b6765835683 100644
--- a/target/ppc/tcg-excp_helper.c
+++ b/target/ppc/tcg-excp_helper.c
@@ -56,7 +56,7 @@ void helper_raise_exception(CPUPPCState *env, uint32_t
exception)
#ifndef CONFIG_USER_ONLY
-void raise_exception_err(CPUPPCState *env, uint32_t exception,
+static G_NORETURN void raise_exception_err(CPUPPCState *env, uint32_t
exception,
uint32_t error_code)
{
raise_exception_err_ra(env, exception, error_code, 0);
@@ -544,6 +544,17 @@ void helper_pminsn(CPUPPCState *env, uint32_t insn)
ppc_maybe_interrupt(env);
}
+void helper_attn(CPUPPCState *env)
+{
+ /* POWER attn is unprivileged when enabled by HID, otherwise illegal */
+ if ((*env->check_attn)(env)) {
+ powerpc_checkstop(env, "host executed attn");
+ } else {
+ raise_exception_err(env, POWERPC_EXCP_HV_EMU,
+ POWERPC_EXCP_INVAL | POWERPC_EXCP_INVAL_INVAL);
+ }
+}
+
#endif /* TARGET_PPC64 */
static void do_rfi(CPUPPCState *env, target_ulong nip, target_ulong msr)
--
2.47.1
- [PATCH 06/15] target/ppc: Ensure powerpc_checkstop() is only called under TCG, (continued)
- [PATCH 06/15] target/ppc: Ensure powerpc_checkstop() is only called under TCG, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 07/15] target/ppc: Restrict powerpc_checkstop() to TCG, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 08/15] target/ppc: Remove raise_exception_ra(), Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 09/15] target/ppc: Restrict exception helpers to TCG, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 10/15] target/ppc: Restrict ppc_tcg_hv_emu() to TCG, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 11/15] target/ppc: Restrict various common helpers to TCG, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 12/15] target/ppc: Fix style in excp_helper.c, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 14/15] target/ppc: Restrict various system helpers to TCG, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 13/15] target/ppc: Make powerpc_excp() prototype public, Philippe Mathieu-Daudé, 2025/01/23
- [PATCH 15/15] target/ppc: Restrict ATTN helper to TCG,
Philippe Mathieu-Daudé <=