[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20181002094828.GB98058@gmail.com>
Date: Tue, 2 Oct 2018 11:48:28 +0200
From: Ingo Molnar <mingo@...nel.org>
To: Rasmus Villemoes <linux@...musvillemoes.dk>
Cc: Jason Baron <jbaron@...mai.com>,
Andrew Morton <akpm@...ux-foundation.org>,
linux-kernel@...r.kernel.org, x86@...nel.org
Subject: Re: [PATCH 21/22] x86: jump_label: introduce
ASM_STATIC_KEY_INIT_{TRUE,FALSE}
* Rasmus Villemoes <linux@...musvillemoes.dk> wrote:
> These will be useful when defining the contents of (a struct containing)
> a static key in inline assembly.
>
> Cc: x86@...nel.org
> Signed-off-by: Rasmus Villemoes <linux@...musvillemoes.dk>
> ---
> arch/x86/include/asm/jump_label.h | 18 ++++++++++++++++++
> include/linux/jump_label.h | 2 ++
> 2 files changed, 20 insertions(+)
>
> diff --git a/arch/x86/include/asm/jump_label.h b/arch/x86/include/asm/jump_label.h
> index 8c0de4282659..2736f7ff6806 100644
> --- a/arch/x86/include/asm/jump_label.h
> +++ b/arch/x86/include/asm/jump_label.h
> @@ -110,4 +110,22 @@ struct jump_entry {
>
> #endif /* __ASSEMBLY__ */
>
> +#ifdef CONFIG_X86_64
> +#define ASM_STATIC_KEY_INIT_TRUE \
> + "\t.long 1 \t# .enabled\n" \
> + "\t.long 0 \t# <padding>\n" \
> + "\t.quad "__stringify(__JUMP_TYPE_TRUE)"\t# .type\n"
> +#define ASM_STATIC_KEY_INIT_FALSE \
> + "\t.long 0 \t# .enabled\n" \
> + "\t.long 0 \t# <padding>\n" \
> + "\t.quad "__stringify(__JUMP_TYPE_FALSE)"\t# .type\n"
> +#else
> +#define ASM_STATIC_KEY_INIT_TRUE \
> + "\t.long 1 \t# .enabled\n" \
> + "\t.long "__stringify(__JUMP_TYPE_TRUE)"\t# .type\n"
> +#define ASM_STATIC_KEY_INIT_FALSE \
> + "\t.long 0 \t# .enabled\n" \
> + "\t.long "__stringify(__JUMP_TYPE_FALSE)"\t# .type\n"
> +#endif
> +
> #endif
> diff --git a/include/linux/jump_label.h b/include/linux/jump_label.h
> index 1a0b6f17a5d6..6e98193ae708 100644
> --- a/include/linux/jump_label.h
> +++ b/include/linux/jump_label.h
> @@ -132,6 +132,8 @@ struct module;
>
> #ifdef HAVE_JUMP_LABEL
>
> +#define __JUMP_TYPE_FALSE 0
> +#define __JUMP_TYPE_TRUE 1
> #define JUMP_TYPE_FALSE 0UL
> #define JUMP_TYPE_TRUE 1UL
> #define JUMP_TYPE_LINKED 2UL
Looks sane!
Reviewed-by: Ingo Molnar <mingo@...nel.org>
Thanks,
Ingo
Powered by blists - more mailing lists