From: Guenter Roeck <linux@roeck-us.net>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: Nathan Chancellor <nathan@kernel.org>,
Huacai Chen <chenhuacai@loongson.cn>,
loongarch@lists.linux.dev, Xuefeng Li <lixuefeng@loongson.cn>,
Guo Ren <guoren@kernel.org>, Xuerui Wang <kernel@xen0n.name>,
Jiaxun Yang <jiaxun.yang@flygoat.com>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Binbin Zhou <zhoubinbin@loongson.cn>,
Xi Ruoyao <xry111@xry111.site>
Subject: Re: [PATCH V2] LoongArch: Align ACPI structures if ARCH_STRICT_ALIGN enabled
Date: Fri, 26 Sep 2025 07:31:02 -0700 [thread overview]
Message-ID: <899f2dec-e8b9-44f4-ab8d-001e160a2aed@roeck-us.net> (raw)
In-Reply-To: <CAAhV-H5S8VKKBkNyrWfeuCVv8jS6tNED6YNeAD=i-+wkaoRSDQ@mail.gmail.com>
On Sun, Sep 21, 2025 at 09:07:38AM +0800, Huacai Chen wrote:
> Hi, Nathan,
>
> On Sun, Sep 21, 2025 at 7:48 AM Nathan Chancellor <nathan@kernel.org> wrote:
> >
> > Hi Huacai,
> >
> > On Wed, Sep 10, 2025 at 05:10:33PM +0800, Huacai Chen wrote:
> > > ARCH_STRICT_ALIGN is used for hardware without UAL, now it only control
> > > the -mstrict-align flag. However, ACPI structures are packed by default
> > > so will cause unaligned accesses.
> > >
> > > To avoid this, define ACPI_MISALIGNMENT_NOT_SUPPORTED in asm/acenv.h to
> > > align ACPI structures if ARCH_STRICT_ALIGN enabled.
> > >
> > > Cc: stable@vger.kernel.org
> > > Reported-by: Binbin Zhou <zhoubinbin@loongson.cn>
> > > Suggested-by: Xi Ruoyao <xry111@xry111.site>
> > > Suggested-by: Jiaxun Yang <jiaxun.yang@flygoat.com>
> > > Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
> > > ---
> > > V2: Modify asm/acenv.h instead of Makefile.
> > >
> > > arch/loongarch/include/asm/acenv.h | 7 +++----
> > > 1 file changed, 3 insertions(+), 4 deletions(-)
> > >
> > > diff --git a/arch/loongarch/include/asm/acenv.h b/arch/loongarch/include/asm/acenv.h
> > > index 52f298f7293b..483c955f2ae5 100644
> > > --- a/arch/loongarch/include/asm/acenv.h
> > > +++ b/arch/loongarch/include/asm/acenv.h
> > > @@ -10,9 +10,8 @@
> > > #ifndef _ASM_LOONGARCH_ACENV_H
> > > #define _ASM_LOONGARCH_ACENV_H
> > >
> > > -/*
> > > - * This header is required by ACPI core, but we have nothing to fill in
> > > - * right now. Will be updated later when needed.
> > > - */
> > > +#ifdef CONFIG_ARCH_STRICT_ALIGN
> > > +#define ACPI_MISALIGNMENT_NOT_SUPPORTED
> > > +#endif /* CONFIG_ARCH_STRICT_ALIGN */
> > >
> > > #endif /* _ASM_LOONGARCH_ACENV_H */
> >
> > I am seeing several ACPI errors in my QEMU testing after this change in
> > Linus's tree as commit a9d13433fe17 ("LoongArch: Align ACPI structures
> > if ARCH_STRICT_ALIGN enabled").
> >
> > $ make -skj"$(nproc)" ARCH=loongarch CROSS_COMPILE=loongarch64-linux- clean defconfig vmlinuz.efi
> > kernel/sched/fair.o: warning: objtool: sched_update_scaling() falls through to next function init_entity_runnable_average()
> > mm/mempolicy.o: warning: objtool: alloc_pages_bulk_mempolicy_noprof+0x380: stack state mismatch: reg1[30]=-1+0 reg2[30]=-2-80
> > lib/crypto/mpi/mpih-div.o: warning: objtool: mpihelp_divrem+0x2d0: stack state mismatch: reg1[22]=-1+0 reg2[22]=-2-16
> > In file included from include/acpi/acpi.h:24,
> > from drivers/acpi/acpica/tbprint.c:10:
> > drivers/acpi/acpica/tbprint.c: In function 'acpi_tb_print_table_header':
> > include/acpi/actypes.h:530:43: warning: 'strncmp' argument 1 declared attribute 'nonstring' is smaller than the specified bound 8 [-Wstringop-overread]
> > 530 | #define ACPI_VALIDATE_RSDP_SIG(a) (!strncmp (ACPI_CAST_PTR (char, (a)), ACPI_SIG_RSDP, (sizeof(a) < 8) ? ACPI_NAMESEG_SIZE : 8))
> > | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
> > drivers/acpi/acpica/tbprint.c:105:20: note: in expansion of macro 'ACPI_VALIDATE_RSDP_SIG'
> > 105 | } else if (ACPI_VALIDATE_RSDP_SIG(ACPI_CAST_PTR(struct acpi_table_rsdp,
> > | ^~~~~~~~~~~~~~~~~~~~~~
> > In file included from include/acpi/acpi.h:26:
> > include/acpi/actbl.h:69:14: note: argument 'signature' declared here
> > 69 | char signature[ACPI_NAMESEG_SIZE] ACPI_NONSTRING; /* ASCII table signature */
> > | ^~~~~~~~~
> >From this link this seems a comiler issue (at least not an
> arch-specific kernel issue):
> https://github.com/AOSC-Tracking/linux/commit/1e9ee413357ef58dd902f6ec55013d2a2f2043eb
>
I see that the patch made it into the upstream kernel, now breaking both
mainline and 6.16.y test builds of loongarch64:allmodconfig with gcc.
Since this is apparently intentional, I'll stop build testing
loongarch64:allmodconfig. So far it looks like my qemu tests
are not affected, so I'll continue testing those for the time being.
Guenter
next prev parent reply other threads:[~2025-09-26 14:31 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-09-10 9:10 [PATCH V2] LoongArch: Align ACPI structures if ARCH_STRICT_ALIGN enabled Huacai Chen
2025-09-11 0:59 ` kernel test robot
2025-09-11 8:41 ` Huacai Chen
2025-09-20 23:48 ` Nathan Chancellor
2025-09-21 1:07 ` Huacai Chen
2025-09-26 14:31 ` Guenter Roeck [this message]
2025-09-26 17:15 ` Xi Ruoyao
2025-09-26 18:27 ` Guenter Roeck
2025-10-25 13:02 ` Xi Ruoyao
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=899f2dec-e8b9-44f4-ab8d-001e160a2aed@roeck-us.net \
--to=linux@roeck-us.net \
--cc=chenhuacai@kernel.org \
--cc=chenhuacai@loongson.cn \
--cc=guoren@kernel.org \
--cc=jiaxun.yang@flygoat.com \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=lixuefeng@loongson.cn \
--cc=loongarch@lists.linux.dev \
--cc=nathan@kernel.org \
--cc=stable@vger.kernel.org \
--cc=xry111@xry111.site \
--cc=zhoubinbin@loongson.cn \
/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