From: Thomas Huth <thuth@redhat.com>
To: Luca Bonissi <qemu@bonslack.org>,
qemu-devel@nongnu.org, Laurent Vivier <laurent@vivier.eu>
Subject: Re: stat64 wrong on sparc64 user
Date: Tue, 28 Mar 2023 14:41:19 +0200 [thread overview]
Message-ID: <213f660d-550b-c18f-8548-3a44495fc1b4@redhat.com> (raw)
In-Reply-To: <d49d441a-01a6-d38d-2bc8-98b9658a288e@bonslack.org>
On 28/03/2023 14.22, Luca Bonissi wrote:
> On 28/03/23 13:55, Thomas Huth wrote:
>> On 28/03/2023 13.48, Luca Bonissi wrote:
>>> --- qemu-20230327/linux-user/syscall_defs.h 2023-03-27
>>> 15:41:42.000000000 +0200
>>> +++ qemu-20230327/linux-user/syscall_defs.h.new 2023-03-27
>>> 21:43:25.615115126 +0200
>>> @@ -1450,7 +1450,7 @@ struct target_stat {
>>> unsigned int st_dev;
>>> abi_ulong st_ino;
>>> unsigned int st_mode;
>>> - unsigned int st_nlink;
>>> + short int st_nlink;
>>> unsigned int st_uid;
>>
>> That looks wrong at a first glance. IIRC Sparc is a very strictly aligned
>> architecture, so if the previous field "st_mode" was aligned to a 4-byte
>> boundary, the "st_uid" field now would not be aligned anymore... are you
>> sure about this change? Maybe it needs a padding field now?
>
> The padding is automatic (either on Sparc or x86-64): short will be aligned
> to 2-byte boundary, int will be aligned to 4-byte boundary, long will be
> aligned to 8-byte boundary.
Ah, right, I blindly assumed that we were using __attribute__((packed)) here
for such structs... but that does not seem to be the case, so never mind.
Thomas
next prev parent reply other threads:[~2023-03-28 12:42 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-03-28 11:48 stat64 wrong on sparc64 user Luca Bonissi
2023-03-28 11:55 ` Thomas Huth
2023-03-28 12:22 ` Luca Bonissi
2023-03-28 12:41 ` Thomas Huth [this message]
2023-03-29 16:22 ` Laurent Vivier
2023-03-30 11:13 ` Luca Bonissi
2023-03-28 14:52 ` Richard Henderson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=213f660d-550b-c18f-8548-3a44495fc1b4@redhat.com \
--to=thuth@redhat.com \
--cc=laurent@vivier.eu \
--cc=qemu-devel@nongnu.org \
--cc=qemu@bonslack.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).