Commit 67e17ab2b3 for qemu.org

commit 67e17ab2b31a292036fe26e11322e67afbefb369
Author: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com>
Date:   Wed Jun 17 08:16:02 2026 +0200

    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>

diff --git a/hw/ppc/ppc_booke.c b/hw/ppc/ppc_booke.c
index 052c8c931a..6f0cad1c75 100644
--- a/hw/ppc/ppc_booke.c
+++ b/hw/ppc/ppc_booke.c
@@ -24,6 +24,7 @@

 #include "qemu/osdep.h"
 #include "target/ppc/cpu.h"
+#include "exec/page-protection.h"
 #include "exec/target_page.h"
 #include "hw/ppc/ppc.h"
 #include "qemu/timer.h"
diff --git a/include/exec/cpu-common.h b/include/exec/cpu-common.h
index d1a0402536..7eb45a95b6 100644
--- a/include/exec/cpu-common.h
+++ b/include/exec/cpu-common.h
@@ -10,7 +10,6 @@

 #include "qemu/thread.h"
 #include "hw/core/cpu.h"
-#include "exec/page-protection.h"

 #define EXCP_INTERRUPT  0x10000 /* async interruption */
 #define EXCP_HLT        0x10001 /* hlt instruction reached */
diff --git a/linux-user/arm/elfload.c b/linux-user/arm/elfload.c
index fef61022a3..13b589ea2c 100644
--- a/linux-user/arm/elfload.c
+++ b/linux-user/arm/elfload.c
@@ -2,6 +2,7 @@

 #include "qemu/osdep.h"
 #include "qemu.h"
+#include "exec/page-protection.h"
 #include "loader.h"
 #include "user-internals.h"
 #include "target_elf.h"
diff --git a/linux-user/hppa/elfload.c b/linux-user/hppa/elfload.c
index 3354e1b840..2ebb9924f1 100644
--- a/linux-user/hppa/elfload.c
+++ b/linux-user/hppa/elfload.c
@@ -1,6 +1,7 @@
 /* SPDX-License-Identifier: GPL-2.0-or-later */

 #include "qemu/osdep.h"
+#include "exec/page-protection.h"
 #include "qemu.h"
 #include "loader.h"
 #include "target_elf.h"
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 07fe801628..fc5d797302 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -6,6 +6,7 @@

 #include "user/abitypes.h"
 #include "user/page-protection.h"
+#include "exec/page-protection.h"

 #include "syscall_defs.h"
 #include "target_syscall.h"
diff --git a/linux-user/x86_64/elfload.c b/linux-user/x86_64/elfload.c
index 5914f76e83..49a6f6180e 100644
--- a/linux-user/x86_64/elfload.c
+++ b/linux-user/x86_64/elfload.c
@@ -2,6 +2,7 @@

 #include "qemu/osdep.h"
 #include "qemu/error-report.h"
+#include "exec/page-protection.h"
 #include "qemu.h"
 #include "loader.h"
 #include "target_elf.h"
diff --git a/target/arm/tcg/cpregs-at.c b/target/arm/tcg/cpregs-at.c
index 1c819c1cdb..d6d5b73430 100644
--- a/target/arm/tcg/cpregs-at.c
+++ b/target/arm/tcg/cpregs-at.c
@@ -4,6 +4,7 @@
  */

 #include "qemu/osdep.h"
+#include "exec/page-protection.h"
 #include "cpu.h"
 #include "cpu-features.h"
 #include "internals.h"
diff --git a/target/loongarch/cpu_helper.c b/target/loongarch/cpu_helper.c
index 7f0e64a873..123cad3d93 100644
--- a/target/loongarch/cpu_helper.c
+++ b/target/loongarch/cpu_helper.c
@@ -11,6 +11,7 @@
 #include "system/tcg.h"
 #include "cpu.h"
 #include "accel/tcg/cpu-mmu-index.h"
+#include "exec/page-protection.h"
 #include "exec/target_page.h"
 #include "internals.h"
 #include "cpu-csr.h"
diff --git a/target/ppc/cpu_init.c b/target/ppc/cpu_init.c
index d25f69f13b..a02187ce5a 100644
--- a/target/ppc/cpu_init.c
+++ b/target/ppc/cpu_init.c
@@ -40,6 +40,7 @@
 #include "qemu/cutils.h"
 #include "disas/capstone.h"
 #include "fpu/softfloat.h"
+#include "exec/page-protection.h"
 #include "exec/watchpoint.h"
 #include "helper_regs.h"
 #include "internal.h"
diff --git a/target/ppc/mmu-hash32.h b/target/ppc/mmu-hash32.h
index bfea03ea87..c6e2c60db1 100644
--- a/target/ppc/mmu-hash32.h
+++ b/target/ppc/mmu-hash32.h
@@ -3,6 +3,7 @@

 #ifndef CONFIG_USER_ONLY

+#include "exec/page-protection.h"
 #include "system/memory.h"

 bool ppc_hash32_xlate(PowerPCCPU *cpu, vaddr eaddr, MMUAccessType access_type,