accel/tcg: Move page_[un]protect() to 'user/page-protection.h'
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Thu, 12 Dec 2024 16:10:46 +0000 (17:10 +0100)
committerPhilippe Mathieu-Daudé <philmd@linaro.org>
Fri, 20 Dec 2024 16:44:57 +0000 (17:44 +0100)
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-7-philmd@linaro.org>

accel/tcg/internal-target.h
accel/tcg/user-exec.c
include/exec/translate-all.h
include/user/page-protection.h [new file with mode: 0644]
linux-user/elfload.c

index fe109724c689074b0cf01711a5c20841cfa207b7..a03c05315a46cbdd8964a3ec020dc0427077a7b2 100644 (file)
@@ -37,6 +37,7 @@ void page_table_config_init(void);
 #endif
 
 #ifdef CONFIG_USER_ONLY
+#include "user/page-protection.h"
 /*
  * For user-only, page_protect sets the page read-only.
  * Since most execution is already on read-only pages, and we'd need to
index 4ed6dd19f3021db55d6164ab6ae1abb4570f9607..636932303bb5d10a0bde73e7eb05bcae9f63c2fe 100644 (file)
@@ -25,7 +25,7 @@
 #include "qemu/rcu.h"
 #include "exec/cpu_ldst.h"
 #include "qemu/main-loop.h"
-#include "exec/translate-all.h"
+#include "user/page-protection.h"
 #include "exec/page-protection.h"
 #include "exec/helper-proto.h"
 #include "qemu/atomic128.h"
index c50661a05d566c48b83507d2bb825f459bc5d5d7..039668ff8acf01955b366f4d705c016113c146f1 100644 (file)
@@ -25,9 +25,4 @@
 /* translate-all.c */
 void tb_check_watchpoint(CPUState *cpu, uintptr_t retaddr);
 
-#ifdef CONFIG_USER_ONLY
-void page_protect(tb_page_addr_t page_addr);
-int page_unprotect(tb_page_addr_t address, uintptr_t pc);
-#endif
-
 #endif /* TRANSLATE_ALL_H */
diff --git a/include/user/page-protection.h b/include/user/page-protection.h
new file mode 100644 (file)
index 0000000..448c7a0
--- /dev/null
@@ -0,0 +1,20 @@
+/*
+ * QEMU page protection declarations.
+ *
+ *  Copyright (c) 2003 Fabrice Bellard
+ *
+ * SPDX-License-Identifier: LGPL-2.1+
+ */
+#ifndef USER_PAGE_PROTECTION_H
+#define USER_PAGE_PROTECTION_H
+
+#ifndef CONFIG_USER_ONLY
+#error Cannot include this header from system emulation
+#endif
+
+#include "exec/translation-block.h"
+
+void page_protect(tb_page_addr_t page_addr);
+int page_unprotect(tb_page_addr_t address, uintptr_t pc);
+
+#endif
index 471a384b2223d7d5b73acf4860a36a1fdf307338..effd3ab47ef573c0e12f7855a1ed7383f89d6991 100644 (file)
@@ -8,6 +8,7 @@
 
 #include "qemu.h"
 #include "user/tswap-target.h"
+#include "user/page-protection.h"
 #include "exec/page-protection.h"
 #include "user/guest-base.h"
 #include "user-internals.h"
@@ -3918,7 +3919,6 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info)
 }
 
 #ifdef USE_ELF_CORE_DUMP
-#include "exec/translate-all.h"
 
 /*
  * Definitions to generate Intel SVR4-like core files.