[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[PULL 35/59] accel/tcg: Move user-related declarations out of 'exec/cpu-
From: |
Philippe Mathieu-Daudé |
Subject: |
[PULL 35/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (3/4) |
Date: |
Fri, 20 Dec 2024 17:15:26 +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-14-philmd@linaro.org>
---
bsd-user/qemu.h | 1 +
include/exec/cpu-all.h | 12 ------------
include/user/page-protection.h | 12 ++++++++++++
linux-user/qemu.h | 1 +
target/arm/tcg/sve_helper.c | 3 +++
target/hppa/op_helper.c | 3 +++
target/sparc/ldst_helper.c | 3 +++
7 files changed, 23 insertions(+), 12 deletions(-)
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index 3736c417860..04faee459df 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -26,6 +26,7 @@
#include "exec/exec-all.h"
#include "user/abitypes.h"
+#include "user/page-protection.h"
extern char **environ;
diff --git a/include/exec/cpu-all.h b/include/exec/cpu-all.h
index 86cd40020c9..73b11f58abb 100644
--- a/include/exec/cpu-all.h
+++ b/include/exec/cpu-all.h
@@ -130,18 +130,6 @@ extern const TargetPageBits target_page;
int page_get_flags(target_ulong address);
-/**
- * page_check_range
- * @start: first byte of range
- * @len: length of range
- * @flags: flags required for each page
- *
- * Return true if every page in [@start, @start+@len) has @flags set.
- * Return false if any page is unmapped. Thus testing flags == 0 is
- * equivalent to testing for flags == PAGE_VALID.
- */
-bool page_check_range(target_ulong start, target_ulong last, int flags);
-
#endif
CPUArchState *cpu_copy(CPUArchState *env);
diff --git a/include/user/page-protection.h b/include/user/page-protection.h
index d21fab1aaf9..bdd98a37de1 100644
--- a/include/user/page-protection.h
+++ b/include/user/page-protection.h
@@ -34,6 +34,18 @@ void page_set_flags(target_ulong start, target_ulong last,
int flags);
void page_reset_target_data(target_ulong start, target_ulong last);
+/**
+ * page_check_range
+ * @start: first byte of range
+ * @len: length of range
+ * @flags: flags required for each page
+ *
+ * Return true if every page in [@start, @start+@len) has @flags set.
+ * Return false if any page is unmapped. Thus testing flags == 0 is
+ * equivalent to testing for flags == PAGE_VALID.
+ */
+bool page_check_range(target_ulong start, target_ulong last, int flags);
+
/**
* page_check_range_empty:
* @start: first byte of range
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 67bc81b1499..5f007501518 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -5,6 +5,7 @@
#include "exec/cpu_ldst.h"
#include "user/abitypes.h"
+#include "user/page-protection.h"
#include "syscall_defs.h"
#include "target_syscall.h"
diff --git a/target/arm/tcg/sve_helper.c b/target/arm/tcg/sve_helper.c
index 85fe3cae3ed..d0865dece35 100644
--- a/target/arm/tcg/sve_helper.c
+++ b/target/arm/tcg/sve_helper.c
@@ -29,6 +29,9 @@
#include "vec_internal.h"
#include "sve_ldst_internal.h"
#include "hw/core/tcg-cpu-ops.h"
+#ifdef CONFIG_USER_ONLY
+#include "user/page-protection.h"
+#endif
/* Return a value for NZCV as per the ARM PredTest pseudofunction.
diff --git a/target/hppa/op_helper.c b/target/hppa/op_helper.c
index 744325969f5..beb8f88799e 100644
--- a/target/hppa/op_helper.c
+++ b/target/hppa/op_helper.c
@@ -25,6 +25,9 @@
#include "exec/cpu_ldst.h"
#include "qemu/timer.h"
#include "trace.h"
+#ifdef CONFIG_USER_ONLY
+#include "user/page-protection.h"
+#endif
G_NORETURN void HELPER(excp)(CPUHPPAState *env, int excp)
{
diff --git a/target/sparc/ldst_helper.c b/target/sparc/ldst_helper.c
index d92c9f15934..4c54e456553 100644
--- a/target/sparc/ldst_helper.c
+++ b/target/sparc/ldst_helper.c
@@ -26,6 +26,9 @@
#include "exec/exec-all.h"
#include "exec/page-protection.h"
#include "exec/cpu_ldst.h"
+#ifdef CONFIG_USER_ONLY
+#include "user/page-protection.h"
+#endif
#include "asi.h"
//#define DEBUG_MMU
--
2.47.1
- [PULL 34/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (2/4), (continued)
- [PULL 34/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (2/4), Philippe Mathieu-Daudé, 2024/12/20
- [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é <=
- [PULL 36/59] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4), Philippe Mathieu-Daudé, 2024/12/20
- [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