exec/cpu-common.h: Reduce header list further
cover exec/cpu-common.h: Reduce header list further
More trivial inclusion cleanups on a core header file.
Philippe Mathieu-Daudé (5):
target/sparc: Include missing 'accel/tcg/cpu-ops.h' header in cpu.c exec/cpu-common.h: Include missing 'qemu/thread.h' header exec/cpu-common.h: Avoid including unused 'exec/vaddr.h' header exec/cpu-common.h: Avoid including unused 'tcg/debug-assert.h' header exec/cpu-common.h: Avoid including unused exec/page-protection.h
header
include/exec/cpu-common.h | 4 +--- linux-user/qemu.h | 1 + target/ppc/mmu-hash32.h | 1 + hw/ppc/ppc_booke.c | 1 + linux-user/arm/elfload.c | 1 + linux-user/hppa/elfload.c | 1 + linux-user/x86_64/elfload.c | 1 + target/arm/tcg/cpregs-at.c | 1 + target/loongarch/cpu_helper.c | 1 + target/loongarch/tcg/tcg_cpu.c | 1 + target/ppc/cpu_init.c | 1 + target/sparc/cpu.c | 1 + 12 files changed, 12 insertions(+), 3 deletions(-)
Signature · 1 line
2.53.0
PATCH 1/5 target/sparc: Include missing 'accel/tcg/cpu-ops.h' header in cpu.c
target/sparc/cpu.c implement a TCGCPUOps structure, which is defined in "accel/tcg/cpu-ops.h":
1040 static const TCGCPUOps sparc_tcg_ops = {
...While this header is currently included indirectly, make the inclusion explicit to avoid issue when refactoring unrelated headers.
--- target/sparc/cpu.c | 1 + 1 file changed, 1 insertion(+)
target/sparc/cpu.c +1 -0
@@ -23,6 +23,7 @@#include "qemu/module.h" #include "qemu/qemu-print.h" #include "accel/tcg/cpu-mmu-index.h" +#include "accel/tcg/cpu-ops.h" #include "exec/translation-block.h" #include "hw/core/qdev-properties.h" #include "qapi/visitor.h"
Signature · 1 line
2.53.0
Re: [PATCH 1/5] target/sparc: Include missing 'accel/tcg/cpu-ops.h' header in cpu.c
Quoted 6 lines · Philippe Mathieu-Daudé
target/sparc/cpu.cimplement a TCGCPUOps structure, which is defined in "accel/tcg/cpu-ops.h":1040 static const TCGCPUOps sparc_tcg_ops = { ...
Quoted 8 lines
While this header is currently included indirectly, make the inclusion explicit to avoid issue when refactoring unrelated headers.
Signed-off-by Philippe Mathieu-Daudé<[email protected]>--- target/sparc/cpu.c | 1 + 1 file changed, 1 insertion(+)
r~
PATCH 2/5 exec/cpu-common.h: Include missing 'qemu/thread.h' header
In reply to Philippe Mathieu-DaudéUnfortunately we need to include "qemu/thread.h" -- which is currently indirectly pulled in -- to get the QemuMutex type definition:
extern QemuMutex qemu_cpu_list_lock;
--- include/exec/cpu-common.h | 1 + 1 file changed, 1 insertion(+)
include/exec/cpu-common.h +1 -0
@@ -8,6 +8,7 @@#ifndef CPU_COMMON_H #define CPU_COMMON_H +#include "qemu/thread.h" #include "exec/vaddr.h" #include "hw/core/cpu.h" #include "tcg/debug-assert.h"
Signature · 1 line
2.53.0
Re: [PATCH 2/5] exec/cpu-common.h: Include missing 'qemu/thread.h' header
Quoted 16 lines · Philippe Mathieu-Daudé
Unfortunately we need to include "
qemu/thread.h" -- which is currently indirectly pulled in -- to get the QemuMutex type definition:extern QemuMutex qemu_cpu_list_lock;Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/exec/cpu-common.h | 1 + 1 file changed, 1 insertion(+)include/exec/cpu-common.h +0
-0
include/exec/cpu-common.h line 14
Quoted 7 lines
include/exec/cpu-common.h +1
-0@@ -8,6 +8,7 @@#ifndef CPU_COMMON_H #define CPU_COMMON_H +#include "qemu/thread.h" #include "exec/vaddr.h" #include "hw/core/cpu.h" #include "tcg/debug-assert.h"
r~
PATCH 3/5 exec/cpu-common.h: Avoid including unused 'exec/vaddr.h' header
In reply to Philippe Mathieu-DaudéWe neglected to remove the "exec/vaddr.h" header when moving cpu_memory_rw_debug() around in commit e9048f099b3 ("exec/cpu:
Declare cpu_memory_rw_debug() in 'hw/core/cpu.h' and document").
--- include/exec/cpu-common.h | 1 - 1 file changed, 1 deletion(-)
include/exec/cpu-common.h +0 -1
@@ -9,7 +9,6 @@#define CPU_COMMON_H #include "qemu/thread.h" -#include "exec/vaddr.h" #include "hw/core/cpu.h" #include "tcg/debug-assert.h" #include "exec/page-protection.h"
Signature · 1 line
2.53.0
Re: [PATCH 3/5] exec/cpu-common.h: Avoid including unused 'exec/vaddr.h' header
Quoted 14 lines · Philippe Mathieu-Daudé
We neglected to remove the "
exec/vaddr.h" header when movingcpu_memory_rw_debug()around in commite9048f099b3("exec/cpu:
Declarecpu_memory_rw_debug()in 'hw/core/cpu.h' and document").Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/exec/cpu-common.h | 1 - 1 file changed, 1 deletion(-)include/exec/cpu-common.h +0
-0
include/exec/cpu-common.h line 14
Quoted 7 lines
include/exec/cpu-common.h +0
-1@@ -9,7 +9,6 @@#define CPU_COMMON_H #include "qemu/thread.h" -#include "exec/vaddr.h" #include "hw/core/cpu.h" #include "tcg/debug-assert.h" #include "exec/page-protection.h"
r~
PATCH 4/5 exec/cpu-common.h: Avoid including unused 'tcg/debug-assert.h' header
In reply to Philippe Mathieu-DaudéSince commit efe25c260cd ("include/exec: Split out accel/tcg/cpu-mmu-index.h") the "exec/cpu-common.h" isn't using anything defined in "tcg/debug-assert.h".
Include it in target/loongarch/tcg/tcg_cpu.c however, where it is required but included indirectly, otherwise we'd get:
target/loongarch/tcg/tcg_cpu.c:291:5: error: call to undeclared function 'tcg_debug_assert'
291 | tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL));
| ^--- include/exec/cpu-common.h | 1 - target/loongarch/tcg/tcg_cpu.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)
include/exec/cpu-common.h +0 -1
@@ -10,7 +10,6 @@#include "qemu/thread.h" #include "hw/core/cpu.h" -#include "tcg/debug-assert.h" #include "exec/page-protection.h" #define EXCP_INTERRUPT 0x10000/* async interruption */
target/loongarch/tcg/tcg_cpu.c +1 -0
@@ -13,6 +13,7 @@#include "accel/tcg/cpu-ops.h" #include "exec/translation-block.h" #include "exec/target_page.h" +#include "tcg/debug-assert.h" #include "tcg_loongarch.h" #include "internals.h"
Signature · 1 line
2.53.0
Re: [PATCH 4/5] exec/cpu-common.h: Avoid including unused 'tcg/debug-assert.h' header
Quoted 34 lines · Philippe Mathieu-Daudé
Since commit
efe25c260cd("include/exec: Split outaccel/tcg/cpu-mmu-index.h") the "exec/cpu-common.h" isn't using anything defined in "tcg/debug-assert.h".Include it in
target/loongarch/tcg/tcg_cpu.chowever, where it is required but included indirectly, otherwise we'd get:target/loongarch/tcg/tcg_cpu.c:291:5: error: call to undeclared function 'tcg_debug_assert' 291 | tcg_debug_assert(!tcg_cflags_has(cs, CF_PCREL)); | ^Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/exec/cpu-common.h | 1 - target/loongarch/tcg/tcg_cpu.c | 1 + 2 files changed, 1 insertion(+), 1 deletion(-)include/exec/cpu-common.h +0
-1@@ -10,7 +10,6 @@#include "qemu/thread.h" #include "hw/core/cpu.h" -#include "tcg/debug-assert.h" #include "exec/page-protection.h" #define EXCP_INTERRUPT 0x10000/* async interruption */ target/loongarch/tcg/tcg_cpu.c +0
-0
target/loongarch/tcg/tcg_cpu.c line 19
Quoted 7 lines
target/loongarch/tcg/tcg_cpu.c +1
-0@@ -13,6 +13,7 @@#include "accel/tcg/cpu-ops.h" #include "exec/translation-block.h" #include "exec/target_page.h" +#include "tcg/debug-assert.h" #include "tcg_loongarch.h" #include "internals.h"
r~
PATCH 5/5 exec/cpu-common.h: Avoid including unused exec/page-protection.h header
In reply to Philippe Mathieu-Daudé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;
| ^--- include/exec/cpu-common.h | 1 - linux-user/qemu.h | 1 + target/ppc/mmu-hash32.h | 1 + hw/ppc/ppc_booke.c | 1 + linux-user/arm/elfload.c | 1 + linux-user/hppa/elfload.c | 1 + linux-user/x86_64/elfload.c | 1 + target/arm/tcg/cpregs-at.c | 1 + target/loongarch/cpu_helper.c | 1 + target/ppc/cpu_init.c | 1 + 10 files changed, 9 insertions(+), 1 deletion(-)
include/exec/cpu-common.h +0 -1
@@ -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 */
linux-user/qemu.h +1 -0
@@ -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"
target/ppc/mmu-hash32.h +1 -0
@@ -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,
hw/ppc/ppc_booke.c +1 -0
@@ -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"
linux-user/arm/elfload.c +1 -0
@@ -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"
linux-user/hppa/elfload.c +1 -0
@@ -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"
linux-user/x86_64/elfload.c +1 -0
@@ -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"
target/arm/tcg/cpregs-at.c +1 -0
@@ -4,6 +4,7 @@*/ #include "qemu/osdep.h" +#include "exec/page-protection.h" #include "cpu.h" #include "cpu-features.h" #include "internals.h"
target/loongarch/cpu_helper.c +1 -0
@@ -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"
target/ppc/cpu_init.c +1 -0
@@ -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"
Signature · 1 line
2.53.0
Re: [PATCH 5/5] exec/cpu-common.h: Avoid including unused exec/page-protection.h header
Quoted 33 lines · Philippe Mathieu-Daudé
Since commit
e74781c0888e("exec/cpu: Extract page-protection definitions topage-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’ undeclared182 | #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é<[email protected]>
Quoted 12 lines
--- include/exec/cpu-common.h | 1 - linux-user/qemu.h | 1 + target/ppc/mmu-hash32.h | 1 + hw/ppc/ppc_booke.c | 1 + linux-user/arm/elfload.c | 1 + linux-user/hppa/elfload.c | 1 + linux-user/x86_64/elfload.c | 1 + target/arm/tcg/cpregs-at.c | 1 + target/loongarch/cpu_helper.c | 1 + target/ppc/cpu_init.c | 1 + 10 files changed, 9 insertions(+), 1 deletion(-)
r~
Philippe Mathieu-Daudé
AppliedQuoted 8 lines
Philippe Mathieu-Daudé (5):
target/sparc: Include missing 'accel/tcg/cpu-ops.h' header incpu.cexec/cpu-common.h: Include missing 'qemu/thread.h' headerexec/cpu-common.h: Avoid including unused 'exec/vaddr.h' headerexec/cpu-common.h: Avoid including unused 'tcg/debug-assert.h' headerexec/cpu-common.h: Avoid including unusedexec/page-protection.h
header
Queued, thanks.