From: "Arnd Bergmann" <arnd@arndb.de>
To: "Bart Van Assche" <bvanassche@acm.org>,
"Martin K. Petersen" <martin.petersen@oracle.com>
Cc: linux-scsi@vger.kernel.org, "kernel test robot" <lkp@intel.com>,
"James E.J. Bottomley" <jejb@linux.ibm.com>,
"Stanley Chu" <stanley.chu@mediatek.com>,
"Can Guo" <quic_cang@quicinc.com>,
"Manivannan Sadhasivam" <mani@kernel.org>,
"Asutosh Das" <quic_asutoshd@quicinc.com>,
"Bao D. Nguyen" <quic_nguyenb@quicinc.com>,
"Bean Huo" <beanhuo@micron.com>,
"Arthur Simchaev" <Arthur.Simchaev@wdc.com>,
"Avri Altman" <avri.altman@wdc.com>
Subject: Re: [PATCH] scsi: ufs: Fix the build for big endian 32-bit ARM systems
Date: Sun, 27 Aug 2023 20:28:13 -0400 [thread overview]
Message-ID: <2e916711-e2ce-47d2-bdf5-0524dae7e207@app.fastmail.com> (raw)
In-Reply-To: <20230827233042.12945-1-bvanassche@acm.org>
On Sun, Aug 27, 2023, at 19:30, Bart Van Assche wrote:
> Although it is not clear to me why, this patch fixes the following build
> error for big endian 32-bit ARM systems:
>
> include/linux/build_bug.h:78:41: error: static assertion failed:
> "sizeof(struct utp_upiu_header) == 12"
>
> Cc: Arnd Bergmann <arnd@arndb.de>
> Reported-by: kernel test robot <lkp@intel.com>
> Closes:
> https://lore.kernel.org/oe-kbuild-all/202308251634.tuRn4OVv-lkp@intel.com/
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
Reviewed-by: Arnd Bergmann <arnd@arndb.de>
The fix makes sense, but I think the description is wrong:
The weird struct padding on Arm randconfig builds happens
with CONFIG_AEABI disabled (implying the old OABI),
regardless of CONFIG_CPU_BIG_ENDIAN.
> - union {
> - __u8 tm_function;
> - __u8 query_function;
> - };
> + __u8 tm_or_query_function;
> __u8 response;
The problem on OABI is that any struct or union is word
aligned. I would assume that marking the union as __packed
also addresses the problem here, but I have not tested that
and your patch seems fine.
There are bugs like this in many places of the kernel where
the struct alignment actually matters but is broken on OABI,
but the machines that used to run OABI kernels in the
past also run a very small set of drivers in practice.
On my own build test setup, I have made CONFIG_AEABI dependent
on !CONFIG_COMILE_TEST, which prevents me from running into
this problem (and others) on randconfig builds. Maybe I should
try again to send that upstream.
Arnd
next prev parent reply other threads:[~2023-08-28 0:41 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-27 23:30 [PATCH] scsi: ufs: Fix the build for big endian 32-bit ARM systems Bart Van Assche
2023-08-28 0:28 ` Arnd Bergmann [this message]
2023-08-29 16:02 ` Bart Van Assche
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=2e916711-e2ce-47d2-bdf5-0524dae7e207@app.fastmail.com \
--to=arnd@arndb.de \
--cc=Arthur.Simchaev@wdc.com \
--cc=avri.altman@wdc.com \
--cc=beanhuo@micron.com \
--cc=bvanassche@acm.org \
--cc=jejb@linux.ibm.com \
--cc=linux-scsi@vger.kernel.org \
--cc=lkp@intel.com \
--cc=mani@kernel.org \
--cc=martin.petersen@oracle.com \
--cc=quic_asutoshd@quicinc.com \
--cc=quic_cang@quicinc.com \
--cc=quic_nguyenb@quicinc.com \
--cc=stanley.chu@mediatek.com \
/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