diff mbox series

[RFC] include/exec: fix softmmu version of TARGET_ABI_FMT_lx

Message ID 20220208125909.3031809-1-alex.bennee@linaro.org
State Superseded
Headers show
Series [RFC] include/exec: fix softmmu version of TARGET_ABI_FMT_lx | expand

Commit Message

Alex Bennée Feb. 8, 2022, 12:59 p.m. UTC
TARGET_ABI_FMT_lx isn't available for softmmu which causes confusion
when trying to print. As abi_ptr == target_ulong use its format string
instead.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 include/exec/cpu_ldst.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Maydell Feb. 8, 2022, 3:51 p.m. UTC | #1
On Tue, 8 Feb 2022 at 15:42, Alex Bennée <alex.bennee@linaro.org> wrote:
>
> TARGET_ABI_FMT_lx isn't available for softmmu which causes confusion
> when trying to print. As abi_ptr == target_ulong use its format string
> instead.
>
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  include/exec/cpu_ldst.h | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h
> index a878fd0105..da987fe8ad 100644
> --- a/include/exec/cpu_ldst.h
> +++ b/include/exec/cpu_ldst.h
> @@ -121,7 +121,7 @@ static inline bool guest_range_valid_untagged(abi_ulong start, abi_ulong len)
>  })
>  #else
>  typedef target_ulong abi_ptr;
> -#define TARGET_ABI_FMT_ptr TARGET_ABI_FMT_lx
> +#define TARGET_ABI_FMT_ptr TARGET_FMT_lx
>  #endif
>
>  uint32_t cpu_ldub_data(CPUArchState *env, abi_ptr ptr);

I think this was clearly just a bug that we never noticed because
we haven't tried using TARGET_ABI_FMT_ptr in softmmu code before.

Reviewed-by: Peter Maydell <peter.maydell@linaro.org>

I do still wonder whether the softmmu code in question really
ought to be using abi_ptr, though.

thanks
-- PMM
diff mbox series

Patch

diff --git a/include/exec/cpu_ldst.h b/include/exec/cpu_ldst.h
index a878fd0105..da987fe8ad 100644
--- a/include/exec/cpu_ldst.h
+++ b/include/exec/cpu_ldst.h
@@ -121,7 +121,7 @@  static inline bool guest_range_valid_untagged(abi_ulong start, abi_ulong len)
 })
 #else
 typedef target_ulong abi_ptr;
-#define TARGET_ABI_FMT_ptr TARGET_ABI_FMT_lx
+#define TARGET_ABI_FMT_ptr TARGET_FMT_lx
 #endif
 
 uint32_t cpu_ldub_data(CPUArchState *env, abi_ptr ptr);