From: Joe Lawrence <joe.lawrence@redhat.com>
To: George Guo <dongtai.guo@linux.dev>
Cc: chenhuacai@kernel.org, jpoimboe@kernel.org, peterz@infradead.org,
jikos@kernel.org, mbenes@suse.cz, pmladek@suse.com,
kernel@xen0n.name, rostedt@goodmis.org, ardb@kernel.org,
nathan@kernel.org, nick.desaulniers+lkml@gmail.com,
yangtiezhu@loongson.cn, jiaxun.yang@flygoat.com,
liukexin@kylinos.cn, guodongtai@kylinos.cn, xry111@xry111.site,
wangyuli@aosc.io, loongarch@lists.linux.dev,
live-patching@vger.kernel.org, llvm@lists.linux.dev,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH v3 07/12] klp-build: Add LoongArch syscall patching macro
Date: Wed, 8 Jul 2026 15:18:07 -0400 [thread overview]
Message-ID: <ak6ibxwACKMK8it2@redhat.com> (raw)
In-Reply-To: <20260707072031.231066-8-dongtai.guo@linux.dev>
On Tue, Jul 07, 2026 at 03:20:26PM +0800, George Guo wrote:
> From: George Guo <guodongtai@kylinos.cn>
>
> Add LoongArch support for KLP_SYSCALL_DEFINEx(), mirroring the generic
> __SYSCALL_DEFINEx() pattern from include/linux/syscalls.h.
>
> Co-developed-by: Kexin Liu <liukexin@kylinos.cn>
> Signed-off-by: Kexin Liu <liukexin@kylinos.cn>
> Signed-off-by: George Guo <guodongtai@kylinos.cn>
> ---
> include/linux/livepatch_helpers.h | 22 ++++++++++++++++++++++
> 1 file changed, 22 insertions(+)
>
> diff --git a/include/linux/livepatch_helpers.h b/include/linux/livepatch_helpers.h
> index 4b647b83865f..a8aad067177b 100644
> --- a/include/linux/livepatch_helpers.h
> +++ b/include/linux/livepatch_helpers.h
> @@ -91,6 +91,28 @@
> } \
> static inline long __klp_do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
>
> +#elif defined(CONFIG_LOONGARCH)
> +
> +#define __KLP_SYSCALL_DEFINEx(x, name, ...) \
> + __diag_push(); \
> + __diag_ignore(GCC, 8, "-Wattribute-alias", \
> + "Type aliasing is used to sanitize syscall arguments");\
> + asmlinkage long sys##name(__MAP(x,__SC_DECL,__VA_ARGS__)) \
> + __attribute__((alias(__stringify(__se_sys##name)))); \
> + ALLOW_ERROR_INJECTION(sys##name, ERRNO); \
> + static inline long __klp_do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__));\
> + asmlinkage long __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)); \
> + asmlinkage long __attribute__((optimize("-fno-optimize-sibling-calls")))\
> + __se_sys##name(__MAP(x,__SC_LONG,__VA_ARGS__)) \
> + { \
> + long ret = __klp_do_sys##name(__MAP(x,__SC_CAST,__VA_ARGS__));\
> + __MAP(x,__SC_TEST,__VA_ARGS__); \
> + __PROTECT(x, ret,__MAP(x,__SC_ARGS,__VA_ARGS__)); \
> + return ret; \
> + } \
> + __diag_pop(); \
> + static inline long __klp_do_sys##name(__MAP(x,__SC_DECL,__VA_ARGS__))
> +
> #endif
Nit: The other macros in livepatch_helpers use tabs to pad out to the
line continuation '\'.
--
Joe
next prev parent reply other threads:[~2026-07-08 19:18 UTC|newest]
Thread overview: 27+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-07 7:20 [PATCH v3 00/12] LoongArch: Add livepatch build (KLP) support George Guo
2026-07-07 7:20 ` [PATCH v3 01/12] objtool/LoongArch: Add arch_adjusted_addend() for KLP support George Guo
2026-07-07 7:20 ` [PATCH v3 02/12] LoongArch: Mark special sections " George Guo
2026-07-08 22:32 ` Joe Lawrence
2026-07-13 14:33 ` George Guo
2026-07-07 7:20 ` [PATCH v3 03/12] livepatch/klp-build: disable direct-extern-access for LoongArch to fix kernel panic George Guo
2026-07-07 7:20 ` [PATCH v3 04/12] livepatch/klp-build: build LoongArch with -fPIC to keep GOT-indirect symbol references George Guo
2026-07-08 15:05 ` Joe Lawrence
2026-07-10 7:38 ` George Guo
2026-07-07 7:20 ` [PATCH v3 05/12] LoongArch: Fix EFI linking with -fdata-sections George Guo
2026-07-08 13:54 ` Joe Lawrence
2026-07-08 16:07 ` Joe Lawrence
2026-07-10 7:46 ` George Guo
2026-07-07 7:20 ` [PATCH v3 06/12] objtool/klp: Add LoongArch jump opcode bytes support George Guo
2026-07-07 7:20 ` [PATCH v3 07/12] klp-build: Add LoongArch syscall patching macro George Guo
2026-07-08 19:18 ` Joe Lawrence [this message]
2026-07-10 7:49 ` George Guo
2026-07-07 7:20 ` [PATCH v3 08/12] LoongArch: Add livepatch build (KLP) support George Guo
2026-07-07 7:20 ` [PATCH v3 09/12] LoongArch: Select FTRACE_MCOUNT_USE_PATCHABLE_FUNCTION_ENTRY George Guo
2026-07-07 7:20 ` [PATCH v3 10/12] objtool/klp: Convert local label references in special sections George Guo
2026-07-07 7:20 ` [PATCH v3 11/12] objtool/klp: Fix ANNOTATE_DATA_SPECIAL parsing for local label references George Guo
2026-07-07 7:20 ` [PATCH v3 12/12] objtool/klp: Fold LoongArch paired ADD/SUB relocations into PCREL George Guo
2026-07-08 13:29 ` Xi Ruoyao
2026-07-09 9:43 ` [PATCH v3 00/12] LoongArch: Add livepatch build (KLP) support Huacai Chen
2026-07-09 10:35 ` WangYuli
2026-07-09 13:21 ` George Guo
2026-07-10 14:34 ` Huacai Chen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ak6ibxwACKMK8it2@redhat.com \
--to=joe.lawrence@redhat.com \
--cc=ardb@kernel.org \
--cc=chenhuacai@kernel.org \
--cc=dongtai.guo@linux.dev \
--cc=guodongtai@kylinos.cn \
--cc=jiaxun.yang@flygoat.com \
--cc=jikos@kernel.org \
--cc=jpoimboe@kernel.org \
--cc=kernel@xen0n.name \
--cc=linux-kernel@vger.kernel.org \
--cc=liukexin@kylinos.cn \
--cc=live-patching@vger.kernel.org \
--cc=llvm@lists.linux.dev \
--cc=loongarch@lists.linux.dev \
--cc=mbenes@suse.cz \
--cc=nathan@kernel.org \
--cc=nick.desaulniers+lkml@gmail.com \
--cc=peterz@infradead.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=wangyuli@aosc.io \
--cc=xry111@xry111.site \
--cc=yangtiezhu@loongson.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.