accel/tcg: Extract user APIs out of 'exec/[cpu, exec]-all.h'
Subsystems (2)
cover accel/tcg: Extract user APIs out of 'exec/[cpu, exec]-all.h'
The goal of this series is to clarify user emulation APIs, and clean the mixed bag of exec/foo-all.h headers.
Move user specific declarations out of the generic
- "exec/cpu-all.h",
- "exec/cpu_ldst.h",
- "exec/exec-all.h" and
- "exec/translate-all.h"
to the generic:
- "accel/tcg/tb-internal.h" and
- "exec/page-protection.h"
and the user specific:
- "user/cpu_loop.h",
- "user/guest-host.h" and
- "user/page-protection.h"
Philippe Mathieu-Daudé (18):
exec: Introduce 'user/guest-host.h' header linux-user/aarch64: Include missing 'user/abitypes.h' header
include: Include missing 'qemu/clang-tsa.h' header accel/tcg: Declare mmap_[un]lock() in 'exec/page-protection.h' accel/tcg: Use tb_page_addr_t type in page_unprotect() accel/tcg: Move page_[un]protect() to 'user/page-protection.h'
system: Remove unnecessary 'exec/translate-all.h' include accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h' accel/tcg: Un-inline log_pc()
accel/tcg: Move TranslationBlock declarations to 'tb-internal.h' accel/tcg: Move user-related declarations out of 'exec/cpu-all.h'
(1/4)
accel/tcg: Move user-related declarations out of 'exec/cpu-all.h'
(2/4)
accel/tcg: Move user-related declarations out of 'exec/cpu-all.h'
(3/4)
accel/tcg: Move user-related declarations out of 'exec/cpu-all.h'
(4/4) user: Forward declare target_cpu_copy_regs structure
user: Move 'linux-user/cpu_loop-common.h' -> 'user/cpu_loop.h'
user: Declare cpu_loop() once in 'user/cpu_loop.h'
user: Move various declarations out of 'exec/exec-all.h'
accel/tcg/internal-target.h | 43 +--------- accel/tcg/tb-internal.h | 53 +++++++++++++ bsd-user/bsd-mem.h | 1 + bsd-user/qemu.h | 3 +- include/block/block_int-common.h | 1 + include/exec/cpu-all.h | 112 +-------------------------- include/exec/cpu_ldst.h | 47 +---------- include/exec/exec-all.h | 72 +---------------- include/exec/page-protection.h | 24 ++++++ include/exec/translate-all.h | 33 -------- include/user/cpu_loop.h | 90 +++++++++++++++++++++ include/user/guest-host.h | 87 +++++++++++++++++++++ include/user/page-protection.h | 99 +++++++++++++++++++++++ linux-user/aarch64/mte_user_helper.h | 2 + linux-user/cpu_loop-common.h | 31 -------- linux-user/qemu.h | 1 + linux-user/user-internals.h | 1 - accel/tcg/cpu-exec.c | 13 ++++ accel/tcg/cputlb.c | 3 +- accel/tcg/tb-maint.c | 6 +- accel/tcg/translate-all.c | 4 +- accel/tcg/translator.c | 1 + accel/tcg/user-exec.c | 6 +- accel/tcg/watchpoint.c | 3 +- block/create.c | 1 + bsd-user/main.c | 1 + bsd-user/mmap.c | 1 + bsd-user/signal.c | 2 + cpu-target.c | 2 +- linux-user/aarch64/cpu_loop.c | 4 +- linux-user/alpha/cpu_loop.c | 4 +- linux-user/arm/cpu_loop.c | 5 +- linux-user/elfload.c | 2 +- linux-user/flatload.c | 1 + linux-user/hexagon/cpu_loop.c | 4 +- linux-user/hppa/cpu_loop.c | 4 +- linux-user/i386/cpu_loop.c | 4 +- linux-user/loongarch64/cpu_loop.c | 4 +- linux-user/m68k/cpu_loop.c | 4 +- linux-user/main.c | 3 +- linux-user/microblaze/cpu_loop.c | 4 +- linux-user/mips/cpu_loop.c | 4 +- linux-user/mmap.c | 1 + linux-user/openrisc/cpu_loop.c | 4 +- linux-user/ppc/cpu_loop.c | 4 +- linux-user/riscv/cpu_loop.c | 4 +- linux-user/s390x/cpu_loop.c | 4 +- linux-user/sh4/cpu_loop.c | 4 +- linux-user/signal.c | 2 + linux-user/sparc/cpu_loop.c | 4 +- linux-user/syscall.c | 3 +- linux-user/xtensa/cpu_loop.c | 4 +- system/physmem.c | 1 - target/arm/helper.c | 1 + target/arm/tcg/helper-a64.c | 3 + target/arm/tcg/mte_helper.c | 4 + target/arm/tcg/sve_helper.c | 3 + target/hppa/op_helper.c | 3 + target/s390x/tcg/mem_helper.c | 4 +- target/sparc/ldst_helper.c | 3 + tests/unit/test-bdrv-drain.c | 1 + tests/unit/test-block-iothread.c | 1 + util/qemu-thread-posix.c | 1 + 63 files changed, 467 insertions(+), 382 deletions(-) create mode 100644 accel/tcg/tb-internal.h delete mode 100644 include/exec/translate-all.h create mode 100644 include/user/cpu_loop.h create mode 100644 include/user/guest-host.h create mode 100644 include/user/page-protection.h delete mode 100644 linux-user/cpu_loop-common.h
Signature · 1 line
2.45.2
PATCH 1/18 exec: Introduce 'user/guest-host.h' header
Extract all declarations related to 'guest from/to host' address translation to a new "user/guest-host.h" header.
--- include/exec/cpu-all.h | 34 +-------------- include/exec/cpu_ldst.h | 47 +-------------------- include/user/guest-host.h | 87 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 79 deletions(-) create mode 100644 include/user/guest-host.h
include/exec/cpu-all.h +1 -33
@@ -64,39 +64,7 @@/* MMU memory access macros */ -#if defined(CONFIG_USER_ONLY ) -#include "user/abitypes.h" - -/* -* If non-zero, the guest virtual address space is a contiguous subset -* of the host virtual address space, i.e. '-R reserved_va' is in effect -* either from the command-line or by default. The value is the last -* byte of the guest address space e.g. UINT32_MAX. -* -* If zero, the host and guest virtual address spaces are intermingled. -*/ -extern unsigned long reserved_va; - -/* -* Limit the guest addresses as best we can. -* -* When not using -R reserved_va, we cannot really limit the guest -* to less address space than the host. For 32-bit guests, this -* acts as a sanity check that we're not giving the guest an address -* that it cannot even represent. For 64-bit guests... the address -* might not be what the real kernel would give, but it is at least -* representable in the guest. -* -* TODO: Improve address allocation to avoid this problem, and to -* avoid setting bits at the top of guest addresses that might need -* to be used for tags. -*/ -#define GUEST_ADDR_MAX_ \ - ((MIN_CONST(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <= 32) ? \ - UINT32_MAX : ~0ul) -#define GUEST_ADDR_MAX (reserved_va ? : GUEST_ADDR_MAX_) - -#else +#if !defined(CONFIG_USER_ONLY )#include "exec/hwaddr.h"
include/exec/cpu_ldst.h +1 -46
53 lines not on this page · raw message
include/user/guest-host.h new file +87 -0
87 lines not on this page · raw message
Signature · 1 line
2.45.2
Re: [PATCH 01/18] exec: Introduce 'user/guest-host.h' header
Quoted 199 lines · Philippe Mathieu-Daudé
Extract all declarations related to 'guest from/to host' address translation to a new "
user/guest-host.h" header.Signed-off-by Philippe Mathieu-Daudé <[email protected]>Reviewed-by Pierrick Bouvier <[email protected]>Reviewed-by Richard Henderson <[email protected]>--- include/exec/cpu-all.h | 34 +-------------- include/exec/cpu_ldst.h | 47 +-------------------- include/user/guest-host.h | 87 +++++++++++++++++++++++++++++++++++++++ 3 files changed, 89 insertions(+), 79 deletions(-)create mode 100644
include/user/guest-host.hinclude/exec/cpu-all.h +1
-33@@ -64,39 +64,7 @@/* MMU memory access macros */ -#if defined(CONFIG_USER_ONLY ) -#include "user/abitypes.h" - -/* -* If non-zero, the guest virtual address space is a contiguous subset -* of the host virtual address space, i.e. '-R reserved_va' is in effect -* either from the command-line or by default. The value is the last -* byte of the guest address space e.g. UINT32_MAX. -* -* If zero, the host and guest virtual address spaces are intermingled. -*/ -extern unsigned long reserved_va; - -/* -* Limit the guest addresses as best we can. -* -* When not using -R reserved_va, we cannot really limit the guest -* to less address space than the host. For 32-bit guests, this -* acts as a sanity check that we're not giving the guest an address -* that it cannot even represent. For 64-bit guests... the address -* might not be what the real kernel would give, but it is at least -* representable in the guest. -* -* TODO: Improve address allocation to avoid this problem, and to -* avoid setting bits at the top of guest addresses that might need -* to be used for tags. -*/ -#define GUEST_ADDR_MAX_ \ - ((MIN_CONST(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <= 32) ? \ - UINT32_MAX : ~0ul) -#define GUEST_ADDR_MAX (reserved_va ? : GUEST_ADDR_MAX_) - -#else +#if !defined(CONFIG_USER_ONLY )#include "exec/hwaddr.h" include/exec/cpu_ldst.h +1
-46@@ -72,52 +72,7 @@#include "qemu/int128.h" #if defined(CONFIG_USER_ONLY ) - -#include "user/guest-base.h" - -#ifndef TARGET_TAGGED_ADDRESSES -static inline abi_ptr cpu_untagged_addr (CPUState *cs,abi_ptr x) -{ -return x; -} -#endif - -/* All direct uses of g2h and h2g need to go away for usermode softmmu. */ -static inline void *g2h_untagged (abi_ptr x) -{ -return (void *)((uintptr_t )(x) + guest_base); -} - -static inline void *g2h (CPUState *cs,abi_ptr x) -{ -return g2h_untagged (cpu_untagged_addr (cs, x)); -} - -static inline bool guest_addr_valid_untagged (abi_ulong x) -{ -return x <=GUEST_ADDR_MAX ; -} - -static inline bool guest_range_valid_untagged (abi_ulong start,abi_ulong len) -{ -return len -1 <=GUEST_ADDR_MAX && start <=GUEST_ADDR_MAX - len +1 ; -} - -#define h2g_valid (x) \ - (HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS || \ - (uintptr_t)(x) - guest_base <= GUEST_ADDR_MAX) - -#define h2g_nocheck (x) ({ \ - uintptr_t __ret = (uintptr_t)(x) - guest_base; \ - (abi_ptr)__ret; \ -}) - -#define h2g (x) ({ \ -/* Check if given address fits target address space */ \ -assert (h2g_valid (x)); \ -h2g_nocheck (x); \ -}) - +#include "user/guest-host.h" #endif /* CONFIG_USER_ONLY */ uint32_t cpu_ldub_data (CPUArchState *env,abi_ptr ptr);include/user/guest-host.h new file +77
-0@@ -0,0 +1,87 @@ +/* SPDX-License-Identifier: LGPL-2.1-or-later */ +/* +* guest <-> host helpers. +* +* Copyright (c) 2003 Fabrice Bellard +*/ + +#ifndef USER_GUEST_HOST_H +#define USER_GUEST_HOST_H + +#include "user/abitypes.h" +#include "user/guest-base.h" +#include "cpu.h" + +/* +* If non-zero, the guest virtual address space is a contiguous subset +* of the host virtual address space, i.e. '-R reserved_va' is in effect +* either from the command-line or by default. The value is the last +* byte of the guest address space e.g. UINT32_MAX. +* +* If zero, the host and guest virtual address spaces are intermingled. +*/ +extern unsigned long reserved_va; + +/* +* Limit the guest addresses as best we can. +* +* When not using -R reserved_va, we cannot really limit the guest +* to less address space than the host. For 32-bit guests, this +* acts as a sanity check that we're not giving the guest an address +* that it cannot even represent. For 64-bit guests... the address +* might not be what the real kernel would give, but it is at least +* representable in the guest. +* +* TODO: Improve address allocation to avoid this problem, and to +* avoid setting bits at the top of guest addresses that might need +* to be used for tags. +*/ +#define GUEST_ADDR_MAX_ \ + ((MIN_CONST(TARGET_VIRT_ADDR_SPACE_BITS, TARGET_ABI_BITS) <= 32) ? \ + UINT32_MAX : ~0ul) +#define GUEST_ADDR_MAX (reserved_va ? : GUEST_ADDR_MAX_) + +#ifndef TARGET_TAGGED_ADDRESSES +static inline abi_ptr cpu_untagged_addr (CPUState *cs,abi_ptr x) +{ +return x; +} +#endif + +/* All direct uses of g2h and h2g need to go away for usermode softmmu. */ +static inline void *g2h_untagged (abi_ptr x) +{ +return (void *)((uintptr_t )(x) + guest_base); +} + +static inline void *g2h (CPUState *cs,abi_ptr x) +{ +return g2h_untagged (cpu_untagged_addr (cs, x)); +} + +static inline bool guest_addr_valid_untagged (abi_ulong x) +{ +return x <=GUEST_ADDR_MAX ; +} + +static inline bool guest_range_valid_untagged (abi_ulong start,abi_ulong len) +{ +return len -1 <=GUEST_ADDR_MAX && start <=GUEST_ADDR_MAX - len +1 ; +} + +#define h2g_valid (x) \ + (HOST_LONG_BITS <= TARGET_VIRT_ADDR_SPACE_BITS || \ + (uintptr_t)(x) - guest_base <= GUEST_ADDR_MAX) + +#define h2g_nocheck (x) ({ \ + uintptr_t __ret = (uintptr_t)(x) - guest_base; \
include/user/guest-host.h line 87
Quoted 10 lines
include/user/guest-host.h new file +10
-0+ (abi_ptr )__ret; \ +}) + +#define h2g (x) ({ \ +/* Check if given address fits target address space */ \ +assert (h2g_valid (x)); \ +h2g_nocheck (x); \ +}) + +#endif
PATCH 2/18 linux-user/aarch64: Include missing 'user/abitypes.h' header
In reply to Philippe Mathieu-Daudéarm_set_mte_tcf0() uses the abi_long type which is defined in "user/abitypes.h". Include it in order to avoid when refactoring:
In file included from ../../target/arm/gdbstub64.c:28:
../linux-user/aarch64/mte_user_helper.h:30:42: error: unknown type name ‘abi_long’; did you mean ‘u_long’?
30 | void arm_set_mte_tcf0(CPUArchState *env, abi_long value);
| ^~~~~~~~--- linux-user/aarch64/mte_user_helper.h | 2 ++ 1 file changed, 2 insertions(+)
linux-user/aarch64/mte_user_helper.h +2 -0
@@ -9,6 +9,8 @@#ifndef AARCH64_MTE_USER_HELPER_H #define AARCH64_MTE USER_HELPER_H +#include "user/abitypes.h" +#ifndef PR_MTE_TCF_SHIFT # define PR_MTE_TCF_SHIFT 1# define PR_MTE_TCF_NONE (0UL << PR_MTE_TCF_SHIFT)
Signature · 1 line
2.45.2
Re: [PATCH 02/18] linux-user/aarch64: Include missing 'user/abitypes.h' header
Quoted 19 lines · Philippe Mathieu-Daudé
arm_set_mte_tcf0()uses theabi_longtype which is defined in "user/abitypes.h". Include it in order to avoid when refactoring:In file included from ../../target/arm/gdbstub64.c:28: ../linux-user/aarch64/mte_user_helper.h:30:42: error: unknown type name ‘abi_long’; did you mean ‘u_long’? 30 | void arm_set_mte_tcf0(CPUArchState *env, abi_long value); | ^~~~~~~~Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- linux-user/aarch64/mte_user_helper.h | 2 ++ 1 file changed, 2 insertions(+)linux-user/aarch64/mte_user_helper.h +0
-0
linux-user/aarch64/mte_user_helper.h line 16
Quoted 8 lines
linux-user/aarch64/mte_user_helper.h +2
-0@@ -9,6 +9,8 @@#ifndef AARCH64_MTE_USER_HELPER_H #define AARCH64_MTE USER_HELPER_H +#include "user/abitypes.h" +#ifndef PR_MTE_TCF_SHIFT # define PR_MTE_TCF_SHIFT 1# define PR_MTE_TCF_NONE (0UL << PR_MTE_TCF_SHIFT)
PATCH 3/18 include: Include missing 'qemu/clang-tsa.h' header
In reply to Philippe Mathieu-DaudéThe next commit will remove "qemu/clang-tsa.h" of "exec/exec-all.h", however the following files indirectly include it:
$ git grep -L qemu/clang-tsa.h $(git grep -wl TSA_NO_TSA) block/create.c include/block/block_int-common.h tests/unit/test-bdrv-drain.c tests/unit/test-block-iothread.c util/qemu-thread-posix.c
Explicitly include it so we can process with the removal in the next commit.
--- include/block/block_int-common.h | 1 + block/create.c | 1 + tests/unit/test-bdrv-drain.c | 1 + tests/unit/test-block-iothread.c | 1 + util/qemu-thread-posix.c | 1 + 5 files changed, 5 insertions(+)
include/block/block_int-common.h +1 -0
@@ -28,6 +28,7 @@#include "block/block-common.h" #include "block/block-global-state.h" #include "block/snapshot.h" +#include "qemu/clang-tsa.h" #include "qemu/iov.h" #include "qemu/rcu.h" #include "qemu/stats64.h"
block/create.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "block/block_int.h" +#include "qemu/clang-tsa.h" #include "qemu/job.h" #include "qemu/main-loop.h" #include "qapi/qapi-commands-block-core.h"
tests/unit/test-bdrv-drain.c +1 -0
@@ -28,6 +28,7 @@#include "system/block-backend.h" #include "qapi/error.h" #include "qemu/main-loop.h" +#include "qemu/clang-tsa.h" #include "iothread.h" static QemuEvent done_event;
tests/unit/test-block-iothread.c +1 -0
@@ -29,6 +29,7 @@#include "system/block-backend.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" +#include "qemu/clang-tsa.h" #include "qemu/main-loop.h" #include "iothread.h"
util/qemu-thread-posix.c +1 -0
@@ -17,6 +17,7 @@#include "qemu-thread-common.h" #include "qemu/tsan.h" #include "qemu/bitmap.h" +#include "qemu/clang-tsa.h" #ifdef CONFIG_PTHREAD_SET_NAME_NP #include <pthread_np.h>
Signature · 1 line
2.45.2
Re: [PATCH 03/18] include: Include missing 'qemu/clang-tsa.h' header
Quoted 75 lines · Philippe Mathieu-Daudé
The next commit will remove "
qemu/clang-tsa.h" of "exec/exec-all.h", however the following files indirectly include it:$ git grep -L qemu/clang-tsa.h $(git grep -wl TSA_NO_TSA) block/create.c include/block/block_int-common.h tests/unit/test-bdrv-drain.c tests/unit/test-block-iothread.c util/qemu-thread-posix.cExplicitly include it so we can process with the removal in the next commit.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/block/block_int-common.h | 1 + block/create.c | 1 + tests/unit/test-bdrv-drain.c | 1 + tests/unit/test-block-iothread.c | 1 + util/qemu-thread-posix.c | 1 + 5 files changed, 5 insertions(+)include/block/block_int-common.h +1
-0@@ -28,6 +28,7 @@#include "block/block-common.h" #include "block/block-global-state.h" #include "block/snapshot.h" +#include "qemu/clang-tsa.h" #include "qemu/iov.h" #include "qemu/rcu.h" #include "qemu/stats64.h" block/create.c +1
-0@@ -24,6 +24,7 @@#include "qemu/osdep.h" #include "block/block_int.h" +#include "qemu/clang-tsa.h" #include "qemu/job.h" #include "qemu/main-loop.h" #include "qapi/qapi-commands-block-core.h" tests/unit/test-bdrv-drain.c +1
-0@@ -28,6 +28,7 @@#include "system/block-backend.h" #include "qapi/error.h" #include "qemu/main-loop.h" +#include "qemu/clang-tsa.h" #include "iothread.h" static QemuEvent done_event;tests/unit/test-block-iothread.c +1
-0@@ -29,6 +29,7 @@#include "system/block-backend.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" +#include "qemu/clang-tsa.h" #include "qemu/main-loop.h" #include "iothread.h" util/qemu-thread-posix.c +0
-0
util/qemu-thread-posix.c line 23
Quoted 7 lines
util/qemu-thread-posix.c +1
-0@@ -17,6 +17,7 @@#include "qemu-thread-common.h" #include "qemu/tsan.h" #include "qemu/bitmap.h" +#include "qemu/clang-tsa.h" #ifdef CONFIG_PTHREAD_SET_NAME_NP #include <pthread_np.h>
Seems like a better place for all this would be in:include/qemu/compiler.h, instead of a separate clang-tsa header.
But for the current version,
Re: [PATCH 03/18] include: Include missing 'qemu/clang-tsa.h' header
Quoted 74 lines · Pierrick Bouvier
Quoted 73 lines · Philippe Mathieu-Daudé
The next commit will remove "
qemu/clang-tsa.h" of "exec/exec-all.h", however the following files indirectly include it:$ git grep -L qemu/clang-tsa.h $(git grep -wl TSA_NO_TSA) block/create.c include/block/block_int-common.h tests/unit/test-bdrv-drain.c tests/unit/test-block-iothread.c util/qemu-thread-posix.cExplicitly include it so we can process with the removal in the next commit.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
include/block/block_int-common.h| 1 +
block/create.c | 1 +
tests/unit/test-bdrv-drain.c | 1 +
tests/unit/test-block-iothread.c| 1 +
util/qemu-thread-posix.c | 1 +5 files changed, 5 insertions(+)include/block/block_int-common.h +1
-0@@ -28,6 +28,7 @@ #include "block/block-common.h" #include "block/block-global-state.h" #include "block/snapshot.h" +#include "qemu/clang-tsa.h" #include "qemu/iov.h" #include "qemu/rcu.h" #include "qemu/stats64.h"block/create.c +1
-0@@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "block/block_int.h" +#include "qemu/clang-tsa.h" #include "qemu/job.h" #include "qemu/main-loop.h" #include "qapi/qapi-commands-block-core.h"tests/unit/test-bdrv-drain.c +1
-0@@ -28,6 +28,7 @@ #include "system/block-backend.h" #include "qapi/error.h" #include "qemu/main-loop.h" +#include "qemu/clang-tsa.h" #include "iothread.h" static QemuEvent done_event;tests/unit/test-block-iothread.c +1
-0@@ -29,6 +29,7 @@ #include "system/block-backend.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" +#include "qemu/clang-tsa.h" #include "qemu/main-loop.h" #include "iothread.h"util/qemu-thread-posix.c +0
-0@@ -17,6 +17,7 @@ #include "qemu-thread-common.h"
Quoted 8 lines
util/qemu-thread-posix.c line 23
Quoted 5 lines
util/qemu-thread-posix.c +1
-0#include "qemu/tsan.h" #include "qemu/bitmap.h" +#include "qemu/clang-tsa.h" #ifdef CONFIG_PTHREAD_SET_NAME_NP #include <pthread_np.h>Seems like a better place for all this would be in:
include/qemu/compiler.h, instead of a separate clang-tsa header.
Yeah I was thinking the same, but since there is already another header, I didn't want to delay this cleanup further by modifying unrelated files.
Quoted 2 lines
But for the current version,
Reviewed-by Pierrick Bouvier <[email protected]>
Thanks!
Re: [PATCH 03/18] include: Include missing 'qemu/clang-tsa.h' header
Quoted 86 lines · Philippe Mathieu-Daudé
Quoted 76 lines · Pierrick Bouvier
Quoted 75 lines · Philippe Mathieu-Daudé
The next commit will remove "
qemu/clang-tsa.h" of "exec/exec-all.h", however the following files indirectly include it:$ git grep -L qemu/clang-tsa.h $(git grep -wl TSA_NO_TSA) block/create.c include/block/block_int-common.h tests/unit/test-bdrv-drain.c tests/unit/test-block-iothread.c util/qemu-thread-posix.cExplicitly include it so we can process with the removal in the next commit.
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/block/block_int-common.h | 1 + block/create.c | 1 + tests/unit/test-bdrv-drain.c | 1 + tests/unit/test-block-iothread.c | 1 + util/qemu-thread-posix.c | 1 + 5 files changed, 5 insertions(+)include/block/ renamed from include/block/block_int-common.h +0
-0
block_int-common.h
indexebb4e56a503..bb91a0f62fa100644include/block/block_int-common.h +1
-0@@ -28,6 +28,7 @@ #include "block/block-common.h" #include "block/block-global-state.h" #include "block/snapshot.h" +#include "qemu/clang-tsa.h" #include "qemu/iov.h" #include "qemu/rcu.h" #include "qemu/stats64.h"block/create.c +1
-0@@ -24,6 +24,7 @@ #include "qemu/osdep.h" #include "block/block_int.h" +#include "qemu/clang-tsa.h" #include "qemu/job.h" #include "qemu/main-loop.h" #include "qapi/qapi-commands-block-core.h"tests/unit/test-bdrv-drain.c +1
-0@@ -28,6 +28,7 @@ #include "system/block-backend.h" #include "qapi/error.h" #include "qemu/main-loop.h" +#include "qemu/clang-tsa.h" #include "iothread.h" static QemuEvent done_event;tests/unit/test-block- renamed from tests/unit/test-block-iothread.c +0
-0
iothread.c
index26a6c051758..1de04a8a13d100644tests/unit/test-block-iothread.c +1
-0@@ -29,6 +29,7 @@ #include "system/block-backend.h" #include "qapi/error.h" #include "qapi/qmp/qdict.h" +#include "qemu/clang-tsa.h" #include "qemu/main-loop.h" #include "iothread.h"util/qemu-thread-posix.c +0
-0@@ -17,6 +17,7 @@ #include "qemu-thread-common.h"Quoted 8 lines
util/qemu-thread-posix.c line 23
Quoted 5 lines
util/qemu-thread-posix.c +1
-0#include "qemu/tsan.h" #include "qemu/bitmap.h" +#include "qemu/clang-tsa.h" #ifdef CONFIG_PTHREAD_SET_NAME_NP #include <pthread_np.h>Seems like a better place for all this would be in:
include/qemu/compiler.h, instead of a separate clang-tsa header.
Quoted 4 lines
Yeah I was thinking the same, but since there is already another header, I didn't want to delay this cleanup further by modifying unrelated files.
No worries, that's why I still sent a reviewed-by.
Quoted 4 lines
Quoted 2 lines
But for the current version,
Reviewed-by Pierrick Bouvier <[email protected]>Thanks!
PATCH 4/18 accel/tcg: Declare mmap_[un]lock() in 'exec/page-protection.h'
In reply to Philippe Mathieu-DaudéMove mmap_lock(), mmap_unlock() declarations and the WITH_MMAP_LOCK_GUARD() definition to 'exec/page-protection.h'.
--- include/exec/exec-all.h | 17 ----------------- include/exec/page-protection.h | 24 ++++++++++++++++++++++++ accel/tcg/cpu-exec.c | 1 + accel/tcg/translate-all.c | 1 + accel/tcg/watchpoint.c | 1 + linux-user/flatload.c | 1 + target/arm/helper.c | 1 + 7 files changed, 29 insertions(+), 17 deletions(-)
include/exec/exec-all.h +0 -17
@@ -27,7 +27,6 @@#endif #include "exec/mmu-access-type.h" #include "exec/translation-block.h" -#include "qemu/clang-tsa.h" /** * cpu_loop_exit_requested:
@@ -520,18 +519,6 @@ static inline tb_page_addr_t get_page_addr_code(CPUArchState *env, }#if defined(CONFIG_USER_ONLY ) -void TSA_NO_TSA mmap_lock(void); -void TSA_NO_TSA mmap_unlock(void); -bool have_mmap_lock (void ); - -static inline void mmap_unlock_guard (void *unused) -{ -mmap_unlock (); -} - -#define WITH_MMAP_LOCK_GUARD () \ - for (int _mmap_lock_iter __attribute__((cleanup(mmap_unlock_guard))) \ - = (mmap_lock(), 0); _mmap_lock_iter == 0; _mmap_lock_iter = 1)/** * adjust_signal_pc:
@@ -585,10 +572,6 @@ G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, uintptr_t ra);#else -static inline void mmap_lock (void ) {} -static inline void mmap_unlock (void ) {} -#define WITH_MMAP_LOCK_GUARD () -void tlb_reset_dirty (CPUState *cpu,ram_addr_t start1,ram_addr_t length);void tlb_reset_dirty_range_all (ram_addr_t start,ram_addr_t length);
include/exec/page-protection.h +24 -0
@@ -38,4 +38,28 @@*/ #define PAGE_PASSTHROUGH 0x0800 +#ifdef CONFIG_USER_ONLY + +#include "qemu/clang-tsa.h" + +void TSA_NO_TSA mmap_lock(void); +void TSA_NO_TSA mmap_unlock(void); +bool have_mmap_lock (void ); + +static inline void mmap_unlock_guard (void *unused) +{ +mmap_unlock (); +} + +#define WITH_MMAP_LOCK_GUARD () \ + for (int _mmap_lock_iter __attribute__((cleanup(mmap_unlock_guard))) \ + = (mmap_lock(), 0); _mmap_lock_iter == 0; _mmap_lock_iter = 1) +#else + +static inline void mmap_lock (void ) {} +static inline void mmap_unlock (void ) {} +#define WITH_MMAP_LOCK_GUARD () + +#endif /* !CONFIG_USER_ONLY */ +#endif
accel/tcg/cpu-exec.c +1 -0
@@ -25,6 +25,7 @@#include "trace.h" #include "disas/disas.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "tcg/tcg.h" #include "qemu/atomic.h" #include "qemu/rcu.h"
accel/tcg/translate-all.c +1 -0
@@ -44,6 +44,7 @@#endif #include "exec/cputlb.h" +#include "exec/page-protection.h" #include "exec/translate-all.h" #include "exec/translator.h" #include "exec/tb-flush.h"
accel/tcg/watchpoint.c +1 -0
@@ -22,6 +22,7 @@#include "qemu/error-report.h" #include "exec/exec-all.h" #include "exec/translate-all.h" +#include "exec/page-protection.h" #include "system/tcg.h" #include "system/replay.h" #include "hw/core/tcg-cpu-ops.h"
linux-user/flatload.c +1 -0
@@ -34,6 +34,7 @@#include "qemu/osdep.h" #include "qemu.h" +#include "exec/page-protection.h" #include "user-internals.h" #include "loader.h" #include "user-mmap.h"
target/arm/helper.c +1 -0
@@ -13,6 +13,7 @@#include "internals.h" #include "cpu-features.h" #include "exec/helper-proto.h" +#include "exec/page-protection.h" #include "qemu/main-loop.h" #include "qemu/timer.h" #include "qemu/bitops.h"
Signature · 1 line
2.45.2
Re: [PATCH 04/18] accel/tcg: Declare mmap_[un]lock() in 'exec/page-protection.h'
Quoted 142 lines · Philippe Mathieu-Daudé
Move
mmap_lock(),mmap_unlock()declarations and theWITH_MMAP_LOCK_GUARD()definition to 'exec/page-protection.h'.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/exec/exec-all.h | 17 ----------------- include/exec/page-protection.h | 24 ++++++++++++++++++++++++ accel/tcg/cpu-exec.c | 1 + accel/tcg/translate-all.c | 1 + accel/tcg/watchpoint.c | 1 + linux-user/flatload.c | 1 + target/arm/helper.c | 1 + 7 files changed, 29 insertions(+), 17 deletions(-)include/exec/exec-all.h +0
-17@@ -27,7 +27,6 @@#endif #include "exec/mmu-access-type.h" #include "exec/translation-block.h" -#include "qemu/clang-tsa.h" /** * cpu_loop_exit_requested: @@ -520,18 +519,6 @@ static inline tb_page_addr_t get_page_addr_code(CPUArchState *env, }#if defined(CONFIG_USER_ONLY ) -void TSA_NO_TSA mmap_lock(void); -void TSA_NO_TSA mmap_unlock(void); -bool have_mmap_lock (void ); - -static inline void mmap_unlock_guard (void *unused) -{ -mmap_unlock (); -} - -#define WITH_MMAP_LOCK_GUARD () \ - for (int _mmap_lock_iter __attribute__((cleanup(mmap_unlock_guard))) \ - = (mmap_lock(), 0); _mmap_lock_iter == 0; _mmap_lock_iter = 1)/** * adjust_signal_pc: @@ -585,10 +572,6 @@ G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, uintptr_t ra);#else -static inline void mmap_lock (void ) {} -static inline void mmap_unlock (void ) {} -#define WITH_MMAP_LOCK_GUARD () -void tlb_reset_dirty (CPUState *cpu,ram_addr_t start1,ram_addr_t length);void tlb_reset_dirty_range_all (ram_addr_t start,ram_addr_t length);include/exec/page-protection.h +24
-0@@ -38,4 +38,28 @@*/ #define PAGE_PASSTHROUGH 0x0800 +#ifdef CONFIG_USER_ONLY + +#include "qemu/clang-tsa.h" + +void TSA_NO_TSA mmap_lock(void); +void TSA_NO_TSA mmap_unlock(void); +bool have_mmap_lock (void ); + +static inline void mmap_unlock_guard (void *unused) +{ +mmap_unlock (); +} + +#define WITH_MMAP_LOCK_GUARD () \ + for (int _mmap_lock_iter __attribute__((cleanup(mmap_unlock_guard))) \ + = (mmap_lock(), 0); _mmap_lock_iter == 0; _mmap_lock_iter = 1) +#else + +static inline void mmap_lock (void ) {} +static inline void mmap_unlock (void ) {} +#define WITH_MMAP_LOCK_GUARD () + +#endif /* !CONFIG_USER_ONLY */ +#endif accel/tcg/cpu-exec.c +1
-0@@ -25,6 +25,7 @@#include "trace.h" #include "disas/disas.h" #include "exec/exec-all.h" +#include "exec/page-protection.h" #include "tcg/tcg.h" #include "qemu/atomic.h" #include "qemu/rcu.h" accel/tcg/translate-all.c +1
-0@@ -44,6 +44,7 @@#endif #include "exec/cputlb.h" +#include "exec/page-protection.h" #include "exec/translate-all.h" #include "exec/translator.h" #include "exec/tb-flush.h" accel/tcg/watchpoint.c +1
-0@@ -22,6 +22,7 @@#include "qemu/error-report.h" #include "exec/exec-all.h" #include "exec/translate-all.h" +#include "exec/page-protection.h" #include "system/tcg.h" #include "system/replay.h" #include "hw/core/tcg-cpu-ops.h" linux-user/flatload.c +1
-0@@ -34,6 +34,7 @@#include "qemu/osdep.h" #include "qemu.h" +#include "exec/page-protection.h" #include "user-internals.h" #include "loader.h" #include "user-mmap.h" target/arm/helper.c +0
-0
target/arm/helper.c line 19
Quoted 7 lines
target/arm/helper.c +1
-0@@ -13,6 +13,7 @@#include "internals.h" #include "cpu-features.h" #include "exec/helper-proto.h" +#include "exec/page-protection.h" #include "qemu/main-loop.h" #include "qemu/timer.h" #include "qemu/bitops.h"
PATCH 5/18 accel/tcg: Use tb_page_addr_t type in page_unprotect()
In reply to Philippe Mathieu-DaudéMatch with the page_protect() prototype, use a tb_page_addr_t argument instead of target_ulong.
--- include/exec/translate-all.h | 2 +- accel/tcg/user-exec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)
include/exec/translate-all.h +1 -1
@@ -27,7 +27,7 @@ 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 (target_ulong address,uintptr_t pc); +int page_unprotect (tb_page_addr_t address,uintptr_t pc);#endif #endif /* TRANSLATE_ALL_H */
accel/tcg/user-exec.c +1 -1
@@ -696,7 +696,7 @@ void page_protect(tb_page_addr_t address)* immediately exited. (We can only return 2 if the 'pc' argument is * non-zero.) */ -int page_unprotect (target_ulong address,uintptr_t pc) +int page_unprotect (tb_page_addr_t address,uintptr_t pc) {PageFlagsNode *p;bool current_tb_invalidated;
Signature · 1 line
2.45.2
Re: [PATCH 05/18] accel/tcg: Use tb_page_addr_t type in page_unprotect()
Quoted 27 lines · Philippe Mathieu-Daudé
Match with the
page_protect()prototype, use atb_page_addr_targument instead oftarget_ulong.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/exec/translate-all.h | 2 +- accel/tcg/user-exec.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-)include/exec/translate-all.h +1
-1@@ -27,7 +27,7 @@ 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 (target_ulong address,uintptr_t pc); +int page_unprotect (tb_page_addr_t address,uintptr_t pc);#endif #endif /* TRANSLATE_ALL_H */ accel/tcg/user-exec.c +0
-0
accel/tcg/user-exec.c void page_protect(tb_page_addr_t address) · line 702
Quoted 8 lines
accel/tcg/user-exec.c +1
-1@@ -696,7 +696,7 @@ void page_protect(tb_page_addr_t address)* immediately exited. (We can only return 2 if the 'pc' argument is * non-zero.) */ -int page_unprotect (target_ulong address,uintptr_t pc) +int page_unprotect (tb_page_addr_t address,uintptr_t pc) {PageFlagsNode *p;bool current_tb_invalidated;
PATCH 6/18 accel/tcg: Move page_[un]protect() to 'user/page-protection.h'
In reply to Philippe Mathieu-Daudé--- accel/tcg/internal-target.h | 1 + include/exec/translate-all.h | 5 ----- include/user/page-protection.h | 20 ++++++++++++++++++++ accel/tcg/user-exec.c | 2 +- linux-user/elfload.c | 2 +- 5 files changed, 23 insertions(+), 7 deletions(-) create mode 100644 include/user/page-protection.h
accel/tcg/internal-target.h +1 -0
@@ -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
include/exec/translate-all.h +0 -5
@@ -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 */
include/user/page-protection.h new file +20 -0
@@ -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
accel/tcg/user-exec.c +1 -1
@@ -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"
linux-user/elfload.c +1 -1
@@ -3918,7 +3918,7 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info) }#ifdef USE_ELF_CORE_DUMP -#include "exec/translate-all.h" +#include "user/page-protection.h" /* * Definitions to generate Intel SVR4-like core files.
Signature · 1 line
2.45.2
Re: [PATCH 06/18] accel/tcg: Move page_[un]protect() to 'user/page-protection.h'
Quoted 80 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- accel/tcg/internal-target.h | 1 + include/exec/translate-all.h | 5 ----- include/user/page-protection.h | 20 ++++++++++++++++++++ accel/tcg/user-exec.c | 2 +- linux-user/elfload.c | 2 +- 5 files changed, 23 insertions(+), 7 deletions(-)create mode 100644
include/user/page-protection.haccel/tcg/internal-target.h +1
-0@@ -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 include/exec/translate-all.h +0
-5@@ -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 */ include/user/page-protection.h new file +20
-0@@ -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 accel/tcg/user-exec.c +1
-1@@ -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" linux-user/elfload.c +0
-0
linux-user/elfload.c int load_elf_binary(struct linux_binprm *bprm, struct image_info *info) · line 3924
Quoted 8 lines
linux-user/elfload.c +1
-1@@ -3918,7 +3918,7 @@ int load_elf_binary(struct linux_binprm *bprm, struct image_info *info) }#ifdef USE_ELF_CORE_DUMP -#include "exec/translate-all.h" +#include "user/page-protection.h" /* * Definitions to generate Intel SVR4-like core files.
PATCH 7/18 system: Remove unnecessary 'exec/translate-all.h' include
In reply to Philippe Mathieu-DaudéAt this point "exec/translate-all.h" only declaretb_check_watchpoint(), which isn't used by any ofcpu-target.c or system/physmem.c, so remove its
inclusion.
--- cpu-target.c | 1 - system/physmem.c | 1 - 2 files changed, 2 deletions(-)
cpu-target.c +0 -1
@@ -41,7 +41,6 @@#include "exec/cpu-common.h" #include "exec/exec-all.h" #include "exec/tb-flush.h" -#include "exec/translate-all.h" #include "exec/log.h" #include "hw/core/accel-cpu.h" #include "trace/trace-root.h"
system/physmem.c +0 -1
@@ -61,7 +61,6 @@#include "qemu/rcu_queue.h" #include "qemu/main-loop.h" -#include "exec/translate-all.h" #include "system/replay.h" #include "exec/memory-internal.h"
Signature · 1 line
2.45.2
Re: [PATCH 07/18] system: Remove unnecessary 'exec/translate-all.h' include
Quoted 28 lines · Philippe Mathieu-Daudé
At this point "
exec/translate-all.h" only declaretb_check_watchpoint(), which isn't used by any ofcpu-target.corsystem/physmem.c, so remove its
inclusion.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- cpu-target.c | 1 - system/physmem.c | 1 - 2 files changed, 2 deletions(-)cpu-target.c +0
-1@@ -41,7 +41,6 @@#include "exec/cpu-common.h" #include "exec/exec-all.h" #include "exec/tb-flush.h" -#include "exec/translate-all.h" #include "exec/log.h" #include "hw/core/accel-cpu.h" #include "trace/trace-root.h" system/physmem.c +0
-0
system/physmem.c line 66
Quoted 7 lines
system/physmem.c +0
-1@@ -61,7 +61,6 @@#include "qemu/rcu_queue.h" #include "qemu/main-loop.h" -#include "exec/translate-all.h" #include "system/replay.h" #include "exec/memory-internal.h"
PATCH 8/18 accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h'
In reply to Philippe Mathieu-Daudé"exec/translate-all.h" is only useful to TCG accelerator, so move it to accel/tcg/, after renaming it 'tb-internal.h'.
--- accel/tcg/internal-target.h | 2 +- accel/tcg/tb-internal.h | 14 ++++++++++++++ include/exec/translate-all.h | 28 ---------------------------- accel/tcg/cputlb.c | 2 +- accel/tcg/tb-maint.c | 2 +- accel/tcg/translate-all.c | 2 +- accel/tcg/user-exec.c | 1 + accel/tcg/watchpoint.c | 2 +- 8 files changed, 20 insertions(+), 33 deletions(-) create mode 100644 accel/tcg/tb-internal.h delete mode 100644 include/exec/translate-all.h
accel/tcg/internal-target.h +1 -1
@@ -10,7 +10,7 @@#define ACCEL_TCG_INTERNAL_TARGET_H #include "exec/exec-all.h" -#include "exec/translate-all.h" +#include "tb-internal.h" /* * Access to the various translations structures need to be serialised
accel/tcg/tb-internal.h new file +14 -0
@@ -0,0 +1,14 @@ +/* +* TranslationBlock internal declarations (target specific) +* +* Copyright (c) 2003 Fabrice Bellard +* +* SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#ifndef ACCEL_TCG_TB_INTERNAL_TARGET_H +#define ACCEL_TCG_TB_INTERNAL_TARGET_H + +void tb_check_watchpoint (CPUState *cpu,uintptr_t retaddr); + +#endif
include/exec/translate-all.h deleted +0 -28
@@ -1,28 +0,0 @@ -/* -* Translated block handling -* -* Copyright (c) 2003 Fabrice Bellard -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, see <http://www.gnu.org/licenses/>. -*/ -#ifndef TRANSLATE_ALL_H -#define TRANSLATE_ALL_H - -#include "exec/exec-all.h" - - -/* translate-all.c */ -void tb_check_watchpoint (CPUState *cpu,uintptr_t retaddr); - -#endif /* TRANSLATE_ALL_H */
accel/tcg/cputlb.c +1 -1
@@ -37,7 +37,7 @@#include "exec/helper-proto-common.h" #include "qemu/atomic.h" #include "qemu/atomic128.h" -#include "exec/translate-all.h" +#include "tb-internal.h" #include "trace.h" #include "tb-hash.h" #include "internal-common.h"
accel/tcg/tb-maint.c +1 -1
@@ -25,7 +25,7 @@#include "exec/exec-all.h" #include "exec/page-protection.h" #include "exec/tb-flush.h" -#include "exec/translate-all.h" +#include "tb-internal.h" #include "system/tcg.h" #include "tcg/tcg.h" #include "tb-hash.h"
accel/tcg/translate-all.c +1 -1
@@ -45,7 +45,7 @@#include "exec/cputlb.h" #include "exec/page-protection.h" -#include "exec/translate-all.h" +#include "tb-internal.h" #include "exec/translator.h" #include "exec/tb-flush.h" #include "qemu/bitmap.h"
accel/tcg/user-exec.c +1 -0
@@ -33,6 +33,7 @@#include "tcg/tcg-ldst.h" #include "internal-common.h" #include "internal-target.h" +#include "tb-internal.h" __threaduintptr_t helper_retaddr;
accel/tcg/watchpoint.c +1 -1
@@ -21,8 +21,8 @@#include "qemu/main-loop.h" #include "qemu/error-report.h" #include "exec/exec-all.h" -#include "exec/translate-all.h" #include "exec/page-protection.h" +#include "tb-internal.h" #include "system/tcg.h" #include "system/replay.h" #include "hw/core/tcg-cpu-ops.h"
Signature · 1 line
2.45.2
Re: [PATCH 08/18] accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h'
Quoted 140 lines · Philippe Mathieu-Daudé
"
exec/translate-all.h" is only useful to TCG accelerator, so move it to accel/tcg/, after renaming it 'tb-internal.h'.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- accel/tcg/internal-target.h | 2 +- accel/tcg/tb-internal.h | 14 ++++++++++++++ include/exec/translate-all.h | 28 ---------------------------- accel/tcg/cputlb.c | 2 +- accel/tcg/tb-maint.c | 2 +- accel/tcg/translate-all.c | 2 +- accel/tcg/user-exec.c | 1 + accel/tcg/watchpoint.c | 2 +- 8 files changed, 20 insertions(+), 33 deletions(-)create mode 100644
accel/tcg/tb-internal.h
delete mode 100644include/exec/translate-all.haccel/tcg/internal-target.h +1
-1@@ -10,7 +10,7 @@#define ACCEL_TCG_INTERNAL_TARGET_H #include "exec/exec-all.h" -#include "exec/translate-all.h" +#include "tb-internal.h" /* * Access to the various translations structures need to be serialised accel/tcg/tb-internal.h new file +14
-0@@ -0,0 +1,14 @@ +/* +* TranslationBlock internal declarations (target specific) +* +* Copyright (c) 2003 Fabrice Bellard +* +* SPDX-License-Identifier: LGPL-2.1-or-later +*/ + +#ifndef ACCEL_TCG_TB_INTERNAL_TARGET_H +#define ACCEL_TCG_TB_INTERNAL_TARGET_H + +void tb_check_watchpoint (CPUState *cpu,uintptr_t retaddr); + +#endif include/exec/translate-all.h deleted +0
-28@@ -1,28 +0,0 @@ -/* -* Translated block handling -* -* Copyright (c) 2003 Fabrice Bellard -* -* This library is free software; you can redistribute it and/or -* modify it under the terms of the GNU Lesser General Public -* License as published by the Free Software Foundation; either -* version 2.1 of the License, or (at your option) any later version. -* -* This library is distributed in the hope that it will be useful, -* but WITHOUT ANY WARRANTY; without even the implied warranty of -* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -* Lesser General Public License for more details. -* -* You should have received a copy of the GNU Lesser General Public -* License along with this library; if not, see <http://www.gnu.org/licenses/>. -*/ -#ifndef TRANSLATE_ALL_H -#define TRANSLATE_ALL_H - -#include "exec/exec-all.h" - - -/* translate-all.c */ -void tb_check_watchpoint (CPUState *cpu,uintptr_t retaddr); - -#endif /* TRANSLATE_ALL_H */ accel/tcg/cputlb.c +1
-1@@ -37,7 +37,7 @@#include "exec/helper-proto-common.h" #include "qemu/atomic.h" #include "qemu/atomic128.h" -#include "exec/translate-all.h" +#include "tb-internal.h" #include "trace.h" #include "tb-hash.h" #include "internal-common.h" accel/tcg/tb-maint.c +1
-1@@ -25,7 +25,7 @@#include "exec/exec-all.h" #include "exec/page-protection.h" #include "exec/tb-flush.h" -#include "exec/translate-all.h" +#include "tb-internal.h" #include "system/tcg.h" #include "tcg/tcg.h" #include "tb-hash.h" accel/tcg/translate-all.c +1
-1@@ -45,7 +45,7 @@#include "exec/cputlb.h" #include "exec/page-protection.h" -#include "exec/translate-all.h" +#include "tb-internal.h" #include "exec/translator.h" #include "exec/tb-flush.h" #include "qemu/bitmap.h" accel/tcg/user-exec.c +1
-0@@ -33,6 +33,7 @@#include "tcg/tcg-ldst.h" #include "internal-common.h" #include "internal-target.h" +#include "tb-internal.h" __threaduintptr_t helper_retaddr;accel/tcg/watchpoint.c +0
-0
accel/tcg/watchpoint.c line 28
Quoted 9 lines
accel/tcg/watchpoint.c +1
-1@@ -21,8 +21,8 @@#include "qemu/main-loop.h" #include "qemu/error-report.h" #include "exec/exec-all.h" -#include "exec/translate-all.h" #include "exec/page-protection.h" +#include "tb-internal.h" #include "system/tcg.h" #include "system/replay.h" #include "hw/core/tcg-cpu-ops.h"
Re: [PATCH 08/18] accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h'
In reply to Philippe Mathieu-DaudéQuoted 14 lines · Philippe Mathieu-Daudé
"
exec/translate-all.h" is only useful to TCG accelerator, so move it to accel/tcg/, after renaming it 'tb-internal.h'.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- accel/tcg/internal-target.h | 2 +- accel/tcg/tb-internal.h | 14 ++++++++++++++ include/exec/translate-all.h | 28 ---------------------------- accel/tcg/cputlb.c | 2 +- accel/tcg/tb-maint.c | 2 +- accel/tcg/translate-all.c | 2 +- accel/tcg/user-exec.c | 1 + accel/tcg/watchpoint.c | 2 +- 8 files changed, 20 insertions(+), 33 deletions(-)
Quoted 2 lines
create mode 100644
accel/tcg/tb-internal.h
delete mode 100644include/exec/translate-all.h
Move it into accel/tcg/internal-common.h rather than create a new header.
r~
Re: [PATCH 08/18] accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h'
Quoted 18 lines · Richard Henderson
Quoted 13 lines · Philippe Mathieu-Daudé
"
exec/translate-all.h" is only useful to TCG accelerator, so move it to accel/tcg/, after renaming it 'tb-internal.h'.Signed-off-by Philippe Mathieu-Daudé <[email protected]>---
accel/tcg/internal-target.h | 2 +- accel/tcg/tb-internal.h | 14 ++++++++++++++include/exec/translate-all.h| 28 ---------------------------- accel/tcg/cputlb.c | 2 +- accel/tcg/tb-maint.c | 2 +- accel/tcg/translate-all.c | 2 +- accel/tcg/user-exec.c | 1 + accel/tcg/watchpoint.c | 2 +-Quoted 3 lines
8 files changed, 20 insertions(+), 33 deletions(-)create mode 100644
accel/tcg/tb-internal.h
delete mode 100644include/exec/translate-all.h
Quoted 1 line
Move it into
accel/tcg/internal-common.hrather than create a new header.
Hmm. Nevermind, I should have read to the end.
r~
PATCH 9/18 accel/tcg: Un-inline log_pc()
In reply to Philippe Mathieu-Daudélog_pc() is only used within cpu-exec.c, no need to expose it via "internal-target.h".
--- accel/tcg/internal-target.h | 10 ---------- accel/tcg/cpu-exec.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-)
accel/tcg/internal-target.h +0 -10
@@ -72,16 +72,6 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);bool tb_invalidate_phys_page_unwind (tb_page_addr_t addr,uintptr_t pc); -/* Return the current PC from CPU, which may be cached in TB. */ -static inline vaddr log_pc (CPUState *cpu,const TranslationBlock *tb) -{ -if (tb_cflags (tb) &CF_PCREL ) { -return cpu->cc->get_pc (cpu); - }else { -return tb->pc; - } -} -/** * tcg_req_mo: * @type: TCGBar
accel/tcg/cpu-exec.c +11 -0
@@ -21,6 +21,7 @@#include "qemu/qemu-print.h" #include "qapi/error.h" #include "qapi/type-helpers.h" +#include "hw/core/cpu.h" #include "hw/core/tcg-cpu-ops.h" #include "trace.h" #include "disas/disas.h"
@@ -434,6 +435,16 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env)return tb->tc.ptr; } +/* Return the current PC from CPU, which may be cached in TB. */ +static vaddr log_pc (CPUState *cpu,const TranslationBlock *tb) +{ +if (tb_cflags (tb) &CF_PCREL ) { +return cpu->cc->get_pc (cpu); + }else { +return tb->pc; + } +} +/* Execute a TB, and fix up the CPU state afterwards if necessary */ /* * Disable CFI checks.
Signature · 1 line
2.45.2
Re: [PATCH 09/18] accel/tcg: Un-inline log_pc()
Quoted 49 lines · Philippe Mathieu-Daudé
log_pc()is only used withincpu-exec.c, no need to expose it via "internal-target.h".Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- accel/tcg/internal-target.h | 10 ---------- accel/tcg/cpu-exec.c | 11 +++++++++++ 2 files changed, 11 insertions(+), 10 deletions(-)accel/tcg/internal-target.h +0
-10@@ -72,16 +72,6 @@ G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);bool tb_invalidate_phys_page_unwind (tb_page_addr_t addr,uintptr_t pc); -/* Return the current PC from CPU, which may be cached in TB. */ -static inline vaddr log_pc (CPUState *cpu,const TranslationBlock *tb) -{ -if (tb_cflags (tb) &CF_PCREL ) { -return cpu->cc->get_pc (cpu); - }else { -return tb->pc; - } -} -/** * tcg_req_mo: * @type: TCGBar accel/tcg/cpu-exec.c +4
-0@@ -21,6 +21,7 @@#include "qemu/qemu-print.h" #include "qapi/error.h" #include "qapi/type-helpers.h" +#include "hw/core/cpu.h" #include "hw/core/tcg-cpu-ops.h" #include "trace.h" #include "disas/disas.h" @@ -434,6 +435,16 @@ const void *HELPER(lookup_tb_ptr)(CPUArchState *env)return tb->tc.ptr; } +/* Return the current PC from CPU, which may be cached in TB. */ +static vaddr log_pc (CPUState *cpu,const TranslationBlock *tb) +{
accel/tcg/cpu-exec.c const void *HELPER(lookup_tb_ptr)(CPUArchState *env) · line 450
Quoted 10 lines
accel/tcg/cpu-exec.c +7
-0+if (tb_cflags (tb) &CF_PCREL ) { +return cpu->cc->get_pc (cpu); + }else { +return tb->pc; + } +} +/* Execute a TB, and fix up the CPU state afterwards if necessary */ /* * Disable CFI checks.
PATCH 10/18 accel/tcg: Move TranslationBlock declarations to 'tb-internal.h'
In reply to Philippe Mathieu-DaudéMove declarations related to TranslationBlock out of the generic "internal-target.h" to "tb-internal.h".
--- accel/tcg/internal-target.h | 32 ------------------------------ accel/tcg/tb-internal.h | 39 +++++++++++++++++++++++++++++++++++++ accel/tcg/cpu-exec.c | 1 + accel/tcg/cputlb.c | 1 + accel/tcg/tb-maint.c | 1 + accel/tcg/translate-all.c | 1 + accel/tcg/translator.c | 1 + 7 files changed, 44 insertions(+), 32 deletions(-)
accel/tcg/internal-target.h +0 -32
@@ -36,42 +36,10 @@ static inline void page_table_config_init(void) { }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 -* account for other TBs on the same page, defer undoing any page protection -* until we receive the write fault. -*/ -static inline void tb_lock_page0 (tb_page_addr_t p0) -{ -page_protect (p0); -} - -static inline void tb_lock_page1 (tb_page_addr_t p0,tb_page_addr_t p1) -{ -page_protect (p1); -} - -static inline void tb_unlock_page1 (tb_page_addr_t p0,tb_page_addr_t p1) { } -static inline void tb_unlock_pages (TranslationBlock *tb) { } -#else -void tb_lock_page0 (tb_page_addr_t ); -void tb_lock_page1 (tb_page_addr_t ,tb_page_addr_t ); -void tb_unlock_page1 (tb_page_addr_t ,tb_page_addr_t ); -void tb_unlock_pages (TranslationBlock *); -#endif -#ifdef CONFIG_SOFTMMU -void tb_invalidate_phys_range_fast (ram_addr_t ram_addr, -unsigned size, -uintptr_t retaddr); G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);#endif /* CONFIG_SOFTMMU */ -bool tb_invalidate_phys_page_unwind (tb_page_addr_t addr,uintptr_t pc); -/** * tcg_req_mo: * @type: TCGBar
accel/tcg/tb-internal.h +39 -0
@@ -9,6 +9,45 @@#ifndef ACCEL_TCG_TB_INTERNAL_TARGET_H #define ACCEL_TCG_TB_INTERNAL_TARGET_H +#include "exec/cpu-all.h" +#include "exec/exec-all.h" +#include "exec/translation-block.h" + +#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 +* account for other TBs on the same page, defer undoing any page protection +* until we receive the write fault. +*/ +static inline void tb_lock_page0 (tb_page_addr_t p0) +{ +page_protect (p0); +} + +static inline void tb_lock_page1 (tb_page_addr_t p0,tb_page_addr_t p1) +{ +page_protect (p1); +} + +static inline void tb_unlock_page1 (tb_page_addr_t p0,tb_page_addr_t p1) { } +static inline void tb_unlock_pages (TranslationBlock *tb) { } +#else +void tb_lock_page0 (tb_page_addr_t ); +void tb_lock_page1 (tb_page_addr_t ,tb_page_addr_t ); +void tb_unlock_page1 (tb_page_addr_t ,tb_page_addr_t ); +void tb_unlock_pages (TranslationBlock *); +#endif + +#ifdef CONFIG_SOFTMMU +void tb_invalidate_phys_range_fast (ram_addr_t ram_addr, +unsigned size, +uintptr_t retaddr); +#endif /* CONFIG_SOFTMMU */ + +bool tb_invalidate_phys_page_unwind (tb_page_addr_t addr,uintptr_t pc); +void tb_check_watchpoint (CPUState *cpu,uintptr_t retaddr);#endif
accel/tcg/cpu-exec.c +1 -0
@@ -41,6 +41,7 @@#include "tb-jmp-cache.h" #include "tb-hash.h" #include "tb-context.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h"
accel/tcg/cputlb.c +1 -0
@@ -40,6 +40,7 @@#include "tb-internal.h" #include "trace.h" #include "tb-hash.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" #ifdef CONFIG_PLUGIN
accel/tcg/tb-maint.c +1 -0
@@ -30,6 +30,7 @@#include "tcg/tcg.h" #include "tb-hash.h" #include "tb-context.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h"
accel/tcg/translate-all.c +1 -0
@@ -62,6 +62,7 @@#include "tb-jmp-cache.h" #include "tb-hash.h" #include "tb-context.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" #include "tcg/perf.h"
accel/tcg/translator.c +1 -0
@@ -19,6 +19,7 @@#include "tcg/tcg-op-common.h" #include "internal-target.h" #include "disas/disas.h" +#include "tb-internal.h" static void set_can_do_io (DisasContextBase *db,bool val) {
Signature · 1 line
2.45.2
Re: [PATCH 10/18] accel/tcg: Move TranslationBlock declarations to 'tb-internal.h'
Quoted 164 lines · Philippe Mathieu-Daudé
Move declarations related to TranslationBlock out of the generic "
internal-target.h" to "tb-internal.h".Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- accel/tcg/internal-target.h | 32 ------------------------------ accel/tcg/tb-internal.h | 39 +++++++++++++++++++++++++++++++++++++ accel/tcg/cpu-exec.c | 1 + accel/tcg/cputlb.c | 1 + accel/tcg/tb-maint.c | 1 + accel/tcg/translate-all.c | 1 + accel/tcg/translator.c | 1 + 7 files changed, 44 insertions(+), 32 deletions(-)accel/tcg/internal-target.h +0
-32@@ -36,42 +36,10 @@ static inline void page_table_config_init(void) { }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 -* account for other TBs on the same page, defer undoing any page protection -* until we receive the write fault. -*/ -static inline void tb_lock_page0 (tb_page_addr_t p0) -{ -page_protect (p0); -} - -static inline void tb_lock_page1 (tb_page_addr_t p0,tb_page_addr_t p1) -{ -page_protect (p1); -} - -static inline void tb_unlock_page1 (tb_page_addr_t p0,tb_page_addr_t p1) { } -static inline void tb_unlock_pages (TranslationBlock *tb) { } -#else -void tb_lock_page0 (tb_page_addr_t ); -void tb_lock_page1 (tb_page_addr_t ,tb_page_addr_t ); -void tb_unlock_page1 (tb_page_addr_t ,tb_page_addr_t ); -void tb_unlock_pages (TranslationBlock *); -#endif -#ifdef CONFIG_SOFTMMU -void tb_invalidate_phys_range_fast (ram_addr_t ram_addr, -unsigned size, -uintptr_t retaddr); G_NORETURN void cpu_io_recompile(CPUState *cpu, uintptr_t retaddr);#endif /* CONFIG_SOFTMMU */ -bool tb_invalidate_phys_page_unwind (tb_page_addr_t addr,uintptr_t pc); -/** * tcg_req_mo: * @type: TCGBar accel/tcg/tb-internal.h +39
-0@@ -9,6 +9,45 @@#ifndef ACCEL_TCG_TB_INTERNAL_TARGET_H #define ACCEL_TCG_TB_INTERNAL_TARGET_H +#include "exec/cpu-all.h" +#include "exec/exec-all.h" +#include "exec/translation-block.h" + +#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 +* account for other TBs on the same page, defer undoing any page protection +* until we receive the write fault. +*/ +static inline void tb_lock_page0 (tb_page_addr_t p0) +{ +page_protect (p0); +} + +static inline void tb_lock_page1 (tb_page_addr_t p0,tb_page_addr_t p1) +{ +page_protect (p1); +} + +static inline void tb_unlock_page1 (tb_page_addr_t p0,tb_page_addr_t p1) { } +static inline void tb_unlock_pages (TranslationBlock *tb) { } +#else +void tb_lock_page0 (tb_page_addr_t ); +void tb_lock_page1 (tb_page_addr_t ,tb_page_addr_t ); +void tb_unlock_page1 (tb_page_addr_t ,tb_page_addr_t ); +void tb_unlock_pages (TranslationBlock *); +#endif + +#ifdef CONFIG_SOFTMMU +void tb_invalidate_phys_range_fast (ram_addr_t ram_addr, +unsigned size, +uintptr_t retaddr); +#endif /* CONFIG_SOFTMMU */ + +bool tb_invalidate_phys_page_unwind (tb_page_addr_t addr,uintptr_t pc); +void tb_check_watchpoint (CPUState *cpu,uintptr_t retaddr);#endif accel/tcg/cpu-exec.c +1
-0@@ -41,6 +41,7 @@#include "tb-jmp-cache.h" #include "tb-hash.h" #include "tb-context.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" accel/tcg/cputlb.c +1
-0@@ -40,6 +40,7 @@#include "tb-internal.h" #include "trace.h" #include "tb-hash.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" #ifdef CONFIG_PLUGIN accel/tcg/tb-maint.c +1
-0@@ -30,6 +30,7 @@#include "tcg/tcg.h" #include "tb-hash.h" #include "tb-context.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" accel/tcg/translate-all.c +1
-0@@ -62,6 +62,7 @@#include "tb-jmp-cache.h" #include "tb-hash.h" #include "tb-context.h" +#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" #include "tcg/perf.h" accel/tcg/translator.c +0
-0
accel/tcg/translator.c line 25
Quoted 7 lines
accel/tcg/translator.c +1
-0@@ -19,6 +19,7 @@#include "tcg/tcg-op-common.h" #include "internal-target.h" #include "disas/disas.h" +#include "tb-internal.h" static void set_can_do_io (DisasContextBase *db,bool val) {
PATCH 11/18 accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (1/4)
In reply to Philippe Mathieu-DaudéMove declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h".
--- include/exec/cpu-all.h | 5 ----- include/user/page-protection.h | 8 ++++++++ bsd-user/main.c | 1 + bsd-user/mmap.c | 1 + linux-user/main.c | 1 + linux-user/mmap.c | 1 + linux-user/syscall.c | 1 + 7 files changed, 13 insertions(+), 5 deletions(-)
include/exec/cpu-all.h +0 -5
@@ -127,11 +127,6 @@ extern const TargetPageBits target_page;#define TARGET_PAGE_ALIGN (addr) ROUND_UP((addr), TARGET_PAGE_SIZE)#if defined(CONFIG_USER_ONLY ) -void page_dump (FILE *f); - -typedef int (*walk_memory_regions_fn )(void *,target_ulong , -target_ulong ,unsigned long ); -int walk_memory_regions (void *,walk_memory_regions_fn );int page_get_flags (target_ulong address);
include/user/page-protection.h +8 -0
@@ -12,9 +12,17 @@#error Cannot include this header from system emulation#endif +#include "cpu-param.h" +#include "exec/target_long.h" #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); +typedef int (*walk_memory_regions_fn )(void *,target_ulong , +target_ulong ,unsigned long ); + +int walk_memory_regions (void *,walk_memory_regions_fn ); + +void page_dump (FILE *f);#endif
bsd-user/main.c +1 -0
@@ -38,6 +38,7 @@#include "qemu/plugin.h" #include "exec/exec-all.h" #include "user/guest-base.h" +#include "user/page-protection.h" #include "tcg/startup.h" #include "qemu/timer.h" #include "qemu/envlist.h"
bsd-user/mmap.c +1 -0
@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" #include "exec/page-protection.h" +#include "user/page-protection.h" #include "qemu.h"
linux-user/main.c +1 -0
@@ -39,6 +39,7 @@#include "qemu/module.h" #include "qemu/plugin.h" #include "user/guest-base.h" +#include "user/page-protection.h" #include "exec/exec-all.h" #include "exec/gdbstub.h" #include "gdbstub/user.h"
linux-user/mmap.c +1 -0
@@ -22,6 +22,7 @@#include "exec/log.h" #include "exec/page-protection.h" #include "qemu.h" +#include "user/page-protection.h" #include "user-internals.h" #include "user-mmap.h" #include "target_mman.h"
linux-user/syscall.c +1 -0
@@ -135,6 +135,7 @@#include "signal-common.h" #include "loader.h" #include "user-mmap.h" +#include "user/page-protection.h" #include "user/safe-syscall.h" #include "qemu/guest-random.h" #include "qemu/selfmap.h"
Signature · 1 line
2.45.2
Re: [PATCH 11/18] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (1/4)
Quoted 105 lines · Philippe Mathieu-Daudé
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é <[email protected]>--- include/exec/cpu-all.h | 5 ----- include/user/page-protection.h | 8 ++++++++ bsd-user/main.c | 1 + bsd-user/mmap.c | 1 + linux-user/main.c | 1 + linux-user/mmap.c | 1 + linux-user/syscall.c | 1 + 7 files changed, 13 insertions(+), 5 deletions(-)include/exec/cpu-all.h +0
-5@@ -127,11 +127,6 @@ extern const TargetPageBits target_page;#define TARGET_PAGE_ALIGN (addr) ROUND_UP((addr), TARGET_PAGE_SIZE)#if defined(CONFIG_USER_ONLY ) -void page_dump (FILE *f); - -typedef int (*walk_memory_regions_fn )(void *,target_ulong , -target_ulong ,unsigned long ); -int walk_memory_regions (void *,walk_memory_regions_fn );int page_get_flags (target_ulong address);include/user/page-protection.h +8
-0@@ -12,9 +12,17 @@#error Cannot include this header from system emulation#endif +#include "cpu-param.h" +#include "exec/target_long.h" #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); +typedef int (*walk_memory_regions_fn )(void *,target_ulong , +target_ulong ,unsigned long ); + +int walk_memory_regions (void *,walk_memory_regions_fn ); + +void page_dump (FILE *f);#endif bsd-user/main.c +1
-0@@ -38,6 +38,7 @@#include "qemu/plugin.h" #include "exec/exec-all.h" #include "user/guest-base.h" +#include "user/page-protection.h" #include "tcg/startup.h" #include "qemu/timer.h" #include "qemu/envlist.h" bsd-user/mmap.c +1
-0@@ -18,6 +18,7 @@*/ #include "qemu/osdep.h" #include "exec/page-protection.h" +#include "user/page-protection.h" #include "qemu.h" linux-user/main.c +1
-0@@ -39,6 +39,7 @@#include "qemu/module.h" #include "qemu/plugin.h" #include "user/guest-base.h" +#include "user/page-protection.h" #include "exec/exec-all.h" #include "exec/gdbstub.h" #include "gdbstub/user.h" linux-user/mmap.c +1
-0@@ -22,6 +22,7 @@#include "exec/log.h" #include "exec/page-protection.h" #include "qemu.h" +#include "user/page-protection.h" #include "user-internals.h" #include "user-mmap.h" #include "target_mman.h" linux-user/syscall.c +0
-0
linux-user/syscall.c line 141
Quoted 7 lines
linux-user/syscall.c +1
-0@@ -135,6 +135,7 @@#include "signal-common.h" #include "loader.h" #include "user-mmap.h" +#include "user/page-protection.h" #include "user/safe-syscall.h" #include "qemu/guest-random.h" #include "qemu/selfmap.h"
PATCH 12/18 accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (2/4)
In reply to Philippe Mathieu-DaudéMove declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h".
--- bsd-user/bsd-mem.h | 1 + include/exec/cpu-all.h | 55 -------------------------------- include/user/page-protection.h | 57 ++++++++++++++++++++++++++++++++++ target/arm/tcg/mte_helper.c | 3 ++ 4 files changed, 61 insertions(+), 55 deletions(-)
bsd-user/bsd-mem.h +1 -0
@@ -57,6 +57,7 @@#include "qemu-bsd.h" #include "exec/page-protection.h" +#include "user/page-protection.h" extern struct bsd_shm_regions bsd_shm_regions[];extern abi_ulong target_brk;
include/exec/cpu-all.h +0 -55
67 lines not on this page · raw message
include/user/page-protection.h +57 -0
63 lines not on this page · raw message
target/arm/tcg/mte_helper.c +3 -0
@@ -23,6 +23,9 @@#include "internals.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif #include "exec/ram_addr.h" #include "exec/cpu_ldst.h" #include "exec/helper-proto.h"
Signature · 1 line
2.45.2
Re: [PATCH 12/18] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (2/4)
Quoted 169 lines · Philippe Mathieu-Daudé
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é <[email protected]>--- bsd-user/bsd-mem.h | 1 + include/exec/cpu-all.h | 55 -------------------------------- include/user/page-protection.h | 57 ++++++++++++++++++++++++++++++++++ target/arm/tcg/mte_helper.c | 3 ++ 4 files changed, 61 insertions(+), 55 deletions(-)bsd-user/bsd-mem.h +1
-0@@ -57,6 +57,7 @@#include "qemu-bsd.h" #include "exec/page-protection.h" +#include "user/page-protection.h" extern struct bsd_shm_regions bsd_shm_regions[];extern abi_ulong target_brk;include/exec/cpu-all.h +0
-55@@ -130,21 +130,6 @@ extern const TargetPageBits target_page;int page_get_flags (target_ulong address); -/** -* page_set_flags: -* @start: first byte of range -* @last: last byte of range -* @flags: flags to set -* Context: holding mmap lock -* -* Modify the flags of a page and invalidate the code if necessary. -* The flag PAGE_WRITE_ORG is positioned automatically depending -* on PAGE_WRITE. The mmap_lock should already be held. -*/ -void page_set_flags (target_ulong start,target_ulong last,int flags); - -void page_reset_target_data (target_ulong start,target_ulong last); -/** * page_check_range * @start: first byte of range @@ -157,46 +142,6 @@ void page_reset_target_data(target_ulong start, target_ulong last);*/ bool page_check_range (target_ulong start,target_ulong last,int flags); -/** -* page_check_range_empty: -* @start: first byte of range -* @last: last byte of range -* Context: holding mmap lock -* -* Return true if the entire range [@start, @last] is unmapped. -* The memory lock must be held so that the caller will can ensure -* the result stays true until a new mapping can be installed. -*/ -bool page_check_range_empty (target_ulong start,target_ulong last); - -/** -* page_find_range_empty -* @min: first byte of search range -* @max: last byte of search range -* @len: size of the hole required -* @align: alignment of the hole required (power of 2) -* -* If there is a range [x, x+@len) within [@min, @max] such that -* x % @align == 0, then return x. Otherwise return -1. -* The memory lock must be held, as the caller will want to ensure -* the returned range stays empty until a new mapping can be installed. -*/ -target_ulong page_find_range_empty (target_ulong min,target_ulong max, -target_ulong len,target_ulong align); - -/** -* page_get_target_data(address) -* @address: guest virtual address -* -* Return TARGET_PAGE_DATA_SIZE bytes of out-of-band data to associate -* with the guest page at @address, allocating it if necessary. The -* caller should already have verified that the address is valid. -* -* The memory will be freed when the guest page is deallocated, -* e.g. with the munmap system call. -*/ -void *page_get_target_data (target_ulong address) - __attribute__((returns_nonnull));#endif CPUArchState *cpu_copy (CPUArchState *env);include/user/page-protection.h +57
-0@@ -18,6 +18,63 @@void page_protect (tb_page_addr_t page_addr);int page_unprotect (tb_page_addr_t address,uintptr_t pc); + +/** +* page_set_flags: +* @start: first byte of range +* @last: last byte of range +* @flags: flags to set +* Context: holding mmap lock +* +* Modify the flags of a page and invalidate the code if necessary. +* The flag PAGE_WRITE_ORG is positioned automatically depending +* on PAGE_WRITE. The mmap_lock should already be held. +*/ +void page_set_flags (target_ulong start,target_ulong last,int flags); + +void page_reset_target_data (target_ulong start,target_ulong last); + +/** +* page_check_range_empty: +* @start: first byte of range +* @last: last byte of range +* Context: holding mmap lock +* +* Return true if the entire range [@start, @last] is unmapped. +* The memory lock must be held so that the caller will can ensure +* the result stays true until a new mapping can be installed. +*/ +bool page_check_range_empty (target_ulong start,target_ulong last); + +/** +* page_find_range_empty +* @min: first byte of search range +* @max: last byte of search range +* @len: size of the hole required +* @align: alignment of the hole required (power of 2) +* +* If there is a range [x, x+@len) within [@min, @max] such that +* x % @align == 0, then return x. Otherwise return -1. +* The memory lock must be held, as the caller will want to ensure +* the returned range stays empty until a new mapping can be installed. +*/ +target_ulong page_find_range_empty (target_ulong min,target_ulong max, +target_ulong len,target_ulong align); + +/** +* page_get_target_data(address) +* @address: guest virtual address +* +* Return TARGET_PAGE_DATA_SIZE bytes of out-of-band data to associate +* with the guest page at @address, allocating it if necessary. The +* caller should already have verified that the address is valid. +* +* The memory will be freed when the guest page is deallocated, +* e.g. with the munmap system call. +*/ +__attribute__((returns_nonnull)) +void *page_get_target_data (target_ulong address); +typedef int (*walk_memory_regions_fn )(void *,target_ulong ,target_ulong ,unsigned long );target/arm/tcg/mte_helper.c +0
-0
target/arm/tcg/mte_helper.c line 31
Quoted 9 lines
target/arm/tcg/mte_helper.c +3
-0@@ -23,6 +23,9 @@#include "internals.h" #include "exec/exec-all.h" #include "exec/page-protection.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif #include "exec/ram_addr.h" #include "exec/cpu_ldst.h" #include "exec/helper-proto.h"
PATCH 13/18 accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (3/4)
In reply to Philippe Mathieu-DaudéMove declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h".
--- bsd-user/qemu.h | 1 + include/exec/cpu-all.h | 12 ------------ include/user/page-protection.h | 12 ++++++++++++ linux-user/qemu.h | 1 + target/arm/tcg/sve_helper.c | 3 +++ target/hppa/op_helper.c | 3 +++ target/sparc/ldst_helper.c | 3 +++ 7 files changed, 23 insertions(+), 12 deletions(-)
bsd-user/qemu.h +1 -0
@@ -26,6 +26,7 @@#include "exec/exec-all.h" #include "user/abitypes.h" +#include "user/page-protection.h" extern char **environ;
include/exec/cpu-all.h +0 -12
@@ -130,18 +130,6 @@ extern const TargetPageBits target_page;int page_get_flags (target_ulong address); -/** -* page_check_range -* @start: first byte of range -* @len: length of range -* @flags: flags required for each page -* -* Return true if every page in [@start, @start+@len) has @flags set. -* Return false if any page is unmapped. Thus testing flags == 0 is -* equivalent to testing for flags == PAGE_VALID. -*/ -bool page_check_range (target_ulong start,target_ulong last,int flags); -#endif CPUArchState *cpu_copy (CPUArchState *env);
include/user/page-protection.h +12 -0
@@ -34,6 +34,18 @@ void page_set_flags(target_ulong start, target_ulong last, int flags);void page_reset_target_data (target_ulong start,target_ulong last); +/** +* page_check_range +* @start: first byte of range +* @len: length of range +* @flags: flags required for each page +* +* Return true if every page in [@start, @start+@len) has @flags set. +* Return false if any page is unmapped. Thus testing flags == 0 is +* equivalent to testing for flags == PAGE_VALID. +*/ +bool page_check_range (target_ulong start,target_ulong last,int flags); +/** * page_check_range_empty: * @start: first byte of range
linux-user/qemu.h +1 -0
@@ -5,6 +5,7 @@#include "exec/cpu_ldst.h" #include "user/abitypes.h" +#include "user/page-protection.h" #include "syscall_defs.h" #include "target_syscall.h"
target/arm/tcg/sve_helper.c +3 -0
@@ -29,6 +29,9 @@#include "vec_internal.h" #include "sve_ldst_internal.h" #include "hw/core/tcg-cpu-ops.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif /* Return a value for NZCV as per the ARM PredTest pseudofunction.
target/hppa/op_helper.c +3 -0
@@ -25,6 +25,9 @@#include "exec/cpu_ldst.h" #include "qemu/timer.h" #include "trace.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif G_NORETURN void HELPER(excp)(CPUHPPAState *env, int excp) {
target/sparc/ldst_helper.c +3 -0
@@ -26,6 +26,9 @@#include "exec/exec-all.h" #include "exec/page-protection.h" #include "exec/cpu_ldst.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif #include "asi.h" //#define DEBUG_MMU
Signature · 1 line
2.45.2
Re: [PATCH 13/18] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (3/4)
Quoted 117 lines · Philippe Mathieu-Daudé
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é <[email protected]>--- bsd-user/qemu.h | 1 + include/exec/cpu-all.h | 12 ------------ include/user/page-protection.h | 12 ++++++++++++ linux-user/qemu.h | 1 + target/arm/tcg/sve_helper.c | 3 +++ target/hppa/op_helper.c | 3 +++ target/sparc/ldst_helper.c | 3 +++ 7 files changed, 23 insertions(+), 12 deletions(-)bsd-user/qemu.h +1
-0@@ -26,6 +26,7 @@#include "exec/exec-all.h" #include "user/abitypes.h" +#include "user/page-protection.h" extern char **environ;include/exec/cpu-all.h +0
-12@@ -130,18 +130,6 @@ extern const TargetPageBits target_page;int page_get_flags (target_ulong address); -/** -* page_check_range -* @start: first byte of range -* @len: length of range -* @flags: flags required for each page -* -* Return true if every page in [@start, @start+@len) has @flags set. -* Return false if any page is unmapped. Thus testing flags == 0 is -* equivalent to testing for flags == PAGE_VALID. -*/ -bool page_check_range (target_ulong start,target_ulong last,int flags); -#endif CPUArchState *cpu_copy (CPUArchState *env);include/user/page-protection.h +12
-0@@ -34,6 +34,18 @@ void page_set_flags(target_ulong start, target_ulong last, int flags);void page_reset_target_data (target_ulong start,target_ulong last); +/** +* page_check_range +* @start: first byte of range +* @len: length of range +* @flags: flags required for each page +* +* Return true if every page in [@start, @start+@len) has @flags set. +* Return false if any page is unmapped. Thus testing flags == 0 is +* equivalent to testing for flags == PAGE_VALID. +*/ +bool page_check_range (target_ulong start,target_ulong last,int flags); +/** * page_check_range_empty: * @start: first byte of range linux-user/qemu.h +1
-0@@ -5,6 +5,7 @@#include "exec/cpu_ldst.h" #include "user/abitypes.h" +#include "user/page-protection.h" #include "syscall_defs.h" #include "target_syscall.h" target/arm/tcg/sve_helper.c +3
-0@@ -29,6 +29,9 @@#include "vec_internal.h" #include "sve_ldst_internal.h" #include "hw/core/tcg-cpu-ops.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif /* Return a value for NZCV as per the ARM PredTest pseudofunction. target/hppa/op_helper.c +3
-0@@ -25,6 +25,9 @@#include "exec/cpu_ldst.h" #include "qemu/timer.h" #include "trace.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif G_NORETURN void HELPER(excp)(CPUHPPAState *env, int excp) {target/sparc/ldst_helper.c +0
-0
target/sparc/ldst_helper.c line 34
Quoted 9 lines
target/sparc/ldst_helper.c +3
-0@@ -26,6 +26,9 @@#include "exec/exec-all.h" #include "exec/page-protection.h" #include "exec/cpu_ldst.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif #include "asi.h" //#define DEBUG_MMU
PATCH 14/18 accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4)
In reply to Philippe Mathieu-DaudéMove declarations related to page protection under user emulation from "exec/cpu-all.h" to "user/page-protection.h".
--- include/exec/cpu-all.h | 6 ------ include/user/page-protection.h | 2 ++ accel/tcg/tb-maint.c | 3 +++ bsd-user/signal.c | 1 + cpu-target.c | 1 + linux-user/arm/cpu_loop.c | 1 + linux-user/signal.c | 1 + target/arm/tcg/helper-a64.c | 3 +++ target/s390x/tcg/mem_helper.c | 4 +++- 9 files changed, 15 insertions(+), 7 deletions(-)
include/exec/cpu-all.h +0 -6
@@ -126,12 +126,6 @@ extern const TargetPageBits target_page;#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);/* Flags for use in ENV->INTERRUPT_PENDING.
include/user/page-protection.h +2 -0
@@ -19,6 +19,8 @@void page_protect (tb_page_addr_t page_addr);int page_unprotect (tb_page_addr_t address,uintptr_t pc); +int page_get_flags (target_ulong address); +/** * page_set_flags: * @start: first byte of range
accel/tcg/tb-maint.c +3 -0
@@ -33,6 +33,9 @@#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif /* List iterators for lists of tagged pointers in TranslationBlock. */
bsd-user/signal.c +1 -0
@@ -22,6 +22,7 @@#include "qemu/log.h" #include "qemu.h" #include "exec/page-protection.h" +#include "user/page-protection.h" #include "user/tswap-target.h" #include "gdbstub/user.h" #include "signal-common.h"
cpu-target.c +1 -0
@@ -29,6 +29,7 @@#include "migration/vmstate.h" #ifdef CONFIG_USER_ONLY #include "qemu.h" +#include "user/page-protection.h" #else #include "hw/core/sysemu-cpu-ops.h" #include "exec/address-spaces.h"
linux-user/arm/cpu_loop.c +1 -0
@@ -25,6 +25,7 @@#include "signal-common.h" #include "semihosting/common-semi.h" #include "exec/page-protection.h" +#include "user/page-protection.h" #include "target/arm/syndrome.h" #define get_user_code_u32 (x, gaddr, env) \
linux-user/signal.c +1 -0
@@ -33,6 +33,7 @@#include "trace.h" #include "signal-common.h" #include "host-signal.h" +#include "user/page-protection.h" #include "user/safe-syscall.h" #include "tcg/tcg.h"
target/arm/tcg/helper-a64.c +3 -0
@@ -34,6 +34,9 @@#include "qemu/atomic128.h" #include "fpu/softfloat.h" #include <zlib.h> /* for crc32 */ +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif /* C2.4.7 Multiply and divide */ /* special cases for 0 and LLONG_MIN are mandated by the standard */
target/s390x/tcg/mem_helper.c +3 -1
@@ -31,7 +31,9 @@#include "qemu/int128.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/boards.h" #endif
Signature · 1 line
2.45.2
Re: [PATCH 14/18] accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4)
Quoted 127 lines · Philippe Mathieu-Daudé
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é <[email protected]>--- include/exec/cpu-all.h | 6 ------ include/user/page-protection.h | 2 ++ accel/tcg/tb-maint.c | 3 +++ bsd-user/signal.c | 1 + cpu-target.c | 1 + linux-user/arm/cpu_loop.c | 1 + linux-user/signal.c | 1 + target/arm/tcg/helper-a64.c | 3 +++ target/s390x/tcg/mem_helper.c | 4 +++- 9 files changed, 15 insertions(+), 7 deletions(-)include/exec/cpu-all.h +0
-6@@ -126,12 +126,6 @@ extern const TargetPageBits target_page;#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);/* Flags for use in ENV->INTERRUPT_PENDING. include/user/page-protection.h +2
-0@@ -19,6 +19,8 @@void page_protect (tb_page_addr_t page_addr);int page_unprotect (tb_page_addr_t address,uintptr_t pc); +int page_get_flags (target_ulong address); +/** * page_set_flags: * @start: first byte of range accel/tcg/tb-maint.c +3
-0@@ -33,6 +33,9 @@#include "tb-internal.h" #include "internal-common.h" #include "internal-target.h" +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif /* List iterators for lists of tagged pointers in TranslationBlock. */ bsd-user/signal.c +1
-0@@ -22,6 +22,7 @@#include "qemu/log.h" #include "qemu.h" #include "exec/page-protection.h" +#include "user/page-protection.h" #include "user/tswap-target.h" #include "gdbstub/user.h" #include "signal-common.h" cpu-target.c +1
-0@@ -29,6 +29,7 @@#include "migration/vmstate.h" #ifdef CONFIG_USER_ONLY #include "qemu.h" +#include "user/page-protection.h" #else #include "hw/core/sysemu-cpu-ops.h" #include "exec/address-spaces.h" linux-user/arm/cpu_loop.c +1
-0@@ -25,6 +25,7 @@#include "signal-common.h" #include "semihosting/common-semi.h" #include "exec/page-protection.h" +#include "user/page-protection.h" #include "target/arm/syndrome.h" #define get_user_code_u32 (x, gaddr, env) \linux-user/signal.c +1
-0@@ -33,6 +33,7 @@#include "trace.h" #include "signal-common.h" #include "host-signal.h" +#include "user/page-protection.h" #include "user/safe-syscall.h" #include "tcg/tcg.h" target/arm/tcg/helper-a64.c +3
-0@@ -34,6 +34,9 @@#include "qemu/atomic128.h" #include "fpu/softfloat.h" #include <zlib.h> /* for crc32 */ +#ifdef CONFIG_USER_ONLY +#include "user/page-protection.h" +#endif /* C2.4.7 Multiply and divide */ /* special cases for 0 and LLONG_MIN are mandated by the standard */ target/s390x/tcg/mem_helper.c +0
-0
target/s390x/tcg/mem_helper.c line 39
Quoted 10 lines
target/s390x/tcg/mem_helper.c +3
-1@@ -31,7 +31,9 @@#include "qemu/int128.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/boards.h" #endif
PATCH 15/18 user: Forward declare target_cpu_copy_regs structure
In reply to Philippe Mathieu-Daudé--- linux-user/cpu_loop-common.h | 5 ++++- linux-user/aarch64/cpu_loop.c | 2 +- linux-user/alpha/cpu_loop.c | 2 +- linux-user/arm/cpu_loop.c | 2 +- linux-user/hexagon/cpu_loop.c | 2 +- linux-user/hppa/cpu_loop.c | 2 +- linux-user/i386/cpu_loop.c | 2 +- linux-user/loongarch64/cpu_loop.c | 2 +- linux-user/m68k/cpu_loop.c | 2 +- linux-user/microblaze/cpu_loop.c | 2 +- linux-user/mips/cpu_loop.c | 2 +- linux-user/openrisc/cpu_loop.c | 2 +- linux-user/ppc/cpu_loop.c | 2 +- linux-user/riscv/cpu_loop.c | 2 +- linux-user/s390x/cpu_loop.c | 2 +- linux-user/sh4/cpu_loop.c | 2 +- linux-user/sparc/cpu_loop.c | 2 +- linux-user/xtensa/cpu_loop.c | 2 +- 18 files changed, 21 insertions(+), 18 deletions(-)
linux-user/cpu_loop-common.h +4 -1
@@ -27,5 +27,8 @@ void target_exception_dump(CPUArchState *env, const char *fmt, int code);#define EXCP_DUMP (env, fmt, code) \ target_exception_dump(env, fmt, code) -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs); +typedef struct target_pt_regs target_pt_regs ; + +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs); +#endif
linux-user/aarch64/cpu_loop.c +1 -1
@@ -185,7 +185,7 @@ void cpu_loop(CPUARMState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {ARMCPU *cpu =env_archcpu (env);CPUState *cs =env_cpu (env);
linux-user/alpha/cpu_loop.c +1 -1
@@ -173,7 +173,7 @@ void cpu_loop(CPUAlphaState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;
linux-user/arm/cpu_loop.c +1 -1
@@ -513,7 +513,7 @@ void cpu_loop(CPUARMState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {CPUState *cpu =env_cpu (env);TaskState *ts =get_task_state (cpu);
linux-user/hexagon/cpu_loop.c +1 -1
@@ -79,7 +79,7 @@ void cpu_loop(CPUHexagonState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) { env->gpr[HEX_REG_PC ] = regs->sepc; env->gpr[HEX_REG_SP ] = regs->sp;
linux-user/hppa/cpu_loop.c +1 -1
@@ -188,7 +188,7 @@ void cpu_loop(CPUHPPAState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;for (i =1 ; i <32 ; i++) {
linux-user/i386/cpu_loop.c +1 -1
@@ -331,7 +331,7 @@ static void target_cpu_free(void *obj)g_free (obj); } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {CPUState *cpu =env_cpu (env);bool is64 = (env->features[FEAT_8000_0001_EDX ] &CPUID_EXT2_LM ) !=0 ;
linux-user/loongarch64/cpu_loop.c +1 -1
@@ -97,7 +97,7 @@ void cpu_loop(CPULoongArchState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;
linux-user/m68k/cpu_loop.c +1 -1
@@ -92,7 +92,7 @@ void cpu_loop(CPUM68KState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {CPUState *cpu =env_cpu (env);TaskState *ts =get_task_state (cpu);
linux-user/microblaze/cpu_loop.c +1 -1
@@ -127,7 +127,7 @@ void cpu_loop(CPUMBState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) { env->regs[0 ] = regs->r0; env->regs[1 ] = regs->r1;
linux-user/mips/cpu_loop.c +1 -1
@@ -211,7 +211,7 @@ done_syscall: } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {CPUState *cpu =env_cpu (env);TaskState *ts =get_task_state (cpu);
linux-user/openrisc/cpu_loop.c +1 -1
@@ -83,7 +83,7 @@ void cpu_loop(CPUOpenRISCState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;
linux-user/ppc/cpu_loop.c +1 -1
@@ -378,7 +378,7 @@ void cpu_loop(CPUPPCState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;
linux-user/riscv/cpu_loop.c +1 -1
@@ -94,7 +94,7 @@ void cpu_loop(CPURISCVState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {CPUState *cpu =env_cpu (env);TaskState *ts =get_task_state (cpu);
linux-user/s390x/cpu_loop.c +1 -1
@@ -180,7 +180,7 @@ void cpu_loop(CPUS390XState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;for (i =0 ; i <16 ; i++) {
linux-user/sh4/cpu_loop.c +1 -1
@@ -81,7 +81,7 @@ void cpu_loop(CPUSH4State *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;
linux-user/sparc/cpu_loop.c +1 -1
@@ -357,7 +357,7 @@ void cpu_loop (CPUSPARCState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i; env->pc = regs->pc;
linux-user/xtensa/cpu_loop.c +1 -1
@@ -238,7 +238,7 @@ void cpu_loop(CPUXtensaState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;for (i =0 ; i <16 ; ++i) {
Signature · 1 line
2.45.2
Re: [PATCH 15/18] user: Forward declare target_cpu_copy_regs structure
Quoted 249 lines · Philippe Mathieu-Daudé
Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- linux-user/cpu_loop-common.h | 5 ++++- linux-user/aarch64/cpu_loop.c | 2 +- linux-user/alpha/cpu_loop.c | 2 +- linux-user/arm/cpu_loop.c | 2 +- linux-user/hexagon/cpu_loop.c | 2 +- linux-user/hppa/cpu_loop.c | 2 +- linux-user/i386/cpu_loop.c | 2 +- linux-user/loongarch64/cpu_loop.c | 2 +- linux-user/m68k/cpu_loop.c | 2 +- linux-user/microblaze/cpu_loop.c | 2 +- linux-user/mips/cpu_loop.c | 2 +- linux-user/openrisc/cpu_loop.c | 2 +- linux-user/ppc/cpu_loop.c | 2 +- linux-user/riscv/cpu_loop.c | 2 +- linux-user/s390x/cpu_loop.c | 2 +- linux-user/sh4/cpu_loop.c | 2 +- linux-user/sparc/cpu_loop.c | 2 +- linux-user/xtensa/cpu_loop.c | 2 +- 18 files changed, 21 insertions(+), 18 deletions(-)linux-user/cpu_loop-common.h +4
-1@@ -27,5 +27,8 @@ void target_exception_dump(CPUArchState *env, const char *fmt, int code);#define EXCP_DUMP (env, fmt, code) \ target_exception_dump(env, fmt, code) -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs); +typedef struct target_pt_regs target_pt_regs ; + +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs); +#endif linux-user/aarch64/cpu_loop.c +1
-1@@ -185,7 +185,7 @@ void cpu_loop(CPUARMState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {ARMCPU *cpu =env_archcpu (env);CPUState *cs =env_cpu (env);linux-user/alpha/cpu_loop.c +1
-1@@ -173,7 +173,7 @@ void cpu_loop(CPUAlphaState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;linux-user/arm/cpu_loop.c +1
-1@@ -513,7 +513,7 @@ void cpu_loop(CPUARMState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {CPUState *cpu =env_cpu (env);TaskState *ts =get_task_state (cpu);linux-user/hexagon/cpu_loop.c +1
-1@@ -79,7 +79,7 @@ void cpu_loop(CPUHexagonState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) { env->gpr[HEX_REG_PC ] = regs->sepc; env->gpr[HEX_REG_SP ] = regs->sp;linux-user/hppa/cpu_loop.c +1
-1@@ -188,7 +188,7 @@ void cpu_loop(CPUHPPAState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;for (i =1 ; i <32 ; i++) {linux-user/i386/cpu_loop.c +1
-1@@ -331,7 +331,7 @@ static void target_cpu_free(void *obj)g_free (obj); } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {CPUState *cpu =env_cpu (env);bool is64 = (env->features[FEAT_8000_0001_EDX ] &CPUID_EXT2_LM ) !=0 ;linux-user/loongarch64/cpu_loop.c +1
-1@@ -97,7 +97,7 @@ void cpu_loop(CPULoongArchState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;linux-user/m68k/cpu_loop.c +1
-1@@ -92,7 +92,7 @@ void cpu_loop(CPUM68KState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {CPUState *cpu =env_cpu (env);TaskState *ts =get_task_state (cpu);linux-user/microblaze/cpu_loop.c +1
-1@@ -127,7 +127,7 @@ void cpu_loop(CPUMBState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) { env->regs[0 ] = regs->r0; env->regs[1 ] = regs->r1;linux-user/mips/cpu_loop.c +1
-1@@ -211,7 +211,7 @@ done_syscall: } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {CPUState *cpu =env_cpu (env);TaskState *ts =get_task_state (cpu);linux-user/openrisc/cpu_loop.c +1
-1@@ -83,7 +83,7 @@ void cpu_loop(CPUOpenRISCState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;linux-user/ppc/cpu_loop.c +1
-1@@ -378,7 +378,7 @@ void cpu_loop(CPUPPCState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;linux-user/riscv/cpu_loop.c +1
-1@@ -94,7 +94,7 @@ void cpu_loop(CPURISCVState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {CPUState *cpu =env_cpu (env);TaskState *ts =get_task_state (cpu);linux-user/s390x/cpu_loop.c +1
-1@@ -180,7 +180,7 @@ void cpu_loop(CPUS390XState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;for (i =0 ; i <16 ; i++) {linux-user/sh4/cpu_loop.c +1
-1@@ -81,7 +81,7 @@ void cpu_loop(CPUSH4State *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;linux-user/sparc/cpu_loop.c +1
-1@@ -357,7 +357,7 @@ void cpu_loop (CPUSPARCState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i; env->pc = regs->pc;linux-user/xtensa/cpu_loop.c +0
-0
linux-user/xtensa/cpu_loop.c void cpu_loop(CPUXtensaState *env) · line 244
Quoted 8 lines
linux-user/xtensa/cpu_loop.c +1
-1@@ -238,7 +238,7 @@ void cpu_loop(CPUXtensaState *env) } } -void target_cpu_copy_regs (CPUArchState *env,struct target_pt_regs *regs) +void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs) {int i;for (i =0 ; i <16 ; ++i) {
PATCH 16/18 user: Move 'linux-user/cpu_loop-common.h' -> 'user/cpu_loop.h'
In reply to Philippe Mathieu-Daudé"linux-user/cpu_loop-common.h" is generic enough to be used by bsd-user, so rename it as "user/cpu_loop.h".
Mechanical change running:
$ sed -i -e 's,cpu_loop-common.h,user/cpu_loop.h,' \
$(git grep -l cpu_loop-common.h)--- linux-user/cpu_loop-common.h => include/user/cpu_loop.h | 4 ++-- linux-user/aarch64/cpu_loop.c | 2 +- linux-user/alpha/cpu_loop.c | 2 +- linux-user/arm/cpu_loop.c | 2 +- linux-user/hexagon/cpu_loop.c | 2 +- linux-user/hppa/cpu_loop.c | 2 +- linux-user/i386/cpu_loop.c | 2 +- linux-user/loongarch64/cpu_loop.c | 2 +- linux-user/m68k/cpu_loop.c | 2 +- linux-user/main.c | 2 +- linux-user/microblaze/cpu_loop.c | 2 +- linux-user/mips/cpu_loop.c | 2 +- linux-user/openrisc/cpu_loop.c | 2 +- linux-user/ppc/cpu_loop.c | 2 +- linux-user/riscv/cpu_loop.c | 2 +- linux-user/s390x/cpu_loop.c | 2 +- linux-user/sh4/cpu_loop.c | 2 +- linux-user/sparc/cpu_loop.c | 2 +- linux-user/syscall.c | 2 +- linux-user/xtensa/cpu_loop.c | 2 +- 20 files changed, 21 insertions(+), 21 deletions(-) rename linux-user/cpu_loop-common.h => include/user/cpu_loop.h (95%)
include/user/cpu_loop.h renamed from linux-user/cpu_loop-common.h +2 -2
@@ -17,8 +17,8 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef CPU_LOOP_COMMON_H -#define CPU_LOOP_COMMON_H +#ifndef USER_CPU_LOOP_H +#define USER_CPU_LOOP_H #include "exec/log.h" #include "special-errno.h"
linux-user/aarch64/cpu_loop.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "qemu/guest-random.h" #include "semihosting/common-semi.h"
linux-user/alpha/cpu_loop.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPUAlphaState *env)
linux-user/arm/cpu_loop.c +1 -1
@@ -21,7 +21,7 @@#include "qemu.h" #include "user-internals.h" #include "elf.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "semihosting/common-semi.h" #include "exec/page-protection.h"
linux-user/hexagon/cpu_loop.c +1 -1
@@ -21,7 +21,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "internal.h"
linux-user/hppa/cpu_loop.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" static abi_ulong hppa_lws (CPUHPPAState *env)
linux-user/i386/cpu_loop.c +1 -1
@@ -21,7 +21,7 @@#include "qemu.h" #include "qemu/timer.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "user-mmap.h"
linux-user/loongarch64/cpu_loop.c +1 -1
@@ -8,7 +8,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPULoongArchState *env)
linux-user/m68k/cpu_loop.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPUM68KState *env)
linux-user/main.c +1 -1
@@ -50,7 +50,7 @@#include "elf.h" #include "trace/control.h" #include "target_elf.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "crypto/init.h" #include "fd-trans.h" #include "signal-common.h"
linux-user/microblaze/cpu_loop.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPUMBState *env)
linux-user/mips/cpu_loop.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "elf.h" #include "internal.h"
linux-user/openrisc/cpu_loop.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPUOpenRISCState *env)
linux-user/ppc/cpu_loop.c +1 -1
@@ -21,7 +21,7 @@#include "qemu.h" #include "qemu/timer.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" static inline uint64_t cpu_ppc_get_tb (CPUPPCState *env)
linux-user/riscv/cpu_loop.c +1 -1
@@ -21,7 +21,7 @@#include "qemu/error-report.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "elf.h" #include "semihosting/common-semi.h"
linux-user/s390x/cpu_loop.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h"
linux-user/sh4/cpu_loop.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPUSH4State *env)
linux-user/sparc/cpu_loop.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #define SPARC64_STACK_BIAS 2047
linux-user/syscall.c +1 -1
@@ -143,7 +143,7 @@#include "special-errno.h" #include "qapi/error.h" #include "fd-trans.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #ifndef CLONE_IO #define CLONE_IO 0x80000000/* Clone io context */
linux-user/xtensa/cpu_loop.c +1 -1
@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" static void xtensa_rfw (CPUXtensaState *env)
Signature · 1 line
2.45.2
Re: [PATCH 16/18] user: Move 'linux-user/cpu_loop-common.h' -> 'user/cpu_loop.h'
Quoted 290 lines · Philippe Mathieu-Daudé
"
linux-user/cpu_loop-common.h" is generic enough to be used by bsd-user, so rename it as "user/cpu_loop.h".Mechanical change running:
$ sed -i -e 's,cpu_loop-common.h,user/cpu_loop.h,' \ $(git grep -l cpu_loop-common.h)Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- linux-user/cpu_loop-common.h => include/user/cpu_loop.h | 4 ++-- linux-user/aarch64/cpu_loop.c | 2 +- linux-user/alpha/cpu_loop.c | 2 +- linux-user/arm/cpu_loop.c | 2 +- linux-user/hexagon/cpu_loop.c | 2 +- linux-user/hppa/cpu_loop.c | 2 +- linux-user/i386/cpu_loop.c | 2 +- linux-user/loongarch64/cpu_loop.c | 2 +- linux-user/m68k/cpu_loop.c | 2 +- linux-user/main.c | 2 +- linux-user/microblaze/cpu_loop.c | 2 +- linux-user/mips/cpu_loop.c | 2 +- linux-user/openrisc/cpu_loop.c | 2 +- linux-user/ppc/cpu_loop.c | 2 +- linux-user/riscv/cpu_loop.c | 2 +- linux-user/s390x/cpu_loop.c | 2 +- linux-user/sh4/cpu_loop.c | 2 +- linux-user/sparc/cpu_loop.c | 2 +- linux-user/syscall.c | 2 +- linux-user/xtensa/cpu_loop.c | 2 +- 20 files changed, 21 insertions(+), 21 deletions(-)rename
linux-user/cpu_loop-common.h=>include/user/cpu_loop.h(95%)include/user/cpu_loop.h renamed from linux-user/cpu_loop-common.h +2
-2@@ -17,8 +17,8 @@* along with this program; if not, see <http://www.gnu.org/licenses/>. */ -#ifndef CPU_LOOP_COMMON_H -#define CPU_LOOP_COMMON_H +#ifndef USER_CPU_LOOP_H +#define USER_CPU_LOOP_H #include "exec/log.h" #include "special-errno.h" linux-user/aarch64/cpu_loop.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "qemu/guest-random.h" #include "semihosting/common-semi.h" linux-user/alpha/cpu_loop.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPUAlphaState *env)linux-user/arm/cpu_loop.c +1
-1@@ -21,7 +21,7 @@#include "qemu.h" #include "user-internals.h" #include "elf.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "semihosting/common-semi.h" #include "exec/page-protection.h" linux-user/hexagon/cpu_loop.c +1
-1@@ -21,7 +21,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "internal.h" linux-user/hppa/cpu_loop.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" static abi_ulong hppa_lws (CPUHPPAState *env)linux-user/i386/cpu_loop.c +1
-1@@ -21,7 +21,7 @@#include "qemu.h" #include "qemu/timer.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "user-mmap.h" linux-user/loongarch64/cpu_loop.c +1
-1@@ -8,7 +8,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPULoongArchState *env)linux-user/m68k/cpu_loop.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPUM68KState *env)linux-user/main.c +1
-1@@ -50,7 +50,7 @@#include "elf.h" #include "trace/control.h" #include "target_elf.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "crypto/init.h" #include "fd-trans.h" #include "signal-common.h" linux-user/microblaze/cpu_loop.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPUMBState *env)linux-user/mips/cpu_loop.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "elf.h" #include "internal.h" linux-user/openrisc/cpu_loop.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPUOpenRISCState *env)linux-user/ppc/cpu_loop.c +1
-1@@ -21,7 +21,7 @@#include "qemu.h" #include "qemu/timer.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" static inline uint64_t cpu_ppc_get_tb (CPUPPCState *env)linux-user/riscv/cpu_loop.c +1
-1@@ -21,7 +21,7 @@#include "qemu/error-report.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #include "elf.h" #include "semihosting/common-semi.h" linux-user/s390x/cpu_loop.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" linux-user/sh4/cpu_loop.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" void cpu_loop (CPUSH4State *env)linux-user/sparc/cpu_loop.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" #define SPARC64_STACK_BIAS 2047linux-user/syscall.c +1
-1@@ -143,7 +143,7 @@#include "special-errno.h" #include "qapi/error.h" #include "fd-trans.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #ifndef CLONE_IO #define CLONE_IO 0x80000000/* Clone io context */ linux-user/xtensa/cpu_loop.c +0
-0
linux-user/xtensa/cpu_loop.c line 26
Quoted 8 lines
linux-user/xtensa/cpu_loop.c +1
-1@@ -20,7 +20,7 @@#include "qemu/osdep.h" #include "qemu.h" #include "user-internals.h" -#include "cpu_loop-common.h" +#include "user/cpu_loop.h" #include "signal-common.h" static void xtensa_rfw (CPUXtensaState *env)
PATCH 17/18 user: Declare cpu_loop() once in 'user/cpu_loop.h'
In reply to Philippe Mathieu-DaudéDeclare cpu_loop() once in "user/cpu_loop.h".
bsd-user gets the G_NORETURN attribute.
--- bsd-user/qemu.h | 2 +- include/user/cpu_loop.h | 2 ++ linux-user/user-internals.h | 1 - 3 files changed, 3 insertions(+), 2 deletions(-)
bsd-user/qemu.h +1 -1
@@ -26,6 +26,7 @@#include "exec/exec-all.h" #include "user/abitypes.h" +#include "user/cpu_loop.h" #include "user/page-protection.h" extern char **environ;
@@ -187,7 +188,6 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6); void gemu_log(const char *fmt, ...) G_GNUC_PRINTF(1, 2);extern __threadCPUState *thread_cpu; -void cpu_loop (CPUArchState *env);char *target_strerror (int err);int get_osversion (void );void fork_start (void );
include/user/cpu_loop.h +2 -0
@@ -23,6 +23,8 @@#include "exec/log.h" #include "special-errno.h" +G_NORETURN void cpu_loop(CPUArchState *env); +void target_exception_dump (CPUArchState *env,const char *fmt,int code);#define EXCP_DUMP (env, fmt, code) \ target_exception_dump(env, fmt, code)
linux-user/user-internals.h +0 -1
@@ -65,7 +65,6 @@ abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8);extern __threadCPUState *thread_cpu; -G_NORETURN void cpu_loop(CPUArchState *env);abi_long get_errno (abi_long ret);const char *target_strerror (int err);int get_osversion (void );
Signature · 1 line
2.45.2
Re: [PATCH 17/18] user: Declare cpu_loop() once in 'user/cpu_loop.h'
Quoted 48 lines · Philippe Mathieu-Daudé
Declare
cpu_loop()once in "user/cpu_loop.h".
bsd-user gets theG_NORETURNattribute.Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- bsd-user/qemu.h | 2 +- include/user/cpu_loop.h | 2 ++ linux-user/user-internals.h | 1 - 3 files changed, 3 insertions(+), 2 deletions(-)bsd-user/qemu.h +1
-1@@ -26,6 +26,7 @@#include "exec/exec-all.h" #include "user/abitypes.h" +#include "user/cpu_loop.h" #include "user/page-protection.h" extern char **environ;@@ -187,7 +188,6 @@ abi_long do_openbsd_syscall(void *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6); void gemu_log(const char *fmt, ...) G_GNUC_PRINTF(1, 2);extern __threadCPUState *thread_cpu; -void cpu_loop (CPUArchState *env);char *target_strerror (int err);int get_osversion (void );void fork_start (void );include/user/cpu_loop.h +2
-0@@ -23,6 +23,8 @@#include "exec/log.h" #include "special-errno.h" +G_NORETURN void cpu_loop(CPUArchState *env); +void target_exception_dump (CPUArchState *env,const char *fmt,int code);#define EXCP_DUMP (env, fmt, code) \ target_exception_dump(env, fmt, code)linux-user/user-internals.h +0
-0
linux-user/user-internals.h abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1, · line 70
Quoted 7 lines
linux-user/user-internals.h +0
-1@@ -65,7 +65,6 @@ abi_long do_syscall(CPUArchState *cpu_env, int num, abi_long arg1, abi_long arg5, abi_long arg6, abi_long arg7, abi_long arg8);extern __threadCPUState *thread_cpu; -G_NORETURN void cpu_loop(CPUArchState *env);abi_long get_errno (abi_long ret);const char *target_strerror (int err);int get_osversion (void );
PATCH 18/18 user: Move various declarations out of 'exec/exec-all.h'
In reply to Philippe Mathieu-DaudéMove various declarations related to user emulation from "exec/exec-all.h" to "user/cpu_loop.h".
--- include/exec/exec-all.h | 55 +------------------------------------ include/user/cpu_loop.h | 54 ++++++++++++++++++++++++++++++++++++ accel/tcg/user-exec.c | 1 + bsd-user/signal.c | 1 + linux-user/signal.c | 1 + target/arm/tcg/mte_helper.c | 1 + 6 files changed, 59 insertions(+), 54 deletions(-)
include/exec/exec-all.h +1 -54
@@ -22,7 +22,6 @@#include "cpu.h" #if defined(CONFIG_USER_ONLY ) -#include "exec/abi_ptr.h" #include "exec/cpu_ldst.h" #endif #include "exec/mmu-access-type.h"
@@ -518,60 +517,8 @@ static inline tb_page_addr_t get_page_addr_code(CPUArchState *env,return get_page_addr_code_hostp (env, addr,NULL ); } -#if defined(CONFIG_USER_ONLY ) +#if !defined(CONFIG_USER_ONLY ) -/** -* adjust_signal_pc: -* @pc: raw pc from the host signal ucontext_t. -* @is_write: host memory operation was write, or read-modify-write. -* -* Alter @pc as required for unwinding. Return the type of the -* guest memory access -- host reads may be for guest execution. -*/ -MMUAccessType adjust_signal_pc (uintptr_t *pc,bool is_write); - -/** -* handle_sigsegv_accerr_write: -* @cpu: the cpu context -* @old_set: the sigset_t from the signal ucontext_t -* @host_pc: the host pc, adjusted for the signal -* @host_addr: the host address of the fault -* -* Return true if the write fault has been handled, and should be re-tried. -*/ -bool handle_sigsegv_accerr_write (CPUState *cpu,sigset_t *old_set, -uintptr_t host_pc,abi_ptr guest_addr); - -/** -* cpu_loop_exit_sigsegv: -* @cpu: the cpu context -* @addr: the guest address of the fault -* @access_type: access was read/write/execute -* @maperr: true for invalid page, false for permission fault -* @ra: host pc for unwinding -* -* Use the TCGCPUOps hook to record cpu state, do guest operating system -* specific things to raise SIGSEGV, and jump to the main cpu loop. -*/ -G_NORETURN void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, -MMUAccessType access_type, -bool maperr,uintptr_t ra); - -/** -* cpu_loop_exit_sigbus: -* @cpu: the cpu context -* @addr: the guest address of the alignment fault -* @access_type: access was read/write/execute -* @ra: host pc for unwinding -* -* Use the TCGCPUOps hook to record cpu state, do guest operating system -* specific things to raise SIGBUS, and jump to the main cpu loop. -*/ -G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, -MMUAccessType access_type, -uintptr_t ra); - -#else void tlb_reset_dirty (CPUState *cpu,ram_addr_t start1,ram_addr_t length);void tlb_reset_dirty_range_all (ram_addr_t start,ram_addr_t length);
include/user/cpu_loop.h +54 -0
65 lines not on this page · raw message
accel/tcg/user-exec.c +1 -0
@@ -24,6 +24,7 @@#include "qemu/bitops.h" #include "qemu/rcu.h" #include "exec/cpu_ldst.h" +#include "user/cpu_loop.h" #include "qemu/main-loop.h" #include "user/page-protection.h" #include "exec/page-protection.h"
bsd-user/signal.c +1 -0
@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "qemu/log.h" #include "qemu.h" +#include "user/cpu_loop.h" #include "exec/page-protection.h" #include "user/page-protection.h" #include "user/tswap-target.h"
linux-user/signal.c +1 -0
@@ -33,6 +33,7 @@#include "trace.h" #include "signal-common.h" #include "host-signal.h" +#include "user/cpu_loop.h" #include "user/page-protection.h" #include "user/safe-syscall.h" #include "tcg/tcg.h"
target/arm/tcg/mte_helper.c +1 -0
@@ -25,6 +25,7 @@#include "exec/page-protection.h" #ifdef CONFIG_USER_ONLY #include "user/page-protection.h" +#include "user/cpu_loop.h" #endif #include "exec/ram_addr.h" #include "exec/cpu_ldst.h"
Signature · 1 line
2.45.2
Re: [PATCH 18/18] user: Move various declarations out of 'exec/exec-all.h'
Quoted 199 lines · Philippe Mathieu-Daudé
Move various declarations related to user emulation from "
exec/exec-all.h" to "user/cpu_loop.h".Signed-off-by Philippe Mathieu-Daudé <[email protected]>--- include/exec/exec-all.h | 55 +------------------------------------ include/user/cpu_loop.h | 54 ++++++++++++++++++++++++++++++++++++ accel/tcg/user-exec.c | 1 + bsd-user/signal.c | 1 + linux-user/signal.c | 1 + target/arm/tcg/mte_helper.c | 1 + 6 files changed, 59 insertions(+), 54 deletions(-)include/exec/exec-all.h +1
-54@@ -22,7 +22,6 @@#include "cpu.h" #if defined(CONFIG_USER_ONLY ) -#include "exec/abi_ptr.h" #include "exec/cpu_ldst.h" #endif #include "exec/mmu-access-type.h" @@ -518,60 +517,8 @@ static inline tb_page_addr_t get_page_addr_code(CPUArchState *env,return get_page_addr_code_hostp (env, addr,NULL ); } -#if defined(CONFIG_USER_ONLY ) +#if !defined(CONFIG_USER_ONLY ) -/** -* adjust_signal_pc: -* @pc: raw pc from the host signal ucontext_t. -* @is_write: host memory operation was write, or read-modify-write. -* -* Alter @pc as required for unwinding. Return the type of the -* guest memory access -- host reads may be for guest execution. -*/ -MMUAccessType adjust_signal_pc (uintptr_t *pc,bool is_write); - -/** -* handle_sigsegv_accerr_write: -* @cpu: the cpu context -* @old_set: the sigset_t from the signal ucontext_t -* @host_pc: the host pc, adjusted for the signal -* @host_addr: the host address of the fault -* -* Return true if the write fault has been handled, and should be re-tried. -*/ -bool handle_sigsegv_accerr_write (CPUState *cpu,sigset_t *old_set, -uintptr_t host_pc,abi_ptr guest_addr); - -/** -* cpu_loop_exit_sigsegv: -* @cpu: the cpu context -* @addr: the guest address of the fault -* @access_type: access was read/write/execute -* @maperr: true for invalid page, false for permission fault -* @ra: host pc for unwinding -* -* Use the TCGCPUOps hook to record cpu state, do guest operating system -* specific things to raise SIGSEGV, and jump to the main cpu loop. -*/ -G_NORETURN void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, -MMUAccessType access_type, -bool maperr,uintptr_t ra); - -/** -* cpu_loop_exit_sigbus: -* @cpu: the cpu context -* @addr: the guest address of the alignment fault -* @access_type: access was read/write/execute -* @ra: host pc for unwinding -* -* Use the TCGCPUOps hook to record cpu state, do guest operating system -* specific things to raise SIGBUS, and jump to the main cpu loop. -*/ -G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, -MMUAccessType access_type, -uintptr_t ra); - -#else void tlb_reset_dirty (CPUState *cpu,ram_addr_t start1,ram_addr_t length);void tlb_reset_dirty_range_all (ram_addr_t start,ram_addr_t length);include/user/cpu_loop.h +54
-0@@ -20,7 +20,10 @@#ifndef USER_CPU_LOOP_H #define USER_CPU_LOOP_H +#include "exec/abi_ptr.h" +#include "exec/mmu-access-type.h" #include "exec/log.h" +#include "exec/target_long.h" #include "special-errno.h" G_NORETURN void cpu_loop(CPUArchState *env);@@ -33,4 +36,55 @@ typedef struct target_pt_regs target_pt_regs;void target_cpu_copy_regs (CPUArchState *env,target_pt_regs *regs); +/** +* adjust_signal_pc: +* @pc: raw pc from the host signal ucontext_t. +* @is_write: host memory operation was write, or read-modify-write. +* +* Alter @pc as required for unwinding. Return the type of the +* guest memory access -- host reads may be for guest execution. +*/ +MMUAccessType adjust_signal_pc (uintptr_t *pc,bool is_write); + +/** +* handle_sigsegv_accerr_write: +* @cpu: the cpu context +* @old_set: the sigset_t from the signal ucontext_t +* @host_pc: the host pc, adjusted for the signal +* @host_addr: the host address of the fault +* +* Return true if the write fault has been handled, and should be re-tried. +*/ +bool handle_sigsegv_accerr_write (CPUState *cpu,sigset_t *old_set, +uintptr_t host_pc,abi_ptr guest_addr); + +/** +* cpu_loop_exit_sigsegv: +* @cpu: the cpu context +* @addr: the guest address of the fault +* @access_type: access was read/write/execute +* @maperr: true for invalid page, false for permission fault +* @ra: host pc for unwinding +* +* Use the TCGCPUOps hook to record cpu state, do guest operating system +* specific things to raise SIGSEGV, and jump to the main cpu loop. +*/ +G_NORETURN void cpu_loop_exit_sigsegv(CPUState *cpu, target_ulong addr, +MMUAccessType access_type, +bool maperr,uintptr_t ra); + +/** +* cpu_loop_exit_sigbus: +* @cpu: the cpu context +* @addr: the guest address of the alignment fault +* @access_type: access was read/write/execute +* @ra: host pc for unwinding +* +* Use the TCGCPUOps hook to record cpu state, do guest operating system +* specific things to raise SIGBUS, and jump to the main cpu loop. +*/ +G_NORETURN void cpu_loop_exit_sigbus(CPUState *cpu, target_ulong addr, +MMUAccessType access_type, +uintptr_t ra); +#endif accel/tcg/user-exec.c +1
-0@@ -24,6 +24,7 @@#include "qemu/bitops.h" #include "qemu/rcu.h" #include "exec/cpu_ldst.h" +#include "user/cpu_loop.h" #include "qemu/main-loop.h" #include "user/page-protection.h" #include "exec/page-protection.h" bsd-user/signal.c +1
-0@@ -21,6 +21,7 @@#include "qemu/osdep.h" #include "qemu/log.h" #include "qemu.h" +#include "user/cpu_loop.h" #include "exec/page-protection.h" #include "user/page-protection.h" #include "user/tswap-target.h" linux-user/signal.c +1
-0@@ -33,6 +33,7 @@#include "trace.h" #include "signal-common.h" #include "host-signal.h" +#include "user/cpu_loop.h" #include "user/page-protection.h" #include "user/safe-syscall.h" #include "tcg/tcg.h" target/arm/tcg/mte_helper.c +0
-0
target/arm/tcg/mte_helper.c line 31
Quoted 7 lines
target/arm/tcg/mte_helper.c +1
-0@@ -25,6 +25,7 @@#include "exec/page-protection.h" #ifdef CONFIG_USER_ONLY #include "user/page-protection.h" +#include "user/cpu_loop.h" #endif #include "exec/ram_addr.h" #include "exec/cpu_ldst.h"
Re: [PATCH 00/18] accel/tcg: Extract user APIs out of 'exec/[cpu,exec]-all.h'
In reply to Philippe Mathieu-DaudéQuoted 35 lines · Philippe Mathieu-Daudé
The goal of this series is to clarify user emulation APIs, and clean the mixed bag of
exec/foo-all.hheaders.Move user specific declarations out of the generic
- "exec/cpu-all.h",
- "exec/cpu_ldst.h",
- "exec/exec-all.h" and
- "exec/translate-all.h"
to the generic:
- "accel/tcg/tb-internal.h" and
- "exec/page-protection.h"
and the user specific:
- "user/cpu_loop.h",
- "user/guest-host.h" and
- "user/page-protection.h"Philippe Mathieu-Daudé (18):
exec: Introduce 'user/guest-host.h' header linux-user/aarch64: Include missing 'user/abitypes.h' header
include: Include missing 'qemu/clang-tsa.h' header accel/tcg: Declare mmap_[un]lock() in 'exec/page-protection.h' accel/tcg: Usetb_page_addr_ttype inpage_unprotect()accel/tcg: Move page_[un]protect() to 'user/page-protection.h'
system: Remove unnecessary 'exec/translate-all.h' include accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h' accel/tcg: Un-inlinelog_pc()
accel/tcg: Move TranslationBlock declarations to 'tb-internal.h' accel/tcg: Move user-related declarations out of 'exec/cpu-all.h'(1/4) accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (2/4) accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (3/4) accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4)
Quoted 4 lines
user: Forward declare
target_cpu_copy_regsstructure
user: Move 'linux-user/cpu_loop-common.h' -> 'user/cpu_loop.h'
user: Declarecpu_loop()once in 'user/cpu_loop.h'
user: Move various declarations out of 'exec/exec-all.h'
Series:
r~
Re: [PATCH 00/18] accel/tcg: Extract user APIs out of 'exec/[cpu,exec]-all.h'
In reply to Philippe Mathieu-DaudéQuoted 19 lines · Philippe Mathieu-Daudé
Philippe Mathieu-Daudé (18):
exec: Introduce 'user/guest-host.h' header linux-user/aarch64: Include missing 'user/abitypes.h' header
include: Include missing 'qemu/clang-tsa.h' header accel/tcg: Declare mmap_[un]lock() in 'exec/page-protection.h' accel/tcg: Usetb_page_addr_ttype inpage_unprotect()accel/tcg: Move page_[un]protect() to 'user/page-protection.h'
system: Remove unnecessary 'exec/translate-all.h' include accel/tcg: Move 'exec/translate-all.h' -> 'tb-internal.h' accel/tcg: Un-inlinelog_pc()
accel/tcg: Move TranslationBlock declarations to 'tb-internal.h' accel/tcg: Move user-related declarations out of 'exec/cpu-all.h'(1/4) accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (2/4) accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (3/4) accel/tcg: Move user-related declarations out of 'exec/cpu-all.h' (4/4)
Quoted 4 lines
user: Forward declare
target_cpu_copy_regsstructure
user: Move 'linux-user/cpu_loop-common.h' -> 'user/cpu_loop.h'
user: Declarecpu_loop()once in 'user/cpu_loop.h'
user: Move various declarations out of 'exec/exec-all.h'
Series queued, thanks.