Re: [PATCH] scsi: ufs: Fix the build for big endian 32-bit ARM systems

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxx>
> Reported-by: kernel test robot <lkp@xxxxxxxxx>
> Closes: 
> https://lore.kernel.org/oe-kbuild-all/202308251634.tuRn4OVv-lkp@xxxxxxxxx/
> Signed-off-by: Bart Van Assche <bvanassche@xxxxxxx>

Reviewed-by: Arnd Bergmann <arnd@xxxxxxxx>

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



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [SCSI Target Devel]     [Linux SCSI Target Infrastructure]     [Kernel Newbies]     [IDE]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux ATA RAID]     [Linux IIO]     [Samba]     [Device Mapper]

  Powered by Linux