LoongArch: Add alternative runtime patching mechanism
authorHuacai Chen <chenhuacai@loongson.cn>
Sat, 10 Dec 2022 14:39:59 +0000 (22:39 +0800)
committerHuacai Chen <chenhuacai@loongson.cn>
Wed, 14 Dec 2022 00:36:11 +0000 (08:36 +0800)
commit19e5eb15b00c5841b4b9bd9777af2865a40d2f39
treef471107baccd8668f7cd72a2e8f5b5f690e30506
parent61a6fccc0bd2e8030b2672a52ef3f6706b2b2ee4
LoongArch: Add alternative runtime patching mechanism

Introduce the "alternative" mechanism from ARM64 and x86 for LoongArch
to apply runtime patching. The main purpose of this patch is to provide
a framework. In future we can use this mechanism (i.e., the ALTERNATIVE
and ALTERNATIVE_2 macros) to optimize hotspot functions according to cpu
features.

Signed-off-by: Jun Yi <yijun@loongson.cn>
Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
arch/loongarch/include/asm/alternative-asm.h [new file with mode: 0644]
arch/loongarch/include/asm/alternative.h [new file with mode: 0644]
arch/loongarch/include/asm/bugs.h [new file with mode: 0644]
arch/loongarch/include/asm/inst.h
arch/loongarch/kernel/Makefile
arch/loongarch/kernel/alternative.c [new file with mode: 0644]
arch/loongarch/kernel/module.c
arch/loongarch/kernel/setup.c
arch/loongarch/kernel/vmlinux.lds.S