[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 36/59] accel/tcg: Move user-related declarations out of 'exec/cpu-
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 36/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4) |
Date: |
Fri, 20 Dec 2024 17:15:27 +0100 |
Move declarations related to page protection under user
emulation from "exec/cpu-all.h" to "user/page-protection.h".
Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Message-Id: <20241212185341.2857-15-philmd@linaro.org>
---
include/exec/cpu-all.h | 6 ------
include/user/page-protection.h | 2 ++
accel/tcg/tb-maint.c | 3 +++
bsd-user/signal.c | 1 +
cpu-target.c | 1 +
linux-user/arm/cpu_loop.c | 1 +
linux-user/signal.c | 1 +
target/arm/tcg/helper-a64.c | 3 +++
target/s390x/tcg/mem_helper.c | 4 +++-
9 files changed, 15 insertions(+), 7 deletions(-)
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 73b11f58abb..f7eea33b101 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -126,12 +126,6 @@ extern const TargetPageBits target_page;
#define TARGET_PAGE_ALIGN(addr) ROUND_UP((addr), TARGET_PAGE_SIZE)
-#if defined(CONFIG_USER_ONLY)
-
-int page_get_flags(target_ulong address);
-
-#endif
-
CPUArchState *cpu_copy(CPUArchState *env);
/* Flags for use in ENV->INTERRUPT_PENDING.
diff --git a/include/user/page-protection.h b/include/user/page-protection.h
index bdd98a37de1..51daa186480 100644
--- a/include/user/page-protection.h
+++ b/include/user/page-protection.h
@@ -19,6 +19,8 @@
void page_protect(tb_page_addr_t page_addr);
int page_unprotect(tb_page_addr_t address, uintptr_t pc);
+int page_get_flags(target_ulong address);
+
/**
* page_set_flags:
* @start: first byte of range
diff --git a/accel/tcg/tb-maint.c b/accel/tcg/tb-maint.c
index 8e272cf790f..3f1bebf6ab5 100644
--- a/accel/tcg/tb-maint.c
+++ b/accel/tcg/tb-maint.c
@@ -33,6 +33,9 @@
#include "tb-internal.h"
#include "internal-common.h"
#include "internal-target.h"
+#ifdef CONFIG_USER_ONLY
+#include "user/page-protection.h"
+#endif
/* List iterators for lists of tagged pointers in TranslationBlock. */
diff --git a/bsd-user/signal.c b/bsd-user/signal.c
index da49b9bffc1..edbcd461bfa 100644
--- a/bsd-user/signal.c
+++ b/bsd-user/signal.c
@@ -22,6 +22,7 @@
#include "qemu/log.h"
#include "qemu.h"
#include "exec/page-protection.h"
+#include "user/page-protection.h"
#include "user/tswap-target.h"
#include "gdbstub/user.h"
#include "signal-common.h"
diff --git a/cpu-target.c b/cpu-target.c
index e9fc4a5be0e..7a2efa890c4 100644
--- a/cpu-target.c
+++ b/cpu-target.c
@@ -29,6 +29,7 @@
#include "migration/vmstate.h"
#ifdef CONFIG_USER_ONLY
#include "qemu.h"
+#include "user/page-protection.h"
#else
#include "hw/core/sysemu-cpu-ops.h"
#include "exec/address-spaces.h"
diff --git a/linux-user/arm/cpu_loop.c b/linux-user/arm/cpu_loop.c
index ec665862d93..709f718a99d 100644
--- a/linux-user/arm/cpu_loop.c
+++ b/linux-user/arm/cpu_loop.c
@@ -25,6 +25,7 @@
#include "signal-common.h"
#include "semihosting/common-semi.h"
#include "exec/page-protection.h"
+#include "user/page-protection.h"
#include "target/arm/syndrome.h"
#define get_user_code_u32(x, gaddr, env) \
diff --git a/linux-user/signal.c b/linux-user/signal.c
index 9b6d772882d..a191e9b26f2 100644
--- a/linux-user/signal.c
+++ b/linux-user/signal.c
@@ -33,6 +33,7 @@
#include "trace.h"
#include "signal-common.h"
#include "host-signal.h"
+#include "user/page-protection.h"
#include "user/safe-syscall.h"
#include "tcg/tcg.h"
diff --git a/target/arm/tcg/helper-a64.c b/target/arm/tcg/helper-a64.c
index 35dce4bef3c..b6af2a59d63 100644
--- a/target/arm/tcg/helper-a64.c
+++ b/target/arm/tcg/helper-a64.c
@@ -34,6 +34,9 @@
#include "qemu/atomic128.h"
#include "fpu/softfloat.h"
#include <zlib.h> /* for crc32 */
+#ifdef CONFIG_USER_ONLY
+#include "user/page-protection.h"
+#endif
/* C2.4.7 Multiply and divide */
/* special cases for 0 and LLONG_MIN are mandated by the standard */
diff --git a/target/s390x/tcg/mem_helper.c b/target/s390x/tcg/mem_helper.c
index 0e12dae2aa8..307388e5bd1 100644
--- a/target/s390x/tcg/mem_helper.c
+++ b/target/s390x/tcg/mem_helper.c
@@ -31,7 +31,9 @@
#include "qemu/int128.h"
#include "qemu/atomic128.h"
-#if !defined(CONFIG_USER_ONLY)
+#if defined(CONFIG_USER_ONLY)
+#include "user/page-protection.h"
+#else
#include "hw/s390x/storage-keys.h"
#include "hw/boards.h"
#endif
--
2.47.1
- [PULL 29/59] accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h', (continued)
- [PULL 29/59] accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 30/59] accel/tcg: Un-inline log_pc(), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 38/59] user: Move 'linux-user/cpu_loop-common.h' -> 'user/cpu_loop.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 23/59] exec/ram_addr: Include missing 'exec/hwaddr.h' and 'exec/cpu-common.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 24/59] include: Include missing 'qemu/clang-tsa.h' header, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 27/59] accel/tcg: Move page_[un]protect() to 'user/page-protection.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 28/59] system: Remove unnecessary 'exec/translate-all.h' include, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 31/59] accel/tcg: Move TranslationBlock declarations to 'tb-internal.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 33/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (1/4), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 35/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (3/4), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 36/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4),
Philippe Mathieu-Daudé <=
- [PULL 39/59] user: Declare cpu_loop() once in 'user/cpu_loop.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 37/59] user: Forward declare target_cpu_copy_regs structure, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 40/59] user: Move various declarations out of 'exec/exec-all.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 41/59] target/loongarch: Declare loongarch_cpu_dump_state() locally, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 43/59] target/sparc: Move sparc_restore_state_to_opc() to cpu.c, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 42/59] target/sparc: Uninline cpu_get_tb_cpu_state(), Philippe Mathieu-Daudé, 2024/12/20
- [PULL 44/59] exec/cpu-all: Include 'cpu.h' earlier so MMU_USER_IDX is always defined, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 45/59] accel/tcg: Declare cpu_loop_exit_requested() in 'exec/cpu-common.h', Philippe Mathieu-Daudé, 2024/12/20
- [PULL 46/59] exec/translation-block: Include missing 'qemu/atomic.h' header, Philippe Mathieu-Daudé, 2024/12/20
- [PULL 47/59] qemu/coroutine: Include missing 'qemu/atomic.h' header, Philippe Mathieu-Daudé, 2024/12/20