public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/8] x86: Disentangle the vdso and clean it up
@ 2014-09-23 17:50 Andy Lutomirski
  2014-09-23 17:50 ` [PATCH 1/8] x86_64,vsyscall: Move all of the gate_area code to vsyscall_64.c Andy Lutomirski
                   ` (9 more replies)
  0 siblings, 10 replies; 22+ messages in thread
From: Andy Lutomirski @ 2014-09-23 17:50 UTC (permalink / raw)
  To: Thomas Gleixner, Ingo Molnar, H. Peter Anvin, x86
  Cc: linux-kernel, Andy Lutomirski

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


^ permalink raw reply	[flat|nested] 22+ messages in thread

end of thread, other threads:[~2014-10-28 11:16 UTC | newest]

Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-09-23 17:50 [PATCH 0/8] x86: Disentangle the vdso and clean it up Andy Lutomirski
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

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox