qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v3 0/2] gdbstub: Introduce ldtul_$endian_p() helpers
@ 2024-10-10 17:52 Philippe Mathieu-Daudé
  2024-10-10 17:52 ` [PATCH v3 1/2] exec/tswap: Massage target_needs_bswap() definition Philippe Mathieu-Daudé
                   ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-10-10 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Pierrick Bouvier, Richard Henderson,
	Alex Bennée, Thomas Huth

Only unreviewed patches from v2:
https://lore.kernel.org/qemu-devel/20241004163042.85922-1-philmd@linaro.org/

Philippe Mathieu-Daudé (2):
  exec/tswap: Massage target_needs_bswap() definition
  gdbstub/helpers: Introduce ldtul_$endian_p() helpers

 include/exec/tswap.h      | 2 +-
 include/gdbstub/helpers.h | 4 ++++
 2 files changed, 5 insertions(+), 1 deletion(-)

-- 
2.45.2



^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v3 1/2] exec/tswap: Massage target_needs_bswap() definition
  2024-10-10 17:52 [PATCH v3 0/2] gdbstub: Introduce ldtul_$endian_p() helpers Philippe Mathieu-Daudé
@ 2024-10-10 17:52 ` Philippe Mathieu-Daudé
  2024-10-12 16:45   ` Richard Henderson
  2024-10-10 17:52 ` [PATCH v3 2/2] gdbstub/helpers: Introduce ldtul_$endian_p() helpers Philippe Mathieu-Daudé
                   ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-10-10 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Pierrick Bouvier, Richard Henderson,
	Alex Bennée, Thomas Huth

Invert target_needs_bswap() comparison to match the
COMPILING_PER_TARGET definition (2 lines upper).

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Message-Id: <20241004162118.84570-2-philmd@linaro.org>
---
 include/exec/tswap.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/include/exec/tswap.h b/include/exec/tswap.h
index b7a41913475..ecd4faef015 100644
--- a/include/exec/tswap.h
+++ b/include/exec/tswap.h
@@ -28,7 +28,7 @@ bool target_words_bigendian(void);
 #ifdef COMPILING_PER_TARGET
 #define target_needs_bswap()  (HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN)
 #else
-#define target_needs_bswap()  (target_words_bigendian() != HOST_BIG_ENDIAN)
+#define target_needs_bswap()  (HOST_BIG_ENDIAN != target_words_bigendian())
 #endif /* COMPILING_PER_TARGET */
 
 static inline uint16_t tswap16(uint16_t s)
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* [PATCH v3 2/2] gdbstub/helpers: Introduce ldtul_$endian_p() helpers
  2024-10-10 17:52 [PATCH v3 0/2] gdbstub: Introduce ldtul_$endian_p() helpers Philippe Mathieu-Daudé
  2024-10-10 17:52 ` [PATCH v3 1/2] exec/tswap: Massage target_needs_bswap() definition Philippe Mathieu-Daudé
@ 2024-10-10 17:52 ` Philippe Mathieu-Daudé
  2024-10-10 18:15   ` Alex Bennée
  2024-10-12 16:46   ` Richard Henderson
  2024-10-10 17:57 ` [PATCH v3 0/2] gdbstub: " Pierrick Bouvier
  2024-10-15 14:38 ` Philippe Mathieu-Daudé
  3 siblings, 2 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-10-10 17:52 UTC (permalink / raw)
  To: qemu-devel
  Cc: Philippe Mathieu-Daudé, Pierrick Bouvier, Richard Henderson,
	Alex Bennée, Thomas Huth

Introduce ldtul_le_p() and ldtul_be_p() to use directly
in place of ldtul_p() when a target endianness is fixed.

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
---
 include/gdbstub/helpers.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/include/gdbstub/helpers.h b/include/gdbstub/helpers.h
index 26140ef1ac0..6f7cc48adcb 100644
--- a/include/gdbstub/helpers.h
+++ b/include/gdbstub/helpers.h
@@ -95,9 +95,13 @@ static inline uint8_t *gdb_get_reg_ptr(GByteArray *buf, int len)
 #if TARGET_LONG_BITS == 64
 #define gdb_get_regl(buf, val) gdb_get_reg64(buf, val)
 #define ldtul_p(addr) ldq_p(addr)
+#define ldtul_le_p(addr) ldq_le_p(addr)
+#define ldtul_be_p(addr) ldq_be_p(addr)
 #else
 #define gdb_get_regl(buf, val) gdb_get_reg32(buf, val)
 #define ldtul_p(addr) ldl_p(addr)
+#define ldtul_le_p(addr) ldl_le_p(addr)
+#define ldtul_be_p(addr) ldl_be_p(addr)
 #endif
 
 #endif /* _GDBSTUB_HELPERS_H_ */
-- 
2.45.2



^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 0/2] gdbstub: Introduce ldtul_$endian_p() helpers
  2024-10-10 17:52 [PATCH v3 0/2] gdbstub: Introduce ldtul_$endian_p() helpers Philippe Mathieu-Daudé
  2024-10-10 17:52 ` [PATCH v3 1/2] exec/tswap: Massage target_needs_bswap() definition Philippe Mathieu-Daudé
  2024-10-10 17:52 ` [PATCH v3 2/2] gdbstub/helpers: Introduce ldtul_$endian_p() helpers Philippe Mathieu-Daudé
@ 2024-10-10 17:57 ` Pierrick Bouvier
  2024-10-15 14:38 ` Philippe Mathieu-Daudé
  3 siblings, 0 replies; 8+ messages in thread
From: Pierrick Bouvier @ 2024-10-10 17:57 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Richard Henderson, Alex Bennée, Thomas Huth

On 10/10/24 10:52, Philippe Mathieu-Daudé wrote:
> Only unreviewed patches from v2:
> https://lore.kernel.org/qemu-devel/20241004163042.85922-1-philmd@linaro.org/
> 
> Philippe Mathieu-Daudé (2):
>    exec/tswap: Massage target_needs_bswap() definition
>    gdbstub/helpers: Introduce ldtul_$endian_p() helpers
> 
>   include/exec/tswap.h      | 2 +-
>   include/gdbstub/helpers.h | 4 ++++
>   2 files changed, 5 insertions(+), 1 deletion(-)
> 

For the series:
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 2/2] gdbstub/helpers: Introduce ldtul_$endian_p() helpers
  2024-10-10 17:52 ` [PATCH v3 2/2] gdbstub/helpers: Introduce ldtul_$endian_p() helpers Philippe Mathieu-Daudé
@ 2024-10-10 18:15   ` Alex Bennée
  2024-10-12 16:46   ` Richard Henderson
  1 sibling, 0 replies; 8+ messages in thread
From: Alex Bennée @ 2024-10-10 18:15 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé
  Cc: qemu-devel, Pierrick Bouvier, Richard Henderson, Thomas Huth

Philippe Mathieu-Daudé <philmd@linaro.org> writes:

> Introduce ldtul_le_p() and ldtul_be_p() to use directly
> in place of ldtul_p() when a target endianness is fixed.
>
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>

Acked-by: Alex Bennée <alex.bennee@linaro.org>

-- 
Alex Bennée
Virtualisation Tech Lead @ Linaro


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 1/2] exec/tswap: Massage target_needs_bswap() definition
  2024-10-10 17:52 ` [PATCH v3 1/2] exec/tswap: Massage target_needs_bswap() definition Philippe Mathieu-Daudé
@ 2024-10-12 16:45   ` Richard Henderson
  0 siblings, 0 replies; 8+ messages in thread
From: Richard Henderson @ 2024-10-12 16:45 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Pierrick Bouvier, Alex Bennée, Thomas Huth

On 10/10/24 10:52, Philippe Mathieu-Daudé wrote:
> Invert target_needs_bswap() comparison to match the
> COMPILING_PER_TARGET definition (2 lines upper).
> 
> Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
> Message-Id: <20241004162118.84570-2-philmd@linaro.org>
> ---
>   include/exec/tswap.h | 2 +-
>   1 file changed, 1 insertion(+), 1 deletion(-)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~

> 
> diff --git a/include/exec/tswap.h b/include/exec/tswap.h
> index b7a41913475..ecd4faef015 100644
> --- a/include/exec/tswap.h
> +++ b/include/exec/tswap.h
> @@ -28,7 +28,7 @@ bool target_words_bigendian(void);
>   #ifdef COMPILING_PER_TARGET
>   #define target_needs_bswap()  (HOST_BIG_ENDIAN != TARGET_BIG_ENDIAN)
>   #else
> -#define target_needs_bswap()  (target_words_bigendian() != HOST_BIG_ENDIAN)
> +#define target_needs_bswap()  (HOST_BIG_ENDIAN != target_words_bigendian())
>   #endif /* COMPILING_PER_TARGET */
>   
>   static inline uint16_t tswap16(uint16_t s)



^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 2/2] gdbstub/helpers: Introduce ldtul_$endian_p() helpers
  2024-10-10 17:52 ` [PATCH v3 2/2] gdbstub/helpers: Introduce ldtul_$endian_p() helpers Philippe Mathieu-Daudé
  2024-10-10 18:15   ` Alex Bennée
@ 2024-10-12 16:46   ` Richard Henderson
  1 sibling, 0 replies; 8+ messages in thread
From: Richard Henderson @ 2024-10-12 16:46 UTC (permalink / raw)
  To: Philippe Mathieu-Daudé, qemu-devel
  Cc: Pierrick Bouvier, Alex Bennée, Thomas Huth

On 10/10/24 10:52, Philippe Mathieu-Daudé wrote:
> Introduce ldtul_le_p() and ldtul_be_p() to use directly
> in place of ldtul_p() when a target endianness is fixed.
> 
> Signed-off-by: Philippe Mathieu-Daudé<philmd@linaro.org>
> ---
>   include/gdbstub/helpers.h | 4 ++++
>   1 file changed, 4 insertions(+)

Reviewed-by: Richard Henderson <richard.henderson@linaro.org>

r~


^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v3 0/2] gdbstub: Introduce ldtul_$endian_p() helpers
  2024-10-10 17:52 [PATCH v3 0/2] gdbstub: Introduce ldtul_$endian_p() helpers Philippe Mathieu-Daudé
                   ` (2 preceding siblings ...)
  2024-10-10 17:57 ` [PATCH v3 0/2] gdbstub: " Pierrick Bouvier
@ 2024-10-15 14:38 ` Philippe Mathieu-Daudé
  3 siblings, 0 replies; 8+ messages in thread
From: Philippe Mathieu-Daudé @ 2024-10-15 14:38 UTC (permalink / raw)
  To: qemu-devel
  Cc: Pierrick Bouvier, Richard Henderson, Alex Bennée,
	Thomas Huth

On 10/10/24 14:52, Philippe Mathieu-Daudé wrote:
> Only unreviewed patches from v2:
> https://lore.kernel.org/qemu-devel/20241004163042.85922-1-philmd@linaro.org/
> 
> Philippe Mathieu-Daudé (2):
>    exec/tswap: Massage target_needs_bswap() definition
>    gdbstub/helpers: Introduce ldtul_$endian_p() helpers

Series queued.



^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2024-10-15 14:39 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2024-10-10 17:52 [PATCH v3 0/2] gdbstub: Introduce ldtul_$endian_p() helpers Philippe Mathieu-Daudé
2024-10-10 17:52 ` [PATCH v3 1/2] exec/tswap: Massage target_needs_bswap() definition Philippe Mathieu-Daudé
2024-10-12 16:45   ` Richard Henderson
2024-10-10 17:52 ` [PATCH v3 2/2] gdbstub/helpers: Introduce ldtul_$endian_p() helpers Philippe Mathieu-Daudé
2024-10-10 18:15   ` Alex Bennée
2024-10-12 16:46   ` Richard Henderson
2024-10-10 17:57 ` [PATCH v3 0/2] gdbstub: " Pierrick Bouvier
2024-10-15 14:38 ` Philippe Mathieu-Daudé

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).