summaryrefslogtreecommitdiff
path: root/arch/loongarch/kernel/inst.c
diff options
context:
space:
mode:
authorYouling Tang <tangyouling@kylinos.cn>2026-04-22 15:45:13 +0800
committerHuacai Chen <chenhuacai@loongson.cn>2026-04-22 15:45:13 +0800
commit2c749f734ebfe350da55bf40ea55444fb85d4055 (patch)
treef24857a685e38da16ec58fb2468528a47d917a1e /arch/loongarch/kernel/inst.c
parentadf346e500647d91d115e1319f04c3c7972620d9 (diff)
LoongArch: Batch the icache maintenance for jump_label
Switch to the batched version of the jump label update functions so instruction cache maintenance is deferred until the end of the update. Signed-off-by: Youling Tang <tangyouling@kylinos.cn> Signed-off-by: Huacai Chen <chenhuacai@loongson.cn>
Diffstat (limited to 'arch/loongarch/kernel/inst.c')
-rw-r--r--arch/loongarch/kernel/inst.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/arch/loongarch/kernel/inst.c b/arch/loongarch/kernel/inst.c
index 1a728082944c..0b9228b7c13a 100644
--- a/arch/loongarch/kernel/inst.c
+++ b/arch/loongarch/kernel/inst.c
@@ -209,6 +209,9 @@ int larch_insn_write(void *addr, u32 insn)
int ret;
unsigned long flags = 0;
+ if ((unsigned long)addr & 3)
+ return -EINVAL;
+
raw_spin_lock_irqsave(&patch_lock, flags);
ret = copy_to_kernel_nofault(addr, &insn, LOONGARCH_INSN_SIZE);
raw_spin_unlock_irqrestore(&patch_lock, flags);
@@ -221,9 +224,6 @@ int larch_insn_patch_text(void *addr, u32 insn)
int ret;
u32 *tp = addr;
- if ((unsigned long)tp & 3)
- return -EINVAL;
-
ret = larch_insn_write(tp, insn);
if (!ret)
flush_icache_range((unsigned long)tp,