]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
LoongArch: Make -mstrict-align configurable
authorHuacai Chen <chenhuacai@loongson.cn>
Sat, 25 Feb 2023 07:52:56 +0000 (15:52 +0800)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 16 Jun 2023 12:57:57 +0000 (14:57 +0200)
commit45698d05aa3f387cb8f19cdb81ec8e6451282e26
tree924a0efc2f1d72bff3eb8e08ccfe5cc2b8d7c8de
parentd222f74e0aa6d85526a8d83634f66ec36a228f9f
LoongArch: Make -mstrict-align configurable

BugLink: https://bugs.launchpad.net/bugs/2023929
commit 41596803302d83a67a80dc1efef4e51ac46acabb upstream.

Introduce Kconfig option ARCH_STRICT_ALIGN to make -mstrict-align be
configurable.

Not all LoongArch cores support h/w unaligned access, we can use the
-mstrict-align build parameter to prevent unaligned accesses.

CPUs with h/w unaligned access support:
Loongson-2K2000/2K3000/3A5000/3C5000/3D5000.

CPUs without h/w unaligned access support:
Loongson-2K500/2K1000.

This option is enabled by default to make the kernel be able to run on
all LoongArch systems. But you can disable it manually if you want to
run kernel only on systems with h/w unaligned access support in order to
optimise for performance.

Reviewed-by: Arnd Bergmann <arnd@arndb.de>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
arch/loongarch/Kconfig
arch/loongarch/Makefile
arch/loongarch/kernel/Makefile
arch/loongarch/kernel/traps.c