public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH V2] LoongArch: Align ACPI structures if ARCH_STRICT_ALIGN enabled
@ 2025-09-10  9:10 Huacai Chen
  2025-09-11  0:59 ` kernel test robot
  2025-09-20 23:48 ` Nathan Chancellor
  0 siblings, 2 replies; 9+ messages in thread
From: Huacai Chen @ 2025-09-10  9:10 UTC (permalink / raw)
  To: Huacai Chen
  Cc: loongarch, Xuefeng Li, Guo Ren, Xuerui Wang, Jiaxun Yang,
	linux-kernel, Huacai Chen, stable, Binbin Zhou, Xi Ruoyao

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 */
-- 
2.47.3


^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2025-10-25 13:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
2025-09-26 17:15       ` Xi Ruoyao
2025-09-26 18:27         ` Guenter Roeck
2025-10-25 13:02           ` Xi Ruoyao

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox