lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-ID: <CADRPPNQJfJ=KmRGkX5Uo6VfWDsihrMUKV7OkQ7jtb3+Byb0RLQ@mail.gmail.com>
Date:   Thu, 25 Mar 2021 21:17:33 -0500
From:   Li Yang <leoyang.li@....com>
To:     Arnd Bergmann <arnd@...nel.org>
Cc:     Roy Pledge <roy.pledge@....com>,
        Claudiu Manoil <claudiu.manoil@....com>,
        Scott Wood <oss@...error.net>, Arnd Bergmann <arnd@...db.de>,
        linuxppc-dev <linuxppc-dev@...ts.ozlabs.org>,
        Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
        YueHaibing <yuehaibing@...wei.com>,
        lkml <linux-kernel@...r.kernel.org>, soc@...nel.org,
        Jakub Kicinski <kuba@...nel.org>,
        Lee Jones <lee.jones@...aro.org>,
        "moderated list:ARM/FREESCALE IMX / MXC ARM ARCHITECTURE" 
        <linux-arm-kernel@...ts.infradead.org>,
        Madalin-cristian Bucur <madalin.bucur@....com>
Subject: Re: [PATCH] soc/fsl: qbman: fix conflicting alignment attributes

On Tue, Mar 23, 2021 at 8:17 AM Arnd Bergmann <arnd@...nel.org> wrote:
>
> From: Arnd Bergmann <arnd@...db.de>
>
> When building with W=1, gcc points out that the __packed attribute
> on struct qm_eqcr_entry conflicts with the 8-byte alignment
> attribute on struct qm_fd inside it:
>
> drivers/soc/fsl/qbman/qman.c:189:1: error: alignment 1 of 'struct qm_eqcr_entry' is less than 8 [-Werror=packed-not-aligned]
>
> I assume that the alignment attribute is the correct one, and
> that qm_eqcr_entry cannot actually be unaligned in memory,
> so add the same alignment on the outer struct.
>
> Fixes: c535e923bb97 ("soc/fsl: Introduce DPAA 1.x QMan device driver")
> Signed-off-by: Arnd Bergmann <arnd@...db.de>
> ---
>  drivers/soc/fsl/qbman/qman.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/soc/fsl/qbman/qman.c b/drivers/soc/fsl/qbman/qman.c
> index a1b9be1d105a..fde4edd83c14 100644
> --- a/drivers/soc/fsl/qbman/qman.c
> +++ b/drivers/soc/fsl/qbman/qman.c
> @@ -186,7 +186,7 @@ struct qm_eqcr_entry {
>         __be32 tag;
>         struct qm_fd fd;
>         u8 __reserved3[32];
> -} __packed;
> +} __packed __aligned(8);

The EQCR structure is actually aligned on 64-byte from the manual.
But probably 8 is enough to let the compiler not complain.

>  #define QM_EQCR_VERB_VBIT              0x80
>  #define QM_EQCR_VERB_CMD_MASK          0x61    /* but only one value; */
>  #define QM_EQCR_VERB_CMD_ENQUEUE       0x01
> --
> 2.29.2
>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ