To: | Linus Torvalds <torvalds@linux-foundation.org> |
---|---|
Subject: | Re: [PATCH v6 2/8] module: use relative references for __ksymtab entries |
From: | Ard Biesheuvel <ard.biesheuvel@linaro.org> |
Date: | Wed, 27 Dec 2017 20:11:19 +0000 |
Cc: | Linux Kernel Mailing List <linux-kernel@vger.kernel.org>, "H. Peter Anvin" <hpa@zytor.com>, Ralf Baechle <ralf@linux-mips.org>, Arnd Bergmann <arnd@arndb.de>, Heiko Carstens <heiko.carstens@de.ibm.com>, Kees Cook <keescook@chromium.org>, Will Deacon <will.deacon@arm.com>, Michael Ellerman <mpe@ellerman.id.au>, Thomas Garnier <thgarnie@google.com>, Thomas Gleixner <tglx@linutronix.de>, "Serge E. Hallyn" <serge@hallyn.com>, Bjorn Helgaas <bhelgaas@google.com>, Benjamin Herrenschmidt <benh@kernel.crashing.org>, Russell King <linux@armlinux.org.uk>, Paul Mackerras <paulus@samba.org>, Catalin Marinas <catalin.marinas@arm.com>, "David S. Miller" <davem@davemloft.net>, Petr Mladek <pmladek@suse.com>, Ingo Molnar <mingo@redhat.com>, James Morris <james.l.morris@oracle.com>, Andrew Morton <akpm@linux-foundation.org>, Nicolas Pitre <nico@linaro.org>, Josh Poimboeuf <jpoimboe@redhat.com>, Steven Rostedt <rostedt@goodmis.org>, Martin Schwidefsky <schwidefsky@de.ibm.com>, Sergey Senozhatsky <sergey.senozhatsky@gmail.com>, Jessica Yu <jeyu@kernel.org>, linux-arm-kernel@lists.infradead.org, linux-mips <linux-mips@linux-mips.org>, ppc-dev <linuxppc-dev@lists.ozlabs.org>, linux-s390 <linux-s390@vger.kernel.org>, sparclinux@vger.kernel.org, "the arch/x86 maintainers" <x86@kernel.org>, Ingo Molnar <mingo@kernel.org> |
Dkim-signature: | v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=VVfQQocN2/lcA25k4kJ1I4Rwj8JbQqo8xX8ZWGTSl94=; b=a4cQOZe2sfju8bSqJ0qAmWf5/vMFTmsOJq5hTej7j1gu+XOJ0enWWN+21RX6MmdxNw 25UlQHFalc98jqrMjB3oo5WErmPqP7v7mbvfY2F6ADttJRnAj/oxVC375PiwZYSqF5Vc yZ0GPYGlcKdfdpSAs69o5pohFBvvOJ5aMAr9c= |
In-reply-to: | <CA+55aFxqJqJq_7VUzBVTppgXFPc-8Ou55iLsZjp3fr6B2gRyTQ@mail.gmail.com> |
List-archive: | <http://www.linux-mips.org/archives/linux-mips/> |
List-help: | <mailto:ecartis@linux-mips.org?Subject=help> |
List-id: | linux-mips <linux-mips.eddie.linux-mips.org> |
List-owner: | <mailto:ralf@linux-mips.org> |
List-post: | <mailto:linux-mips@linux-mips.org> |
List-software: | Ecartis version 1.0.0 |
List-subscribe: | <mailto:ecartis@linux-mips.org?subject=subscribe%20linux-mips> |
List-unsubscribe: | <mailto:ecartis@linux-mips.org?subject=unsubscribe%20linux-mips> |
Original-recipient: | rfc822;linux-mips@linux-mips.org |
References: | <20171227085033.22389-1-ard.biesheuvel@linaro.org> <20171227085033.22389-3-ard.biesheuvel@linaro.org> <CA+55aFxqJqJq_7VUzBVTppgXFPc-8Ou55iLsZjp3fr6B2gRyTQ@mail.gmail.com> |
Sender: | linux-mips-bounce@linux-mips.org |
On 27 December 2017 at 20:07, Linus Torvalds <torvalds@linux-foundation.org> wrote: > On Wed, Dec 27, 2017 at 12:50 AM, Ard Biesheuvel > <ard.biesheuvel@linaro.org> wrote: >> diff --git a/include/linux/compiler.h b/include/linux/compiler.h >> index 52e611ab9a6c..fe752d365334 100644 >> --- a/include/linux/compiler.h >> +++ b/include/linux/compiler.h >> @@ -327,4 +327,15 @@ static __always_inline void __write_once_size(volatile >> void *p, void *res, int s >> compiletime_assert(__native_word(t), \ >> "Need native word sized stores/loads for atomicity.") >> >> +/* >> + * Force the compiler to emit 'sym' as a symbol, so that we can reference >> + * it from inline assembler. Necessary in case 'sym' could be inlined >> + * otherwise, or eliminated entirely due to lack of references that are >> + * visibile to the compiler. >> + */ >> +#define __ADDRESSABLE(sym) \ >> + static void *__attribute__((section(".discard.text"), used)) \ >> + __PASTE(__discard_##sym, __LINE__)(void) \ >> + { return (void *)&sym; } \ >> + >> #endif /* __LINUX_COMPILER_H */ > > Isn't this logically the point where you should add the arm64 > vmlinux.lds.S change, and explain how ".discard.text" turns into > ".init.discard.text" for some odd arm64 reason? > I tried to keep the generic patches generic, so perhaps I should just put the arm64 vmlinux.lds.S change in a patch on its own? |
Previous by Date: | Re: [PATCH v6 2/8] module: use relative references for __ksymtab entries, Linus Torvalds |
---|---|
Next by Date: | Re: [PATCH v6 2/8] module: use relative references for __ksymtab entries, Linus Torvalds |
Previous by Thread: | Re: [PATCH v6 2/8] module: use relative references for __ksymtab entries, Linus Torvalds |
Next by Thread: | Re: [PATCH v6 2/8] module: use relative references for __ksymtab entries, Linus Torvalds |
Indexes: | [Date] [Thread] [Top] [All Lists] |