Re: [PATCH v2 5/6] powerpc/64: Add support for out-of-line static calls
From: Christophe Leroy <hidden>
Date: 2022-09-27 06:03:01
Le 27/09/2022 à 05:21, Benjamin Gray a écrit :
On Mon, 2022-09-26 at 14:54 +0000, Christophe Leroy wrote:quoted
quoted
diff --git a/arch/powerpc/kernel/static_call.cb/arch/powerpc/kernel/static_call.c index 863a7aa24650..ecbb74e1b4d3 100644--- a/arch/powerpc/kernel/static_call.c +++ b/arch/powerpc/kernel/static_call.c@@ -4,30 +4,108 @@ #include <asm/code-patching.h> +static void* ppc_function_toc(u32 *func) +{ +#ifdef CONFIG_PPC64_ELF_ABI_V2Can you use IS_ENABLED(CONFIG_PPC64_ELF_ABI_V2) instead ?I tried when implementing it, but the `(u64) func` cast is an issue. I could side step it and use `unsigned long` if that's preferable? Otherwise I like being explicit about the size, it's a delicate function.
It is always better to have code that builds independant of config options. I helps with build converage, you don't have to build thousands of defconfigs in order to cover all options. See https://docs.kernel.org/process/coding-style.html#conditional-compilation For me, using "unsigned long" is more explicit than u64 when it represents the value of a pointer.