public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Michael Ellerman <mpe@ellerman•id.au>
To: Kees Cook <keescook@chromium•org>,
	Andrew Morton <akpm@linux-foundation•org>
Cc: Ard Biesheuvel <ard.biesheuvel@linaro•org>,
	LKML <linux-kernel@vger•kernel.org>,
	"linux-s390@vger•kernel.org" <linux-s390@vger•kernel.org>,
	"linuxppc-dev@lists•ozlabs.org" <linuxppc-dev@lists•ozlabs.org>,
	"x86@kernel•org" <x86@kernel•org>, Ingo Molnar <mingo@kernel•org>,
	"H. Peter Anvin" <hpa@zytor•com>,
	Heiko Carstens <heiko.carstens@de•ibm.com>,
	"benh@kernel•crashing.org" <benh@kernel•crashing.org>,
	Michal Marek <mmarek@suse•cz>,
	Rusty Russell <rusty@rustcorp•com.au>,
	Arnd Bergmann <arnd@arndb•de>,
	linux-arch <linux-arch@vger•kernel.org>
Subject: Re: [PATCH v3] kallsyms: add support for relative offsets in kallsyms address table
Date: Fri, 22 Jan 2016 14:44:42 +1100	[thread overview]
Message-ID: <1453434282.21683.2.camel@ellerman.id.au> (raw)
In-Reply-To: <CAGXu5j+yNZRC99BonVwdawqQTBDQWMKu4gw9TTnA8nOU+fqSMg@mail.gmail.com>

On Thu, 2016-01-21 at 14:55 -0800, Kees Cook wrote:
> On Thu, Jan 21, 2016 at 2:50 PM, Andrew Morton
> <akpm@linux-foundation•org> wrote:
> > On Thu, 21 Jan 2016 18:19:43 +0100 Ard Biesheuvel <ard.biesheuvel@linaro•org> wrote:
> > 
> > > Similar to how relative extables are implemented, it is possible to emit
> > > the kallsyms table in such a way that it contains offsets relative to some
> > > anchor point in the kernel image rather than absolute addresses. The benefit
> > > is that such table entries are no longer subject to dynamic relocation when
> > > the build time and runtime offsets of the kernel image are different. Also,
> > > on 64-bit architectures, it essentially cuts the size of the address table
> > > in half since offsets can typically be expressed in 32 bits.
> > > 
> > > Since it is useful for some architectures (like x86) to retain the ability
> > > to emit absolute values as well, this patch adds support for both, by
> > > emitting absolute addresses as positive 32-bit values, and addresses
> > > relative to the lowest encountered relative symbol as negative values, which
> > > are subtracted from the runtime address of this base symbol to produce the
> > > actual address.
> > > 
> > > Support for the above is enabled by default for all architectures except
> > > IA-64, whose symbols are too far apart to capture in this manner.
> > 
> > I'm not really understanding the benefits of this.  A smaller address
> > table is nice, but why is it desirable that "such table entries are no
> > longer subject to dynamic relocation when the build time and runtime
> > offsets of the kernel image are different"?
> 
> IIUC, this means that the relocation work done after decompression now
> doesn't have to do relocation updates for all these values, which
> means a smaller relocation table as well.

Yep. If I remember the figures rightly it saves ~250K of relocations for the
powerpc build.

cheers

  parent reply	other threads:[~2016-01-22  3:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-01-21 10:48 [PATCH v2] kallsyms: add support for relative offsets in kallsyms address table Ard Biesheuvel
2016-01-21 11:34 ` Ard Biesheuvel
2016-01-21 17:19 ` [PATCH v3] " Ard Biesheuvel
2016-01-21 22:50   ` Andrew Morton
2016-01-21 22:55     ` Kees Cook
2016-01-21 23:20       ` Andrew Morton
2016-01-22  8:20         ` Ard Biesheuvel
2016-01-22 21:07           ` Andrew Morton
2016-01-22 21:54             ` Ard Biesheuvel
2016-01-23 13:21               ` Balbir Singh
2016-01-22  3:44       ` Michael Ellerman [this message]
2016-01-22  6:44         ` Ard Biesheuvel
2016-01-22 23:34   ` Andrew Morton
2016-01-22 23:43     ` Andrew Morton

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=1453434282.21683.2.camel@ellerman.id.au \
    --to=mpe@ellerman$(echo .)id.au \
    --cc=akpm@linux-foundation$(echo .)org \
    --cc=ard.biesheuvel@linaro$(echo .)org \
    --cc=arnd@arndb$(echo .)de \
    --cc=benh@kernel$(echo .)crashing.org \
    --cc=heiko.carstens@de$(echo .)ibm.com \
    --cc=hpa@zytor$(echo .)com \
    --cc=keescook@chromium$(echo .)org \
    --cc=linux-arch@vger$(echo .)kernel.org \
    --cc=linux-kernel@vger$(echo .)kernel.org \
    --cc=linux-s390@vger$(echo .)kernel.org \
    --cc=linuxppc-dev@lists$(echo .)ozlabs.org \
    --cc=mingo@kernel$(echo .)org \
    --cc=mmarek@suse$(echo .)cz \
    --cc=rusty@rustcorp$(echo .)com.au \
    --cc=x86@kernel$(echo .)org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox