public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Sean Christopherson <sean.j.christopherson@intel.com>
To: Andy Lutomirski <luto@kernel.org>
Cc: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, Borislav Petkov <bp@alien8.de>,
	X86 ML <x86@kernel.org>, "H. Peter Anvin" <hpa@zytor.com>,
	LKML <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 1/2] x86/vdso: Remove obsolete "fake section table" reservation
Date: Tue, 4 Dec 2018 11:28:49 -0800	[thread overview]
Message-ID: <20181204192849.GC17374@linux.intel.com> (raw)
In-Reply-To: <CALCETrWHhdMBxejzgTtykFUgifkNYj5zDfp04tn7JdftiSzFLw@mail.gmail.com>

On Tue, Dec 04, 2018 at 10:58:51AM -0800, Andy Lutomirski wrote:
> On Tue, Dec 4, 2018 at 10:29 AM Sean Christopherson
> <sean.j.christopherson@intel.com> wrote:
> >
> > On Tue, Dec 04, 2018 at 10:22:39AM -0800, Sean Christopherson wrote:
> > > On Tue, Dec 04, 2018 at 08:17:40AM -0800, Sean Christopherson wrote:
> > > > At one point the vDSO image was manually stripped down by vdso2c in an
> > > > attempt to minimize the size of the image mapped into userspace.  Part
> > > > of that stripping process involved building a fake section table so as
> > > > not to break userspace processes that parse the section table.  Memory
> > > > for the fake section table was reserved in the .rodata section so that
> > > > vdso2c could simply copy the entire PT_LOAD segment into the userspace
> > > > image after building the fake table.
> > > >
> > > > Eventually, the entire fake section table approach was dropped in favor
> > > > of stripping the vdso "the old fashioned way", i.e. via objdump -S.
> > > > But, the reservation in .rodata for the fake table was left behind.
> > > > Remove the reserveration along with a few other related defines and
> > > > section entries.
> > > >
> > > > Removing the fake section table placeholder zaps a whopping 0x340 bytes
> > > > from the 64-bit vDSO image, which drops the current image's size to
> > > > under 4k, i.e. reduces the effective size of the userspace vDSO mapping
> > > > by a full page.
> > > >
> > > > Fixes: da861e18eccc ("x86, vdso: Get rid of the fake section mechanism")
> > > > Cc: Andy Lutomirski <luto@amacapital.net>
> > > > Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com>
> > > > ---
> > > > diff --git a/arch/x86/entry/vdso/vdso2c.c b/arch/x86/entry/vdso/vdso2c.c
> > > > index 4674f58581a1..2479a454b15c 100644
> > > > --- a/arch/x86/entry/vdso/vdso2c.c
> > > > +++ b/arch/x86/entry/vdso/vdso2c.c
> > > > @@ -98,12 +98,6 @@ struct vdso_sym required_syms[] = {
> > > >     [sym_hpet_page] = {"hpet_page", true},
> > > >     [sym_pvclock_page] = {"pvclock_page", true},
> > > >     [sym_hvclock_page] = {"hvclock_page", true},
> > > > -   [sym_VDSO_FAKE_SECTION_TABLE_START] = {
> > > > -           "VDSO_FAKE_SECTION_TABLE_START", false
> > > > -   },
> > > > -   [sym_VDSO_FAKE_SECTION_TABLE_END] = {
> > > > -           "VDSO_FAKE_SECTION_TABLE_END", false
> > > > -   },
> > >
> > > Doh, I missed removing the definitions for sym_VDSO_FAKE_SECTION_TABLE_*.
> >
> > And with sym_VDSO_FAKE_SECTION_TABLE_* gone all symbols are exported,
> > meaning required_syms can be a char* array and struct vdso_sym can be
> > removed.
> 
> I bet that we'll want that field to parse out the extable entries once
> all the dust settles, though.

Hmm, the extable stuff will be sections, a la .altinstructions, I don't
think we'll need separate symbols.

What if I send out a RFC for the extable stuff in parallel to this series
and to the SGX series?  It'd also be nice to iterate on that code without
having to spin a full SGX series.

  reply	other threads:[~2018-12-04 19:28 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-12-04 16:17 [PATCH 0/2] x86/vdso: Remove remnants of the fake section table Sean Christopherson
2018-12-04 16:17 ` [PATCH 1/2] x86/vdso: Remove obsolete "fake section table" reservation Sean Christopherson
2018-12-04 18:22   ` Sean Christopherson
2018-12-04 18:29     ` Sean Christopherson
2018-12-04 18:58       ` Andy Lutomirski
2018-12-04 19:28         ` Sean Christopherson [this message]
2018-12-04 19:46           ` Andy Lutomirski
2018-12-04 16:17 ` [PATCH 2/2] x86/vdso: Remove a stale/misleading comment from the linker script Sean Christopherson
2018-12-04 18:59   ` Andy Lutomirski

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=20181204192849.GC17374@linux.intel.com \
    --to=sean.j.christopherson@intel.com \
    --cc=bp@alien8.de \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=mingo@redhat.com \
    --cc=tglx@linutronix.de \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox