Browse Source

accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4)

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>
Philippe Mathieu-Daudé 8 months ago
parent
commit
f47dcf519d

+ 3 - 0
accel/tcg/tb-maint.c

@@ -33,6 +33,9 @@
 #include "tb-internal.h"
 #include "tb-internal.h"
 #include "internal-common.h"
 #include "internal-common.h"
 #include "internal-target.h"
 #include "internal-target.h"
+#ifdef CONFIG_USER_ONLY
+#include "user/page-protection.h"
+#endif
 
 
 
 
 /* List iterators for lists of tagged pointers in TranslationBlock. */
 /* List iterators for lists of tagged pointers in TranslationBlock. */

+ 1 - 0
bsd-user/signal.c

@@ -22,6 +22,7 @@
 #include "qemu/log.h"
 #include "qemu/log.h"
 #include "qemu.h"
 #include "qemu.h"
 #include "exec/page-protection.h"
 #include "exec/page-protection.h"
+#include "user/page-protection.h"
 #include "user/tswap-target.h"
 #include "user/tswap-target.h"
 #include "gdbstub/user.h"
 #include "gdbstub/user.h"
 #include "signal-common.h"
 #include "signal-common.h"

+ 1 - 0
cpu-target.c

@@ -29,6 +29,7 @@
 #include "migration/vmstate.h"
 #include "migration/vmstate.h"
 #ifdef CONFIG_USER_ONLY
 #ifdef CONFIG_USER_ONLY
 #include "qemu.h"
 #include "qemu.h"
+#include "user/page-protection.h"
 #else
 #else
 #include "hw/core/sysemu-cpu-ops.h"
 #include "hw/core/sysemu-cpu-ops.h"
 #include "exec/address-spaces.h"
 #include "exec/address-spaces.h"

+ 0 - 6
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)
 #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);
 CPUArchState *cpu_copy(CPUArchState *env);
 
 
 /* Flags for use in ENV->INTERRUPT_PENDING.
 /* Flags for use in ENV->INTERRUPT_PENDING.

+ 2 - 0
include/user/page-protection.h

@@ -19,6 +19,8 @@
 void page_protect(tb_page_addr_t page_addr);
 void page_protect(tb_page_addr_t page_addr);
 int page_unprotect(tb_page_addr_t address, uintptr_t pc);
 int page_unprotect(tb_page_addr_t address, uintptr_t pc);
 
 
+int page_get_flags(target_ulong address);
+
 /**
 /**
  * page_set_flags:
  * page_set_flags:
  * @start: first byte of range
  * @start: first byte of range

+ 1 - 0
linux-user/arm/cpu_loop.c

@@ -25,6 +25,7 @@
 #include "signal-common.h"
 #include "signal-common.h"
 #include "semihosting/common-semi.h"
 #include "semihosting/common-semi.h"
 #include "exec/page-protection.h"
 #include "exec/page-protection.h"
+#include "user/page-protection.h"
 #include "target/arm/syndrome.h"
 #include "target/arm/syndrome.h"
 
 
 #define get_user_code_u32(x, gaddr, env)                \
 #define get_user_code_u32(x, gaddr, env)                \

+ 1 - 0
linux-user/signal.c

@@ -33,6 +33,7 @@
 #include "trace.h"
 #include "trace.h"
 #include "signal-common.h"
 #include "signal-common.h"
 #include "host-signal.h"
 #include "host-signal.h"
+#include "user/page-protection.h"
 #include "user/safe-syscall.h"
 #include "user/safe-syscall.h"
 #include "tcg/tcg.h"
 #include "tcg/tcg.h"
 
 

+ 3 - 0
target/arm/tcg/helper-a64.c

@@ -34,6 +34,9 @@
 #include "qemu/atomic128.h"
 #include "qemu/atomic128.h"
 #include "fpu/softfloat.h"
 #include "fpu/softfloat.h"
 #include <zlib.h> /* for crc32 */
 #include <zlib.h> /* for crc32 */
+#ifdef CONFIG_USER_ONLY
+#include "user/page-protection.h"
+#endif
 
 
 /* C2.4.7 Multiply and divide */
 /* C2.4.7 Multiply and divide */
 /* special cases for 0 and LLONG_MIN are mandated by the standard */
 /* special cases for 0 and LLONG_MIN are mandated by the standard */

+ 3 - 1
target/s390x/tcg/mem_helper.c

@@ -31,7 +31,9 @@
 #include "qemu/int128.h"
 #include "qemu/int128.h"
 #include "qemu/atomic128.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/s390x/storage-keys.h"
 #include "hw/boards.h"
 #include "hw/boards.h"
 #endif
 #endif