We currently include user/guest-host.h from accel/tcg/cpu-ldst.h.
However that file doesn't need anything from guest-host.h, since we
removed the uses of g2h() in commit 9b74d403b30e ("accel/tcg: Move
user-only tlb_vaddr_to_host out of line").
Move the include of guest-host.h to where it's actually needed.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
This isn't needed for the following bugfix patch, but it made
it a bit easier for me to understand where we're actually using
the functions.
---
bsd-user/qemu.h | 1 +
include/accel/tcg/cpu-ldst.h | 4 ----
linux-user/qemu.h | 1 +
3 files changed, 2 insertions(+), 4 deletions(-)
diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
index 2c586e546f..b0b2c249fb 100644
--- a/bsd-user/qemu.h
+++ b/bsd-user/qemu.h
@@ -27,6 +27,7 @@
#include "user/abitypes.h"
#include "user/cpu_loop.h"
#include "user/page-protection.h"
+#include "user/guest-host.h"
extern char **environ;
diff --git a/include/accel/tcg/cpu-ldst.h b/include/accel/tcg/cpu-ldst.h
index a5711bc15a..ea2cbf40fe 100644
--- a/include/accel/tcg/cpu-ldst.h
+++ b/include/accel/tcg/cpu-ldst.h
@@ -71,10 +71,6 @@
#include "accel/tcg/cpu-mmu-index.h"
#include "exec/abi_ptr.h"
-#if defined(CONFIG_USER_ONLY)
-#include "user/guest-host.h"
-#endif /* CONFIG_USER_ONLY */
-
static inline uint32_t
cpu_ldub_mmuidx_ra(CPUArchState *env, abi_ptr addr, int mmu_idx, uintptr_t ra)
{
diff --git a/linux-user/qemu.h b/linux-user/qemu.h
index 85e68eff7b..cfe5f45fc4 100644
--- a/linux-user/qemu.h
+++ b/linux-user/qemu.h
@@ -10,6 +10,7 @@
#include "syscall_defs.h"
#include "target_syscall.h"
#include "accel/tcg/vcpu-state.h"
+#include "user/guest-host.h"
/*
* This is the size of the host kernel's sigset_t, needed where we make
--
2.43.0
On 30/3/26 16:31, Peter Maydell wrote:
> We currently include user/guest-host.h from accel/tcg/cpu-ldst.h.
> However that file doesn't need anything from guest-host.h, since we
> removed the uses of g2h() in commit 9b74d403b30e ("accel/tcg: Move
> user-only tlb_vaddr_to_host out of line").
>
> Move the include of guest-host.h to where it's actually needed.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> This isn't needed for the following bugfix patch, but it made
> it a bit easier for me to understand where we're actually using
> the functions.
> ---
> bsd-user/qemu.h | 1 +
> include/accel/tcg/cpu-ldst.h | 4 ----
> linux-user/qemu.h | 1 +
> 3 files changed, 2 insertions(+), 4 deletions(-)
Reviewed-by: Philippe Mathieu-Daudé <philmd@linaro.org>
On 3/31/26 00:31, Peter Maydell wrote:
> We currently include user/guest-host.h from accel/tcg/cpu-ldst.h.
> However that file doesn't need anything from guest-host.h, since we
> removed the uses of g2h() in commit 9b74d403b30e ("accel/tcg: Move
> user-only tlb_vaddr_to_host out of line").
>
> Move the include of guest-host.h to where it's actually needed.
>
> Signed-off-by: Peter Maydell<peter.maydell@linaro.org>
> ---
> This isn't needed for the following bugfix patch, but it made
> it a bit easier for me to understand where we're actually using
> the functions.
> ---
> bsd-user/qemu.h | 1 +
> include/accel/tcg/cpu-ldst.h | 4 ----
> linux-user/qemu.h | 1 +
> 3 files changed, 2 insertions(+), 4 deletions(-)
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
r~
Le 30/03/2026 à 16:31, Peter Maydell a écrit :
> We currently include user/guest-host.h from accel/tcg/cpu-ldst.h.
> However that file doesn't need anything from guest-host.h, since we
> removed the uses of g2h() in commit 9b74d403b30e ("accel/tcg: Move
> user-only tlb_vaddr_to_host out of line").
>
> Move the include of guest-host.h to where it's actually needed.
>
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
> ---
> This isn't needed for the following bugfix patch, but it made
> it a bit easier for me to understand where we're actually using
> the functions.
> ---
> bsd-user/qemu.h | 1 +
> include/accel/tcg/cpu-ldst.h | 4 ----
> linux-user/qemu.h | 1 +
> 3 files changed, 2 insertions(+), 4 deletions(-)
>
> diff --git a/bsd-user/qemu.h b/bsd-user/qemu.h
> index 2c586e546f..b0b2c249fb 100644
> --- a/bsd-user/qemu.h
> +++ b/bsd-user/qemu.h
> @@ -27,6 +27,7 @@
> #include "user/abitypes.h"
> #include "user/cpu_loop.h"
> #include "user/page-protection.h"
> +#include "user/guest-host.h"
>
> extern char **environ;
>
> diff --git a/include/accel/tcg/cpu-ldst.h b/include/accel/tcg/cpu-ldst.h
> index a5711bc15a..ea2cbf40fe 100644
> --- a/include/accel/tcg/cpu-ldst.h
> +++ b/include/accel/tcg/cpu-ldst.h
> @@ -71,10 +71,6 @@
> #include "accel/tcg/cpu-mmu-index.h"
> #include "exec/abi_ptr.h"
>
> -#if defined(CONFIG_USER_ONLY)
> -#include "user/guest-host.h"
> -#endif /* CONFIG_USER_ONLY */
> -
> static inline uint32_t
> cpu_ldub_mmuidx_ra(CPUArchState *env, abi_ptr addr, int mmu_idx, uintptr_t ra)
> {
> diff --git a/linux-user/qemu.h b/linux-user/qemu.h
> index 85e68eff7b..cfe5f45fc4 100644
> --- a/linux-user/qemu.h
> +++ b/linux-user/qemu.h
> @@ -10,6 +10,7 @@
> #include "syscall_defs.h"
> #include "target_syscall.h"
> #include "accel/tcg/vcpu-state.h"
> +#include "user/guest-host.h"
>
> /*
> * This is the size of the host kernel's sigset_t, needed where we make
Reviewed-by: Laurent Vivier <laurent@vivier.eu>
© 2016 - 2026 Red Hat, Inc.