[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAK8P3a0-S77QLR1dK3NT6ot7JTAD5AdojAZJr-Xi112-v5EOdw@mail.gmail.com>
Date: Mon, 30 May 2022 14:43:45 +0200
From: Arnd Bergmann <arnd@...db.de>
To: Jani Nikula <jani.nikula@...el.com>
Cc: Linus Torvalds <torvalds@...ux-foundation.org>,
Arnd Bergmann <arnd@...db.de>,
Sudip Mukherjee <sudipm.mukherjee@...il.com>,
Russell King <linux@...linux.org.uk>,
Viresh Kumar <vireshk@...nel.org>,
Shiraz Hashim <shiraz.linux.kernel@...il.com>,
Ville Syrjälä <ville.syrjala@...ux.intel.com>,
Maarten Lankhorst <maarten.lankhorst@...ux.intel.com>,
Maxime Ripard <mripard@...nel.org>,
Thomas Zimmermann <tzimmermann@...e.de>,
David Airlie <airlied@...ux.ie>,
Daniel Vetter <daniel@...ll.ch>,
dri-devel <dri-devel@...ts.freedesktop.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
Linux ARM <linux-arm-kernel@...ts.infradead.org>,
SoC Team <soc@...nel.org>
Subject: Re: mainline build failure due to f1e4c916f97f ("drm/edid: add EDID
block count and size helpers")
On Mon, May 30, 2022 at 11:33 AM Jani Nikula <jani.nikula@...el.com> wrote:
>
> That is, for EDID. Makes you wonder about all the other packed structs
> with enum members across the kernel.
It is not the 'enum' that is special here, it's the 'union' having
unpacked members,
and the same thing happens when you have nested structs: both the inner
and the outer aggregate need to be packed, either with __packed at the
end, or on each individual member that is not fully aligned to
max(sizeof(member), 4)).
I think in general, most __packed annotations we have in the kernel are
completely pointless because they do not change the structure layout on
any architecture but instead just make member access slower on
architectures that lack unaligned load/store instructions. There have
definitely been other cases though where a __packed annotation is
not needed on any sane architecture but is needed for OABI ARM.
Overall I'm not that worried because the only machines running OABI
kernels would be on really old hardware that runs a limited set of
driver code.
A completely different matter are the extraneous __packed annotations
that lead to possible problems when accessed through a misaligned
pointer. We ignore -Waddress-of-packed-member and -Wcast-align
in the kernel, so these never get caught at build time, but we have
seen bugs from gcc making incorrect assumptions about alignment
even on architectures that have unaligned load/store instructions.
Arnd
Powered by blists - more mailing lists