@samitouri / QOSamiQemu / commits / 67e17ab2b3

exec/cpu-common.h: Avoid including unused exec/page-protection.h header

Since commit e74781c0888e ("exec/cpu: Extract page-protection definitions to page-protection.h") the "exec/cpu-common.h" isn't using anything defined in "exec/page-protection.h"; remove it. Include it in few files where it is currently pulled in indirectly, otherwise we'd get: linux-user/qemu.h:182:22: error: ‘PAGE_READ’ undeclared 182 | #define VERIFY_READ PAGE_READ | ^~~~~~~~~ target/loongarch/cpu_helper.c:329:25: error: use of undeclared identifier 'PAGE_READ' 329 | context->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; | ^ target/loongarch/cpu_helper.c:329:37: error: use of undeclared identifier 'PAGE_WRITE' 329 | context->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; | ^ target/loongarch/cpu_helper.c:329:50: error: use of undeclared identifier 'PAGE_EXEC' 329 | context->prot = PAGE_READ | PAGE_WRITE | PAGE_EXEC; | ^ target/ppc/mmu-hash32.h:98:20: error: use of undeclared identifier 'PAGE_READ' 98 | prot = PAGE_READ | PAGE_WRITE; | ^ target/ppc/mmu-hash32.h:98:32: error: use of undeclared identifier 'PAGE_WRITE' 98 | prot = PAGE_READ | PAGE_WRITE; | ^ hw/ppc/ppc_booke.c:39:17: error: use of undeclared identifier 'PAGE_RWX' 39 | tlb->prot = PAGE_RWX << 4 | PAGE_VALID; | ^ hw/ppc/ppc_booke.c:39:33: error: use of undeclared identifier 'PAGE_VALID' 39 | tlb->prot = PAGE_RWX << 4 | PAGE_VALID; | ^ Signed-off-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Reviewed-by: Richard Henderson <richard.henderson@linaro.org> Message-Id: <20260617160426.64461-6-philmd@oss.qualcomm.com>

Philippe Mathieu-Daudé committed Jun 17, 2026 at 08:16 UTC 67e17ab2b31a292036fe26e11322e67afbefb369
10 files changed +9 -1
hw/ppc/ppc_booke.c
+1
@@ -24,6 +24,7 @@
24
25 #include "qemu/osdep.h"
26 #include "target/ppc/cpu.h"
27 +#include "exec/page-protection.h"
28 #include "exec/target_page.h"
29 #include "hw/ppc/ppc.h"
30 #include "qemu/timer.h"
include/exec/cpu-common.h
-1
@@ -10,7 +10,6 @@
10
11 #include "qemu/thread.h"
12 #include "hw/core/cpu.h"
13 -#include "exec/page-protection.h"
13
14 #define EXCP_INTERRUPT 0x10000 /* async interruption */
15 #define EXCP_HLT 0x10001 /* hlt instruction reached */
linux-user/arm/elfload.c
+1
@@ -2,6 +2,7 @@
2
3 #include "qemu/osdep.h"
4 #include "qemu.h"
5 +#include "exec/page-protection.h"
6 #include "loader.h"
7 #include "user-internals.h"
8 #include "target_elf.h"
linux-user/hppa/elfload.c
+1
@@ -1,6 +1,7 @@
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include "qemu/osdep.h"
4 +#include "exec/page-protection.h"
5 #include "qemu.h"
6 #include "loader.h"
7 #include "target_elf.h"
linux-user/qemu.h
+1
@@ -6,6 +6,7 @@
6
7 #include "user/abitypes.h"
8 #include "user/page-protection.h"
9 +#include "exec/page-protection.h"
10
11 #include "syscall_defs.h"
12 #include "target_syscall.h"
linux-user/x86_64/elfload.c
+1
@@ -2,6 +2,7 @@
2
3 #include "qemu/osdep.h"
4 #include "qemu/error-report.h"
5 +#include "exec/page-protection.h"
6 #include "qemu.h"
7 #include "loader.h"
8 #include "target_elf.h"
target/arm/tcg/cpregs-at.c
+1
@@ -4,6 +4,7 @@
4 */
5
6 #include "qemu/osdep.h"
7 +#include "exec/page-protection.h"
8 #include "cpu.h"
9 #include "cpu-features.h"
10 #include "internals.h"
target/loongarch/cpu_helper.c
+1
@@ -11,6 +11,7 @@
11 #include "system/tcg.h"
12 #include "cpu.h"
13 #include "accel/tcg/cpu-mmu-index.h"
14 +#include "exec/page-protection.h"
15 #include "exec/target_page.h"
16 #include "internals.h"
17 #include "cpu-csr.h"
target/ppc/cpu_init.c
+1
@@ -40,6 +40,7 @@
40 #include "qemu/cutils.h"
41 #include "disas/capstone.h"
42 #include "fpu/softfloat.h"
43 +#include "exec/page-protection.h"
44 #include "exec/watchpoint.h"
45 #include "helper_regs.h"
46 #include "internal.h"
target/ppc/mmu-hash32.h
+1
@@ -3,6 +3,7 @@
3
4 #ifndef CONFIG_USER_ONLY
5
6 +#include "exec/page-protection.h"
7 #include "system/memory.h"
8
9 bool ppc_hash32_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType access_type,