Skip to content

Commit e481c2f

Browse files
chenhuacaigregkh
authored andcommitted
LoongArch: Align ACPI structures if ARCH_STRICT_ALIGN enabled
commit a9d1343 upstream. 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> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 83ca793 commit e481c2f

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

arch/loongarch/include/asm/acenv.h

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,8 @@
1010
#ifndef _ASM_LOONGARCH_ACENV_H
1111
#define _ASM_LOONGARCH_ACENV_H
1212

13-
/*
14-
* This header is required by ACPI core, but we have nothing to fill in
15-
* right now. Will be updated later when needed.
16-
*/
13+
#ifdef CONFIG_ARCH_STRICT_ALIGN
14+
#define ACPI_MISALIGNMENT_NOT_SUPPORTED
15+
#endif /* CONFIG_ARCH_STRICT_ALIGN */
1716

1817
#endif /* _ASM_LOONGARCH_ACENV_H */

0 commit comments

Comments
 (0)