1. 11 12月, 2015 4 次提交
  2. 06 7月, 2015 3 次提交
  3. 04 6月, 2015 1 次提交
    • I
      x86/asm/entry, x86/vdso: Move the vDSO code to arch/x86/entry/vdso/ · d603c8e1
      Ingo Molnar 提交于
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: H. Peter Anvin <hpa@zytor.com>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Denys Vlasenko <dvlasenk@redhat.com>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Peter Zijlstra <peterz@infradead.org>
      Cc: linux-kernel@vger.kernel.org
      Signed-off-by: NIngo Molnar <mingo@kernel.org>
      d603c8e1
  4. 27 4月, 2015 1 次提交
  5. 08 4月, 2015 1 次提交
    • R
      x86: vdso: fix pvclock races with task migration · 80f7fdb1
      Radim Krčmář 提交于
      If we were migrated right after __getcpu, but before reading the
      migration_count, we wouldn't notice that we read TSC of a different
      VCPU, nor that KVM's bug made pvti invalid, as only migration_count
      on source VCPU is increased.
      
      Change vdso instead of updating migration_count on destination.
      
      Cc: stable@vger.kernel.org
      Signed-off-by: NRadim Krčmář <rkrcmar@redhat.com>
      Fixes: 0a4e6be9 ("x86: kvm: Revert "remove sched notifier for cross-cpu migrations"")
      Message-Id: <1428000263-11892-1-git-send-email-rkrcmar@redhat.com>
      Signed-off-by: NPaolo Bonzini <pbonzini@redhat.com>
      80f7fdb1
  6. 24 3月, 2015 1 次提交
  7. 25 6月, 2014 1 次提交
  8. 06 5月, 2014 2 次提交
    • A
      x86, vdso: Move the vvar and hpet mappings next to the 64-bit vDSO · f40c3300
      Andy Lutomirski 提交于
      This makes the 64-bit and x32 vdsos use the same mechanism as the
      32-bit vdso.  Most of the churn is deleting all the old fixmap code.
      Signed-off-by: NAndy Lutomirski <luto@amacapital.net>
      Link: http://lkml.kernel.org/r/8af87023f57f6bb96ec8d17fce3f88018195b49b.1399317206.git.luto@amacapital.netSigned-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      f40c3300
    • A
      x86, vdso: Reimplement vdso.so preparation in build-time C · 6f121e54
      Andy Lutomirski 提交于
      Currently, vdso.so files are prepared and analyzed by a combination
      of objcopy, nm, some linker script tricks, and some simple ELF
      parsers in the kernel.  Replace all of that with plain C code that
      runs at build time.
      
      All five vdso images now generate .c files that are compiled and
      linked in to the kernel image.
      
      This should cause only one userspace-visible change: the loaded vDSO
      images are stripped more heavily than they used to be.  Everything
      outside the loadable segment is dropped.  In particular, this causes
      the section table and section name strings to be missing.  This
      should be fine: real dynamic loaders don't load or inspect these
      tables anyway.  The result is roughly equivalent to eu-strip's
      --strip-sections option.
      
      The purpose of this change is to enable the vvar and hpet mappings
      to be moved to the page following the vDSO load segment.  Currently,
      it is possible for the section table to extend into the page after
      the load segment, so, if we map it, it risks overlapping the vvar or
      hpet page.  This happens whenever the load segment is just under a
      multiple of PAGE_SIZE.
      
      The only real subtlety here is that the old code had a C file with
      inline assembler that did 'call VDSO32_vsyscall' and a linker script
      that defined 'VDSO32_vsyscall = __kernel_vsyscall'.  This most
      likely worked by accident: the linker script entry defines a symbol
      associated with an address as opposed to an alias for the real
      dynamic symbol __kernel_vsyscall.  That caused ld to relocate the
      reference at link time instead of leaving an interposable dynamic
      relocation.  Since the VDSO32_vsyscall hack is no longer needed, I
      now use 'call __kernel_vsyscall', and I added -Bsymbolic to make it
      work.  vdso2c will generate an error and abort the build if the
      resulting image contains any dynamic relocations, so we won't
      silently generate bad vdso images.
      
      (Dynamic relocations are a problem because nothing will even attempt
      to relocate the vdso.)
      Signed-off-by: NAndy Lutomirski <luto@amacapital.net>
      Link: http://lkml.kernel.org/r/2c4fcf45524162a34d87fdda1eb046b2a5cecee7.1399317206.git.luto@amacapital.netSigned-off-by: NH. Peter Anvin <hpa@linux.intel.com>
      6f121e54
  9. 19 3月, 2014 6 次提交
  10. 12 1月, 2014 1 次提交
  11. 06 11月, 2013 1 次提交
  12. 18 7月, 2013 1 次提交
  13. 15 2月, 2013 1 次提交
  14. 28 11月, 2012 1 次提交
  15. 25 9月, 2012 1 次提交
    • J
      time: Convert x86_64 to using new update_vsyscall · 650ea024
      John Stultz 提交于
      Switch x86_64 to using sub-ns precise vsyscall
      
      Cc: Tony Luck <tony.luck@intel.com>
      Cc: Paul Mackerras <paulus@samba.org>
      Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
      Cc: Andy Lutomirski <luto@amacapital.net>
      Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
      Cc: Paul Turner <pjt@google.com>
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Richard Cochran <richardcochran@gmail.com>
      Cc: Prarit Bhargava <prarit@redhat.com>
      Cc: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      650ea024
  16. 24 3月, 2012 2 次提交
  17. 16 3月, 2012 2 次提交
    • T
      x86: vdso: Use seqcount instead of seqlock · 2ab51657
      Thomas Gleixner 提交于
      The update of the vdso data happens under xtime_lock, so adding a
      nested lock is pointless. Just use a seqcount to sync the readers.
      Reviewed-by: NAndy Lutomirski <luto@amacapital.net>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      2ab51657
    • J
      time: x86: Fix race switching from vsyscall to non-vsyscall clock · a939e817
      John Stultz 提交于
      When switching from a vsyscall capable to a non-vsyscall capable
      clocksource, there was a small race, where the last vsyscall
      gettimeofday before the switch might return a invalid time value
      using the new non-vsyscall enabled clocksource values after the
      switch is complete.
      
      This is due to the vsyscall code checking the vclock_mode once
      outside of the seqcount protected section. After it reads the
      vclock mode, it doesn't re-check that the sampled clock data
      that is obtained in the seqcount critical section still matches.
      
      The fix is to sample vclock_mode inside the protected section,
      and as long as it isn't VCLOCK_NONE, return the calculated
      value. If it has changed and is now VCLOCK_NONE, fall back
      to the syscall gettime calculation.
      
      v2:
        * Cleanup checks as suggested by tglx
        * Also fix same issue present in gettimeofday path
      
      CC: Andy Lutomirski <luto@amacapital.net>
      CC: Thomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NJohn Stultz <john.stultz@linaro.org>
      a939e817
  18. 19 7月, 2011 1 次提交
  19. 15 7月, 2011 1 次提交
  20. 06 6月, 2011 1 次提交
    • A
      x86-64: Remove kernel.vsyscall64 sysctl · 0d7b8547
      Andy Lutomirski 提交于
      It's unnecessary overhead in code that's supposed to be highly
      optimized.  Removing it allows us to remove one of the two
      syscall instructions in the vsyscall page.
      
      The only sensible use for it is for UML users, and it doesn't
      fully address inconsistent vsyscall results on UML.  The real
      fix for UML is to stop using vsyscalls entirely.
      Signed-off-by: NAndy Lutomirski <luto@mit.edu>
      Cc: Jesper Juhl <jj@chaosbits.net>
      Cc: Borislav Petkov <bp@alien8.de>
      Cc: Linus Torvalds <torvalds@linux-foundation.org>
      Cc: Arjan van de Ven <arjan@infradead.org>
      Cc: Jan Beulich <JBeulich@novell.com>
      Cc: richard -rw- weinberger <richard.weinberger@gmail.com>
      Cc: Mikael Pettersson <mikpe@it.uu.se>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: Brian Gerst <brgerst@gmail.com>
      Cc: Louis Rilling <Louis.Rilling@kerlabs.com>
      Cc: Valdis.Kletnieks@vt.edu
      Cc: pageexec@freemail.hu
      Link: http://lkml.kernel.org/r/973ae803fe76f712da4b2740e66dccf452d3b1e4.1307292171.git.luto@mit.eduSigned-off-by: NIngo Molnar <mingo@elte.hu>
      0d7b8547
  21. 26 5月, 2011 1 次提交
  22. 24 5月, 2011 4 次提交
  23. 22 8月, 2009 1 次提交
    • J
      time: Introduce CLOCK_REALTIME_COARSE · da15cfda
      john stultz 提交于
      After talking with some application writers who want very fast, but not
      fine-grained timestamps, I decided to try to implement new clock_ids
      to clock_gettime(): CLOCK_REALTIME_COARSE and CLOCK_MONOTONIC_COARSE
      which returns the time at the last tick. This is very fast as we don't
      have to access any hardware (which can be very painful if you're using
      something like the acpi_pm clocksource), and we can even use the vdso
      clock_gettime() method to avoid the syscall. The only trade off is you
      only get low-res tick grained time resolution.
      
      This isn't a new idea, I know Ingo has a patch in the -rt tree that made
      the vsyscall gettimeofday() return coarse grained time when the
      vsyscall64 sysctrl was set to 2. However this affects all applications
      on a system.
      
      With this method, applications can choose the proper speed/granularity
      trade-off for themselves.
      Signed-off-by: NJohn Stultz <johnstul@us.ibm.com>
      Cc: Andi Kleen <andi@firstfloor.org>
      Cc: nikolag@ca.ibm.com
      Cc: Darren Hart <dvhltc@us.ibm.com>
      Cc: arjan@infradead.org
      Cc: jonathan@jonmasters.org
      LKML-Reference: <1250734414.6897.5.camel@localhost.localdomain>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      da15cfda
  24. 30 4月, 2009 1 次提交
    • J
      x86: gettimeofday() vDSO: fix segfault when tv == NULL · 2f65dd47
      John Wright 提交于
      According to the gettimeofday(2) manual:
      
             If either tv or tz is NULL, the corresponding structure is not
             set or returned.
      
      Since it is legal to give NULL as the tv argument, the code should make
      sure tv is not NULL before trying to dereference it.
      
      This issue manifests itself on x86_64 when vdso=0 is not on the kernel
      command-line and libc uses the vDSO for gettimeofday() (e.g. glibc >=
      2.7).  A simple reproducer:
      
        #include <stdio.h>
        #include <sys/time.h>
      
        int main(void)
        {
            struct timezone tz;
      
            gettimeofday(NULL, &tz);
      
            return 0;
        }
      
      See http://bugs.debian.org/466491 for more details.
      
      [ Impact: fix gettimeofday(NULL, &tz) segfault ]
      Signed-off-by: NJohn Wright <john.wright@hp.com>
      Cc: Andi Kleen <ak@suse.de>
      Cc: John Wright <john.wright@hp.com>
      LKML-Reference: <1241037121-14805-1-git-send-email-john.wright@hp.com>
      Signed-off-by: NIngo Molnar <mingo@elte.hu>
      2f65dd47