Skip to content

Commit

Permalink
Fixed incorrect LLONG alignment for openrisc and cris
Browse files Browse the repository at this point in the history
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>
Resolves: https://gitlab.com/qemu-project/qemu/-/issues/1770
Reviewed-by: Thomas Huth <thuth@redhat.com>
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
(cherry picked from commit 6ee9608)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
  • Loading branch information
Luca Bonissi authored and Michael Tokarev committed Sep 10, 2023
1 parent 40cfe12 commit af0c16f
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions include/exec/user/abitypes.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit af0c16f

Please sign in to comment.