qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] Fixed incorrect LLONG alignment for openrisc and cris
@ 2023-08-03  0:29 Luca Bonissi
  2023-08-03  4:42 ` Thomas Huth
  0 siblings, 1 reply; 3+ messages in thread
From: Luca Bonissi @ 2023-08-03  0:29 UTC (permalink / raw)
  To: Laurent Vivier, Thomas Huth; +Cc: qemu-devel, Richard Henderson, Peter Maydell

From: Luca Bonissi <qemu@bonslack.org>
Date: Thu, 3 Aug 2023 02:15:57 +0200
Subject: [PATCH] Fixed incorrect LLONG alignment for openrisc and cris

OpenRISC (or1k) has long long alignment to 4 bytes, but currently not
defined in abitypes.h. This lead to incorrect packing of /epoll_event/
structure and eventually infinite loop while waiting for file
descriptor[s] event[s].

Fixed also CRIS alignments (1 byte for all types).

Signed-off-by: Luca Bonissi <qemu@bonslack.org>
---
  include/exec/user/abitypes.h | 8 ++++++++
  1 file changed, 8 insertions(+)

diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h
index 6191ce9f74..6178453d94 100644
--- a/include/exec/user/abitypes.h
+++ b/include/exec/user/abitypes.h
@@ -15,8 +15,16 @@
  #define ABI_LLONG_ALIGNMENT 2
  #endif

+#ifdef TARGET_CRIS
+#define ABI_SHORT_ALIGNMENT 1
+#define ABI_INT_ALIGNMENT 1
+#define ABI_LONG_ALIGNMENT 1
+#define ABI_LLONG_ALIGNMENT 1
+#endif
+
  #if (defined(TARGET_I386) && !defined(TARGET_X86_64)) \
      || defined(TARGET_SH4) \
+    || defined(TARGET_OPENRISC) \
      || defined(TARGET_MICROBLAZE) \
      || defined(TARGET_NIOS2)
  #define ABI_LLONG_ALIGNMENT 4
-- 
2.35.8



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

* Re: [PATCH] Fixed incorrect LLONG alignment for openrisc and cris
  2023-08-03  0:29 [PATCH] Fixed incorrect LLONG alignment for openrisc and cris Luca Bonissi
@ 2023-08-03  4:42 ` Thomas Huth
  2023-08-05  6:58   ` Michael Tokarev
  0 siblings, 1 reply; 3+ messages in thread
From: Thomas Huth @ 2023-08-03  4:42 UTC (permalink / raw)
  To: Luca Bonissi, Laurent Vivier
  Cc: qemu-devel, Richard Henderson, Peter Maydell, Stafford Horne,
	Jia Liu, Edgar E. Iglesias, QEMU Trivial

On 03/08/2023 02.29, Luca Bonissi wrote:
> From: Luca Bonissi <qemu@bonslack.org>
> Date: Thu, 3 Aug 2023 02:15:57 +0200
> Subject: [PATCH] Fixed incorrect LLONG alignment for openrisc and cris
> 
> OpenRISC (or1k) has long long alignment to 4 bytes, but currently not
> defined in abitypes.h. This lead to incorrect packing of /epoll_event/
> structure and eventually infinite loop while waiting for file
> descriptor[s] event[s].
> 
> Fixed also CRIS alignments (1 byte for all types).
> 
> Signed-off-by: Luca Bonissi <qemu@bonslack.org>
> ---
>   include/exec/user/abitypes.h | 8 ++++++++
>   1 file changed, 8 insertions(+)
> 
> diff --git a/include/exec/user/abitypes.h b/include/exec/user/abitypes.h
> index 6191ce9f74..6178453d94 100644
> --- a/include/exec/user/abitypes.h
> +++ b/include/exec/user/abitypes.h
> @@ -15,8 +15,16 @@
>   #define ABI_LLONG_ALIGNMENT 2
>   #endif
> 
> +#ifdef TARGET_CRIS
> +#define ABI_SHORT_ALIGNMENT 1
> +#define ABI_INT_ALIGNMENT 1
> +#define ABI_LONG_ALIGNMENT 1
> +#define ABI_LLONG_ALIGNMENT 1
> +#endif
> +
>   #if (defined(TARGET_I386) && !defined(TARGET_X86_64)) \
>       || defined(TARGET_SH4) \
> +    || defined(TARGET_OPENRISC) \
>       || defined(TARGET_MICROBLAZE) \
>       || defined(TARGET_NIOS2)
>   #define ABI_LLONG_ALIGNMENT 4

Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1770
Reviewed-by: Thomas Huth <thuth@redhat.com>



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

* Re: [PATCH] Fixed incorrect LLONG alignment for openrisc and cris
  2023-08-03  4:42 ` Thomas Huth
@ 2023-08-05  6:58   ` Michael Tokarev
  0 siblings, 0 replies; 3+ messages in thread
From: Michael Tokarev @ 2023-08-05  6:58 UTC (permalink / raw)
  To: Thomas Huth, Luca Bonissi, Laurent Vivier
  Cc: qemu-devel, Richard Henderson, Peter Maydell, Stafford Horne,
	Jia Liu, Edgar E. Iglesias, QEMU Trivial

03.08.2023 07:42, Thomas Huth wrote:
> On 03/08/2023 02.29, Luca Bonissi wrote:
>> From: Luca Bonissi <qemu@bonslack.org>
>> Date: Thu, 3 Aug 2023 02:15:57 +0200
>> Subject: [PATCH] Fixed incorrect LLONG alignment for openrisc and cris
>>
>> OpenRISC (or1k) has long long alignment to 4 bytes, but currently not
>> defined in abitypes.h. This lead to incorrect packing of /epoll_event/
>> structure and eventually infinite loop while waiting for file
>> descriptor[s] event[s].
>>
>> Fixed also CRIS alignments (1 byte for all types).

Applied to my trivial-patches tree, thanks!

/mjt


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

end of thread, other threads:[~2023-08-05  6:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-08-03  0:29 [PATCH] Fixed incorrect LLONG alignment for openrisc and cris Luca Bonissi
2023-08-03  4:42 ` Thomas Huth
2023-08-05  6:58   ` Michael Tokarev

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).