From: Will Deacon <will.deacon@arm.com>
To: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: linux-kernel@vger.kernel.org, Arnd Bergmann <arnd@arndb.de>,
Kees Cook <keescook@chromium.org>,
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>,
Petr Mladek <pmladek@suse.com>, Ingo Molnar <mingo@redhat.com>,
James Morris <jmorris@namei.org>,
Andrew Morton <akpm@linux-foundation.org>,
Nicolas Pitre <nico@linaro.org>,
Josh Poimboeuf <jpoimboe@redhat.com>,
Steven Rostedt <rostedt@goodmis.org>,
Sergey Senozhatsky <sergey.senozhatsky@gmail.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
Jessica Yu <jeyu@kernel.org>,
linux-arm-kernel@lists.infradead.org,
linuxppc-dev@lists.ozlabs.org, x86@kernel.org,
Ingo Molnar <mingo@kernel.org>
Subject: Re: [PATCH v9 3/6] module: use relative references for __ksymtab entries
Date: Wed, 27 Jun 2018 16:13:39 +0100 [thread overview]
Message-ID: <20180627151339.GD30631@arm.com> (raw)
In-Reply-To: <20180626182802.19932-4-ard.biesheuvel@linaro.org>
Hi Ard,
On Tue, Jun 26, 2018 at 08:27:58PM +0200, Ard Biesheuvel wrote:
> An ordinary arm64 defconfig build has ~64 KB worth of __ksymtab
> entries, each consisting of two 64-bit fields containing absolute
> references, to the symbol itself and to a char array containing
> its name, respectively.
[...]
> diff --git a/include/linux/export.h b/include/linux/export.h
> index ea7df303d68d..ae072bc5aacf 100644
> --- a/include/linux/export.h
> +++ b/include/linux/export.h
> @@ -18,12 +18,6 @@
> #define VMLINUX_SYMBOL_STR(x) __VMLINUX_SYMBOL_STR(x)
>
> #ifndef __ASSEMBLY__
> -struct kernel_symbol
> -{
> - unsigned long value;
> - const char *name;
> -};
> -
> #ifdef MODULE
> extern struct module __this_module;
> #define THIS_MODULE (&__this_module)
> @@ -54,17 +48,47 @@ extern struct module __this_module;
> #define __CRC_SYMBOL(sym, sec)
> #endif
>
> +#ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
> +#include <linux/compiler.h>
> +/*
> + * Emit the ksymtab entry as a pair of relative references: this reduces
> + * the size by half on 64-bit architectures, and eliminates the need for
> + * absolute relocations that require runtime processing on relocatable
> + * kernels.
> + */
> +#define __KSYMTAB_ENTRY(sym, sec) \
> + __ADDRESSABLE(sym) \
> + asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \
> + " .balign 8 \n" \
Can we use KSYM_ALIGN here instead of 8, or do we need the 8-byte alignment
even on 32-bit architectures?
Will
WARNING: multiple messages have this Message-ID (diff)
From: will.deacon@arm.com (Will Deacon)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCH v9 3/6] module: use relative references for __ksymtab entries
Date: Wed, 27 Jun 2018 16:13:39 +0100 [thread overview]
Message-ID: <20180627151339.GD30631@arm.com> (raw)
In-Reply-To: <20180626182802.19932-4-ard.biesheuvel@linaro.org>
Hi Ard,
On Tue, Jun 26, 2018 at 08:27:58PM +0200, Ard Biesheuvel wrote:
> An ordinary arm64 defconfig build has ~64 KB worth of __ksymtab
> entries, each consisting of two 64-bit fields containing absolute
> references, to the symbol itself and to a char array containing
> its name, respectively.
[...]
> diff --git a/include/linux/export.h b/include/linux/export.h
> index ea7df303d68d..ae072bc5aacf 100644
> --- a/include/linux/export.h
> +++ b/include/linux/export.h
> @@ -18,12 +18,6 @@
> #define VMLINUX_SYMBOL_STR(x) __VMLINUX_SYMBOL_STR(x)
>
> #ifndef __ASSEMBLY__
> -struct kernel_symbol
> -{
> - unsigned long value;
> - const char *name;
> -};
> -
> #ifdef MODULE
> extern struct module __this_module;
> #define THIS_MODULE (&__this_module)
> @@ -54,17 +48,47 @@ extern struct module __this_module;
> #define __CRC_SYMBOL(sym, sec)
> #endif
>
> +#ifdef CONFIG_HAVE_ARCH_PREL32_RELOCATIONS
> +#include <linux/compiler.h>
> +/*
> + * Emit the ksymtab entry as a pair of relative references: this reduces
> + * the size by half on 64-bit architectures, and eliminates the need for
> + * absolute relocations that require runtime processing on relocatable
> + * kernels.
> + */
> +#define __KSYMTAB_ENTRY(sym, sec) \
> + __ADDRESSABLE(sym) \
> + asm(" .section \"___ksymtab" sec "+" #sym "\", \"a\" \n" \
> + " .balign 8 \n" \
Can we use KSYM_ALIGN here instead of 8, or do we need the 8-byte alignment
even on 32-bit architectures?
Will
next prev parent reply other threads:[~2018-06-27 15:13 UTC|newest]
Thread overview: 34+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-06-26 18:27 [PATCH v9 0/6] add support for relative references in special sections Ard Biesheuvel
2018-06-26 18:27 ` Ard Biesheuvel
2018-06-26 18:27 ` [PATCH v9 1/6] arch: enable relative relocations for arm64, power and x86 Ard Biesheuvel
2018-06-26 18:27 ` Ard Biesheuvel
2018-06-26 18:27 ` [PATCH v9 2/6] module: allow symbol exports to be disabled Ard Biesheuvel
2018-06-26 18:27 ` Ard Biesheuvel
2018-06-26 18:27 ` [PATCH v9 3/6] module: use relative references for __ksymtab entries Ard Biesheuvel
2018-06-26 18:27 ` Ard Biesheuvel
2018-06-27 15:13 ` Will Deacon [this message]
2018-06-27 15:13 ` Will Deacon
2018-06-27 15:21 ` Ard Biesheuvel
2018-06-27 15:21 ` Ard Biesheuvel
2018-06-26 18:27 ` [PATCH v9 4/6] init: allow initcall tables to be emitted using relative references Ard Biesheuvel
2018-06-26 18:27 ` Ard Biesheuvel
2018-06-26 19:13 ` James Morris
2018-06-26 19:13 ` James Morris
2018-06-27 14:20 ` Sergey Senozhatsky
2018-06-27 14:20 ` Sergey Senozhatsky
2018-06-27 15:22 ` Petr Mladek
2018-06-27 15:22 ` Petr Mladek
2018-06-30 10:16 ` kbuild test robot
2018-06-30 10:16 ` kbuild test robot
2018-06-26 18:28 ` [PATCH v9 5/6] PCI: Add support for relative addressing in quirk tables Ard Biesheuvel
2018-06-26 18:28 ` Ard Biesheuvel
2018-06-26 18:28 ` [PATCH v9 6/6] kernel: tracepoints: add support for relative references Ard Biesheuvel
2018-06-26 18:28 ` Ard Biesheuvel
2018-06-27 5:33 ` [PATCH v9 0/6] add support for relative references in special sections Michael Ellerman
2018-06-27 5:33 ` Michael Ellerman
2018-06-27 15:15 ` Will Deacon
2018-06-27 15:15 ` Will Deacon
2018-07-01 17:39 ` Ard Biesheuvel
2018-07-01 17:39 ` Ard Biesheuvel
2018-07-03 8:38 ` Ingo Molnar
2018-07-03 8:38 ` Ingo Molnar
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=20180627151339.GD30631@arm.com \
--to=will.deacon@arm.com \
--cc=akpm@linux-foundation.org \
--cc=ard.biesheuvel@linaro.org \
--cc=arnd@arndb.de \
--cc=benh@kernel.crashing.org \
--cc=bhelgaas@google.com \
--cc=catalin.marinas@arm.com \
--cc=jeyu@kernel.org \
--cc=jmorris@namei.org \
--cc=jpoimboe@redhat.com \
--cc=keescook@chromium.org \
--cc=linux-arm-kernel@lists.infradead.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux@armlinux.org.uk \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mingo@kernel.org \
--cc=mingo@redhat.com \
--cc=mpe@ellerman.id.au \
--cc=nico@linaro.org \
--cc=paulus@samba.org \
--cc=pmladek@suse.com \
--cc=rostedt@goodmis.org \
--cc=serge@hallyn.com \
--cc=sergey.senozhatsky@gmail.com \
--cc=tglx@linutronix.de \
--cc=thgarnie@google.com \
--cc=torvalds@linux-foundation.org \
--cc=x86@kernel.org \
/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.