public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Andy Lutomirski <luto@amacapital.net>
To: Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@redhat.com>, "H. Peter Anvin" <hpa@zytor.com>,
	x86@kernel.org
Cc: linux-kernel@vger.kernel.org, Andy Lutomirski <luto@amacapital.net>
Subject: [PATCH 0/8] x86: Disentangle the vdso and clean it up
Date: Tue, 23 Sep 2014 10:50:50 -0700	[thread overview]
Message-ID: <cover.1411494540.git.luto@amacapital.net> (raw)

Hi Ingo and Thomas,

This should all be straightforward.  It's primarily a cleanup, but it
fixes what is arguably a bug in the PER_CPU mechanism.

The first two patches just rearrange code to disentangle the vdso from
the vsyscall emulation code.

The next three patches are tiny.  Patch 3 rewrites the PER_CPU setup
code to make it comprehensible; it has no effect other than clarify.
Patches 4 and 5 fix two problems with the PER_CPU segment that are
apparent after the code has been cleaned up.  (Patch 5 fixes a glitch
that that is almost, but not quote, a security bug.)

Patches 6 and 7 are just cleanups.  Patch 6 removes the "jiffies" vvar,
which has been unused for years.  Patch 7 cleans up some initialization
code.

Patch 8 removes the vvar that selects the getcpu mode.  That vvar
has been unnecessary for a couple of years, ever since alternative
patching has worked in the vdso.

There is a small but non quote zero chance that I will want to revert
patch 8 at some point.  Reverting it will be needed to be able to
disable the TSC (in the CR4.TSC sense) without breaking the vdso, unless
we patch the vdso text.  That being said, I think it'll be a lot less
messy to just patch the vdso text if we do that.

Please consider applying these, or at least applying patches 1-7,
to tip/x86/vdso for 3.18.

Thanks,
Andy


Changes from way back when: This has been floating around since June in
some form. See:
http://lkml.kernel.org/g/cover.1404164803.git.luto@amacapital.net

This version just disentangles the vdso and vsyscall code and does the
vdso cleanups/fixes.  It does *not* contain the PER_CPU removal on
RDTSCP systems, since hpa mentioned that this is potentially
problematic, and, if we were to try it, it should soak in -next for a
*long* time.  It is also heavily cleaned up since last time.


Andy Lutomirski (8):
  x86_64,vsyscall: Move all of the gate_area code to vsyscall_64.c
  x86_64: Move getcpu code from vsyscall_64.c to vdso/vma.c
  x86,vdso: Change the PER_CPU segment to use struct desc_struct
  x86,vdso: Make the PER_CPU segment start out accessed
  x86,vdso: Make the PER_CPU segment 32 bits
  x86_64,vdso: Remove jiffies from the vvar page
  x86_64,vdso: Clean up vgetcpu init and merge the vdso initcalls
  x86,vdso: Replace vgetcpu_mode with static_cpu_has

 arch/x86/include/asm/vgtod.h    | 21 ++++++++++
 arch/x86/include/asm/vsyscall.h | 29 --------------
 arch/x86/include/asm/vvar.h     |  2 -
 arch/x86/kernel/cpu/common.c    | 10 -----
 arch/x86/kernel/time.c          |  2 +-
 arch/x86/kernel/vsyscall_64.c   | 84 ++++++++++++++++++----------------------
 arch/x86/mm/init_64.c           | 49 ------------------------
 arch/x86/vdso/vclock_gettime.c  |  3 ++
 arch/x86/vdso/vgetcpu.c         |  5 ++-
 arch/x86/vdso/vma.c             | 85 ++++++++++++++++++++++++++++++++---------
 10 files changed, 132 insertions(+), 158 deletions(-)

-- 
1.9.3


             reply	other threads:[~2014-09-23 17:51 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-23 17:50 Andy Lutomirski [this message]
2014-09-23 17:50 ` [PATCH 1/8] x86_64,vsyscall: Move all of the gate_area code to vsyscall_64.c Andy Lutomirski
2014-10-28 11:14   ` [tip:x86/vdso] x86_64/vsyscall: " tip-bot for Andy Lutomirski
2014-09-23 17:50 ` [PATCH 2/8] x86_64: Move getcpu code from vsyscall_64.c to vdso/vma.c Andy Lutomirski
2014-10-28 11:14   ` [tip:x86/vdso] x86_64/vdso: " tip-bot for Andy Lutomirski
2014-09-23 17:50 ` [PATCH 3/8] x86,vdso: Change the PER_CPU segment to use struct desc_struct Andy Lutomirski
2014-10-28 11:15   ` [tip:x86/vdso] x86/vdso: " tip-bot for Andy Lutomirski
2014-09-23 17:50 ` [PATCH 4/8] x86,vdso: Make the PER_CPU segment start out accessed Andy Lutomirski
2014-10-28 11:15   ` [tip:x86/vdso] x86/vdso: " tip-bot for Andy Lutomirski
2014-09-23 17:50 ` [PATCH 5/8] x86,vdso: Make the PER_CPU segment 32 bits Andy Lutomirski
2014-10-28 11:15   ` [tip:x86/vdso] x86/vdso: " tip-bot for Andy Lutomirski
2014-09-23 17:50 ` [PATCH 6/8] x86_64,vdso: Remove jiffies from the vvar page Andy Lutomirski
2014-10-28 11:15   ` [tip:x86/vdso] x86_64/vdso: " tip-bot for Andy Lutomirski
2014-09-23 17:50 ` [PATCH 7/8] x86_64,vdso: Clean up vgetcpu init and merge the vdso initcalls Andy Lutomirski
2014-10-28 11:16   ` [tip:x86/vdso] x86_64/vdso: " tip-bot for Andy Lutomirski
2014-09-23 17:50 ` [PATCH 8/8] x86,vdso: Replace vgetcpu_mode with static_cpu_has Andy Lutomirski
2014-10-20 17:44 ` [PATCH 0/8] x86: Disentangle the vdso and clean it up Andy Lutomirski
2014-10-20 21:41 ` H. Peter Anvin
2014-10-20 21:57   ` Andy Lutomirski
2014-10-20 22:03     ` H. Peter Anvin
2014-10-20 22:41       ` Andy Lutomirski
2014-10-21  4:38         ` 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=cover.1411494540.git.luto@amacapital.net \
    --to=luto@amacapital.net \
    --cc=hpa@zytor.com \
    --cc=linux-kernel@vger.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