From mboxrd@z Thu Jan 1 00:00:00 1970 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752303AbeAER6o (ORCPT + 1 other); Fri, 5 Jan 2018 12:58:44 -0500 Received: from usa-sjc-mx-foss1.foss.arm.com ([217.140.101.70]:47960 "EHLO foss.arm.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752027AbeAER6n (ORCPT ); Fri, 5 Jan 2018 12:58:43 -0500 Date: Fri, 5 Jan 2018 17:58:34 +0000 From: Catalin Marinas To: Ard Biesheuvel Cc: linux-kernel@vger.kernel.org, linux-mips@linux-mips.org, Benjamin Herrenschmidt , Will Deacon , Paul Mackerras , "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-s390@vger.kernel.org, Nicolas Pitre , Michael Ellerman , x86@kernel.org, Russell King , Ingo Molnar , "Serge E. Hallyn" , Petr Mladek , Kees Cook , Arnd Bergmann , Heiko Carstens , Steven Rostedt , James Morris , Josh Poimboeuf , Bjorn Helgaas , Thomas Gleixner , linux-arm-kernel@lists.infradead.org, linuxppc-dev@lists.ozlabs.org, Ralf Baechle , Thomas Garnier , Sergey Senozhatsky , Jessica Yu , Martin Schwidefsky , Andrew Morton , Linus Torvalds , "David S. Miller" Subject: Re: [PATCH v7 07/10] kernel/jump_label: abstract jump_entry member accessors Message-ID: <20180105175834.vqgpsme7itsdg54u@armageddon.cambridge.arm.com> References: <20180102200549.22984-1-ard.biesheuvel@linaro.org> <20180102200549.22984-8-ard.biesheuvel@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20180102200549.22984-8-ard.biesheuvel@linaro.org> User-Agent: NeoMutt/20170113 (1.7.2) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Return-Path: On Tue, Jan 02, 2018 at 08:05:46PM +0000, Ard Biesheuvel wrote: > diff --git a/arch/arm/include/asm/jump_label.h b/arch/arm/include/asm/jump_label.h > index e12d7d096fc0..7b05b404063a 100644 > --- a/arch/arm/include/asm/jump_label.h > +++ b/arch/arm/include/asm/jump_label.h > @@ -45,5 +45,32 @@ struct jump_entry { > jump_label_t key; > }; > > +static inline jump_label_t jump_entry_code(const struct jump_entry *entry) > +{ > + return entry->code; > +} > + > +static inline struct static_key *jump_entry_key(const struct jump_entry *entry) > +{ > + return (struct static_key *)((unsigned long)entry->key & ~1UL); > +} > + > +static inline bool jump_entry_is_branch(const struct jump_entry *entry) > +{ > + return (unsigned long)entry->key & 1UL; > +} > + > +static inline bool jump_entry_is_module_init(const struct jump_entry *entry) > +{ > + return entry->code == 0; > +} > + > +static inline void jump_entry_set_module_init(struct jump_entry *entry) > +{ > + entry->code = 0; > +} > + > +#define jump_label_swap NULL Is there any difference between these functions on any of the architectures touched? Even with the relative offset, arm64 and x86 looked the same to me (well, I may have missed some detail). -- Catalin