22 Jul, 2007

1 commit

  • This implements new vDSO for x86-64. The concept is similar
    to the existing vDSOs on i386 and PPC. x86-64 has had static
    vsyscalls before, but these are not flexible enough anymore.

    A vDSO is a ELF shared library supplied by the kernel that is mapped into
    user address space. The vDSO mapping is randomized for each process
    for security reasons.

    Doing this was needed for clock_gettime, because clock_gettime
    always needs a syscall fallback and having one at a fixed
    address would have made buffer overflow exploits too easy to write.

    The vdso can be disabled with vdso=0

    It currently includes a new gettimeofday implemention and optimized
    clock_gettime(). The gettimeofday implementation is slightly faster
    than the one in the old vsyscall. clock_gettime is significantly faster
    than the syscall for CLOCK_MONOTONIC and CLOCK_REALTIME.

    The new calls are generally faster than the old vsyscall.

    Advantages over the old x86-64 vsyscalls:
    - Extensible
    - Randomized
    - Cleaner
    - Easier to virtualize (the old static address range previously causes
    overhead e.g. for Xen because it has to create special page tables for it)

    Weak points:
    - glibc support still to be written

    The VM interface is partly based on Ingo Molnar's i386 version.

    Includes compile fix from Joachim Deguara

    Signed-off-by: Andi Kleen
    Signed-off-by: Linus Torvalds

    Andi Kleen
     

17 Feb, 2007

1 commit


13 Feb, 2007

1 commit

  • ARCH_HAVE_XTIME_LOCK is used by x86_64 arch . This arch needs to place a
    read only copy of xtime_lock into vsyscall page. This read only copy is
    named __xtime_lock, and xtime_lock is defined in
    arch/x86_64/kernel/vmlinux.lds.S as an alias. So the declaration of
    xtime_lock in kernel/timer.c was guarded by ARCH_HAVE_XTIME_LOCK define,
    defined to true on x86_64.

    We can get same result with _attribute__((weak)) in the declaration. linker
    should do the job.

    Signed-off-by: Eric Dumazet
    Signed-off-by: Andi Kleen
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton

    Eric Dumazet
     

07 Dec, 2006

1 commit

  • The final line of /proc//maps on x86_64 for native 64-bit
    tasks shows an incorrect ending address and incorrect permissions. There
    is only a single page mapped in this vsyscall region, and it is accessible
    for both read and execute.

    The patch below fixes this. (Since 32-bit-compat tasks have a real vma
    with correct perms/range, no change is necessary for that scenario.)

    Before the patch, a "cat /proc/self/maps | tail -1" shows this:

    ffffffffff600000-ffffffffffe00000 ---p 00000000 [...]

    After the patch, this is the output:

    ffffffffff600000-ffffffffff601000 r-xp 00000000 [...]

    Signed-off-by: Ernie Petrides
    Signed-off-by: Andi Kleen

    Ernie Petrides
     

14 Nov, 2006

1 commit

  • The vgetcpu per CPU initialization previously relied on CPU hotplug
    events for all CPUs to initialize the per CPU state. That only
    worked only on kernels with CONFIG_HOTPLUG_CPU enabled. On the
    others some CPUs didn't get their state initialized properly
    and vgetcpu wouldn't work.

    Change the initialization sequence to instead run in a normal
    initcall (which runs after the normal CPU bootup) and initialize
    all running CPUs there. Later hotplug CPUs are still handled
    with an hotplug notifier.

    This actually simplifies the code somewhat.

    Signed-off-by: Andi Kleen

    Andi Kleen
     

01 Oct, 2006

1 commit

  • With 2.6.18-rc4-mm2, now wall_jiffies will always be the same as jiffies.
    So we can kill wall_jiffies completely.

    This is just a cleanup and logically should not change any real behavior
    except for one thing: RTC updating code in (old) ppc and xtensa use a
    condition "jiffies - wall_jiffies == 1". This condition is never met so I
    suppose it is just a bug. I just remove that condition only instead of
    kill the whole "if" block.

    [heiko.carstens@de.ibm.com: s390 build fix and cleanup]
    Signed-off-by: Atsushi Nemoto
    Cc: Andi Kleen
    Cc: Paul Mackerras
    Cc: Benjamin Herrenschmidt
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Russell King
    Cc: Ian Molton
    Cc: Mikael Starvik
    Cc: David Howells
    Cc: Yoshinori Sato
    Cc: Hirokazu Takata
    Cc: Ralf Baechle
    Cc: Kyle McMartin
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: Paul Mundt
    Cc: Kazumoto Kojima
    Cc: Richard Curnow
    Cc: William Lee Irwin III
    Cc: "David S. Miller"
    Cc: Jeff Dike
    Cc: Paolo 'Blaisorblade' Giarrusso
    Cc: Miles Bader
    Cc: Chris Zankel
    Cc: "Luck, Tony"
    Cc: Geert Uytterhoeven
    Cc: Roman Zippel
    Signed-off-by: Heiko Carstens
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Atsushi Nemoto
     

26 Sep, 2006

1 commit

  • This patch adds a vgetcpu vsyscall, which depending on the CPU RDTSCP
    capability uses either the RDTSCP or CPUID to obtain a CPU and node
    numbers and pass them to the program.

    AK: Lots of changes over Vojtech's original code:
    Better prototype for vgetcpu()
    It's better to pass the cpu / node numbers as separate arguments
    to avoid mistakes when going from SMP to NUMA.
    Also add a fast time stamp based cache using a user supplied
    argument to speed things more up.
    Use fast method from Chuck Ebbert to retrieve node/cpu from
    GDT limit instead of CPUID
    Made sure RDTSCP init is always executed after node is known.
    Drop printk

    Signed-off-by: Vojtech Pavlik
    Signed-off-by: Andi Kleen

    Vojtech Pavlik
     

17 Sep, 2006

1 commit

  • On Tue, 2006-09-12 at 17:44 +0100, David Woodhouse wrote:
    > asm-x86_64/elf.h requires asm/processor.h, which does not exist
    > asm-x86_64/signal.h requires linux/linkage.h, which does not exist
    > asm-x86_64/unistd.h requires linux/linkage.h, which does not exist
    > asm-x86_64/vsyscall.h requires linux/seqlock.h, which does not exist

    Again, move stuff which shouldn't be visible inside (mostly already existing)
    #ifdef __KERNEL__.

    This fixes a bunch of mislabelled and unlabelled #endifs in unistd.h and also
    cleans that up to conform with what's visible on other architectures, since
    the minimal fix for the error reported about would have involved a more
    intrusive patch, renesting other ifdefs.

    Signed-off-by: David Woodhouse
    Cc: Sam Ravnborg
    Cc: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    David Woodhouse
     

12 Jan, 2006

1 commit


13 Sep, 2005

1 commit


17 May, 2005

1 commit

  • There are unfortunately more and more multi processor Opteron systems which
    don't have HPET timer support in the southbridge. This covers in particular
    Nvidia and VIA chipsets. They also don't guarantee that the TSCs are
    synchronized between CPUs; and especially with MP powernow the systems are
    nearly unusable because the time gets very inconsistent between CPUs.

    The timer code for x86-64 was originally written under the assumption that we
    could fall back to the HPET timer on such systems. But this doesn't work
    there.

    Another alternative is to use the ACPI PM timer as primary time source. This
    patch does that. The kernel only uses PM timer when there is no other choice
    because it has some disadvantages.

    Ported over from i386. It should be faster than the i386 version because I
    dropped the "read three times" workaround, but is still considerable slower
    than HPET and also does not work together with vsyscalls which have to be
    disabled.

    Cc:
    Signed-off-by: Andi Kleen
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andi Kleen
     

17 Apr, 2005

1 commit

  • Initial git repository build. I'm not bothering with the full history,
    even though we have it. We can create a separate "historical" git
    archive of that later if we want to, and in the meantime it's about
    3.2GB when imported into git - space that would just make the early
    git days unnecessarily complicated, when we don't have a lot of good
    infrastructure for it.

    Let it rip!

    Linus Torvalds