[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20251203091039.125259-1-wangyuli@aosc.io>
Date: Wed, 3 Dec 2025 17:10:39 +0800
From: WangYuli <wangyuli@...c.io>
To: jpoimboe@...nel.org,
peterz@...radead.org,
chenhuacai@...nel.org,
kernel@...0n.name
Cc: yangtiezhu@...ngson.cn,
pmladek@...e.com,
alexandre.chartre@...cle.com,
wangyuli@...c.io,
linux-kernel@...r.kernel.org,
loongarch@...ts.linux.dev,
guanwentao@...ontech.com,
WangYuli <wangyl5933@...naunicom.cn>
Subject: [PATCH] LoongArch: Add klp-build support for live patching
From: WangYuli <wangyl5933@...naunicom.cn>
Add klp-build support for the LoongArch architecture, enabling
automated live patch module generation using objtool.
Signed-off-by: WangYuli <wangyl5933@...naunicom.cn>
---
arch/loongarch/Kconfig | 1 +
tools/objtool/Makefile | 3 ++-
tools/objtool/arch/loongarch/decode.c | 5 +++++
3 files changed, 8 insertions(+), 1 deletion(-)
diff --git a/arch/loongarch/Kconfig b/arch/loongarch/Kconfig
index 1a0a5f9def33..7b5f2a329908 100644
--- a/arch/loongarch/Kconfig
+++ b/arch/loongarch/Kconfig
@@ -159,6 +159,7 @@ config LOONGARCH
select HAVE_KPROBES
select HAVE_KPROBES_ON_FTRACE
select HAVE_KRETPROBES
+ select HAVE_KLP_BUILD
select HAVE_LIVEPATCH
select HAVE_MOD_ARCH_SPECIFIC
select HAVE_NMI
diff --git a/tools/objtool/Makefile b/tools/objtool/Makefile
index ad6e1ec706ce..cead37c25a69 100644
--- a/tools/objtool/Makefile
+++ b/tools/objtool/Makefile
@@ -8,7 +8,8 @@ ifeq ($(SRCARCH),x86)
endif
ifeq ($(SRCARCH),loongarch)
- BUILD_ORC := y
+ BUILD_ORC := y
+ ARCH_HAS_KLP := y
endif
ifeq ($(ARCH_HAS_KLP),y)
diff --git a/tools/objtool/arch/loongarch/decode.c b/tools/objtool/arch/loongarch/decode.c
index 6cd288150f49..674e4efd138f 100644
--- a/tools/objtool/arch/loongarch/decode.c
+++ b/tools/objtool/arch/loongarch/decode.c
@@ -34,6 +34,11 @@ s64 arch_insn_adjusted_addend(struct instruction *insn, struct reloc *reloc)
return reloc_addend(reloc);
}
+u64 arch_adjusted_addend(struct reloc *reloc)
+{
+ return reloc_addend(reloc);
+}
+
bool arch_pc_relative_reloc(struct reloc *reloc)
{
return false;
--
2.51.0
Powered by blists - more mailing lists