07 Aug, 2010

2 commits

  • …inus', 'x86-apic-for-linus', 'x86-fpu-for-linus' and 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip

    * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86: Clean up arch/x86/kernel/cpu/mtrr/cleanup.c: use ";" not "," to terminate statements

    * 'x86-vmware-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, vmware: Preset lpj values when on VMware.

    * 'x86-mtrr-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, mtrr: Use stop machine context to rendezvous all the cpu's

    * 'x86-apic-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86/apic/es7000_32: Remove unused variable

    * 'x86-fpu-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86: Avoid unnecessary __clear_user() and xrstor in signal handling

    * 'x86-vdso-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, vdso: Unmap vdso pages

    Linus Torvalds
     
  • * 'x86-mm-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86: Ioremap: fix wrong physical address handling in PAT code
    x86, tlb: Clean up and correct used type
    x86, iomap: Fix wrong page aligned size calculation in ioremapping code
    x86, mm: Create symbolic index into address_markers array
    x86, ioremap: Fix normal ram range check
    x86, ioremap: Fix incorrect physical address handling in PAE mode
    x86-64, mm: Initialize VDSO earlier on 64 bits
    x86, kmmio/mmiotrace: Fix double free of kmmio_fault_pages

    Linus Torvalds
     

03 Aug, 2010

1 commit

  • We mapped vdso pages but never unmapped them and the virtual address
    is lost after exiting from the function, so unmap vdso pages here.

    Signed-off-by: Shaohua Li
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Shaohua Li
     

28 Jul, 2010

1 commit


19 Jun, 2010

2 commits

  • The vdso is a piece of userspace code which is supposed to be fully
    self-contained. Any external (undefined) reference is an error, and
    should be caught at compile time. This was giving us trouble when
    compiling with -Os on gcc 4.5.0, for example (failed inline).

    The need to do a buildtime check was pointed out by Andi Kleen.

    Reported-by: Andi Kleen
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    H. Peter Anvin
     
  • When initrd is in use and a driver does request_module() in its
    module_init (i.e. __initcall or device_initcall), a modprobe process
    is created with VDSO mapping. But VDSO is inited even in __initcall,
    i.e. on the same level (at the same time), so it may not be inited
    yet (link order matters).

    Move the VDSO initialization code earlier by switching to something
    before rootfs_initcall where initrd is loaded as rootfs. Specifically
    to subsys_initcall. Do it for standard 64-bit path (init_vdso_vars)
    and for compat (sysenter_setup), just in case people have 32-bit
    initrd and ia32 emulation built-in.

    i386 (pure 32-bit) is not affected, since sysenter_setup() is called
    from check_bugs()->identify_boot_cpu() in start_kernel() before
    rest_init()->kernel_thread(kernel_init) where even kernel_init() calls
    do_basic_setup()->do_initcalls().

    What this patch fixes are early modprobe crashes such as:
    Unpacking initramfs...
    Freeing initrd memory: 9324k freed
    modprobe[368]: segfault at 7fff4429c020 ip 00007fef397e160c \
    sp 00007fff442795c0 error 4 in ld-2.11.2.so[7fef397df000+1f000]

    Signed-off-by: Jiri Slaby
    LKML-Reference:
    Signed-off-by: H. Peter Anvin

    Jiri Slaby
     

30 Mar, 2010

1 commit

  • …it slab.h inclusion from percpu.h

    percpu.h is included by sched.h and module.h and thus ends up being
    included when building most .c files. percpu.h includes slab.h which
    in turn includes gfp.h making everything defined by the two files
    universally available and complicating inclusion dependencies.

    percpu.h -> slab.h dependency is about to be removed. Prepare for
    this change by updating users of gfp and slab facilities include those
    headers directly instead of assuming availability. As this conversion
    needs to touch large number of source files, the following script is
    used as the basis of conversion.

    http://userweb.kernel.org/~tj/misc/slabh-sweep.py

    The script does the followings.

    * Scan files for gfp and slab usages and update includes such that
    only the necessary includes are there. ie. if only gfp is used,
    gfp.h, if slab is used, slab.h.

    * When the script inserts a new include, it looks at the include
    blocks and try to put the new include such that its order conforms
    to its surrounding. It's put in the include block which contains
    core kernel includes, in the same order that the rest are ordered -
    alphabetical, Christmas tree, rev-Xmas-tree or at the end if there
    doesn't seem to be any matching order.

    * If the script can't find a place to put a new include (mostly
    because the file doesn't have fitting include block), it prints out
    an error message indicating which .h file needs to be added to the
    file.

    The conversion was done in the following steps.

    1. The initial automatic conversion of all .c files updated slightly
    over 4000 files, deleting around 700 includes and adding ~480 gfp.h
    and ~3000 slab.h inclusions. The script emitted errors for ~400
    files.

    2. Each error was manually checked. Some didn't need the inclusion,
    some needed manual addition while adding it to implementation .h or
    embedding .c file was more appropriate for others. This step added
    inclusions to around 150 files.

    3. The script was run again and the output was compared to the edits
    from #2 to make sure no file was left behind.

    4. Several build tests were done and a couple of problems were fixed.
    e.g. lib/decompress_*.c used malloc/free() wrappers around slab
    APIs requiring slab.h to be added manually.

    5. The script was run on all .h files but without automatically
    editing them as sprinkling gfp.h and slab.h inclusions around .h
    files could easily lead to inclusion dependency hell. Most gfp.h
    inclusion directives were ignored as stuff from gfp.h was usually
    wildly available and often used in preprocessor macros. Each
    slab.h inclusion directive was examined and added manually as
    necessary.

    6. percpu.h was updated not to include slab.h.

    7. Build test were done on the following configurations and failures
    were fixed. CONFIG_GCOV_KERNEL was turned off for all tests (as my
    distributed build env didn't work with gcov compiles) and a few
    more options had to be turned off depending on archs to make things
    build (like ipr on powerpc/64 which failed due to missing writeq).

    * x86 and x86_64 UP and SMP allmodconfig and a custom test config.
    * powerpc and powerpc64 SMP allmodconfig
    * sparc and sparc64 SMP allmodconfig
    * ia64 SMP allmodconfig
    * s390 SMP allmodconfig
    * alpha SMP allmodconfig
    * um on x86_64 SMP allmodconfig

    8. percpu.h modifications were reverted so that it could be applied as
    a separate patch and serve as bisection point.

    Given the fact that I had only a couple of failures from tests on step
    6, I'm fairly confident about the coverage of this conversion patch.
    If there is a breakage, it's likely to be something in one of the arch
    headers which should be easily discoverable easily on most builds of
    the specific arch.

    Signed-off-by: Tejun Heo <tj@kernel.org>
    Guess-its-ok-by: Christoph Lameter <cl@linux-foundation.org>
    Cc: Ingo Molnar <mingo@redhat.com>
    Cc: Lee Schermerhorn <Lee.Schermerhorn@hp.com>

    Tejun Heo
     

12 Nov, 2009

1 commit


20 Sep, 2009

1 commit


22 Aug, 2009

1 commit

  • 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: John Stultz
    Cc: Andi Kleen
    Cc: nikolag@ca.ibm.com
    Cc: Darren Hart
    Cc: arjan@infradead.org
    Cc: jonathan@jonmasters.org
    LKML-Reference:
    Signed-off-by: Thomas Gleixner

    john stultz
     

19 Jun, 2009

1 commit

  • Enable gcov profiling of the entire kernel on x86_64. Required changes
    include disabling profiling for:

    * arch/kernel/acpi/realmode and arch/kernel/boot/compressed:
    not linked to main kernel
    * arch/vdso, arch/kernel/vsyscall_64 and arch/kernel/hpet:
    profiling causes segfaults during boot (incompatible context)

    Signed-off-by: Peter Oberparleiter
    Cc: Andi Kleen
    Cc: Huang Ying
    Cc: Li Wei
    Cc: Michael Ellerman
    Cc: Ingo Molnar
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: Rusty Russell
    Cc: WANG Cong
    Cc: Sam Ravnborg
    Cc: Jeff Dike
    Cc: Al Viro
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Peter Oberparleiter
     

11 Jun, 2009

2 commits

  • Conflicts:
    arch/x86/kernel/irqinit.c
    arch/x86/kernel/irqinit_64.c
    arch/x86/kernel/traps.c
    arch/x86/mm/fault.c
    include/linux/sched.h
    kernel/exit.c

    Ingo Molnar
     
  • …el/git/tip/linux-2.6-tip

    * 'x86-cleanups-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
    x86, nmi: Use predefined numbers instead of hardcoded one
    x86: asm/processor.h: remove double declaration
    x86, mtrr: replace MTRRdefType_MSR with msr-index's MSR_MTRRdefType
    x86, mtrr: replace MTRRfix4K_C0000_MSR with msr-index's MSR_MTRRfix4K_C0000
    x86, mtrr: remove mtrr MSRs double declaration
    x86, mtrr: replace MTRRfix16K_80000_MSR with msr-index's MSR_MTRRfix16K_80000
    x86, mtrr: replace MTRRfix64K_00000_MSR with msr-index's MSR_MTRRfix64K_00000
    x86, mtrr: replace MTRRcap_MSR with msr-index's MSR_MTRRcap
    x86: mce: remove duplicated #include
    x86: msr-index.h remove duplicate MSR C001_0015 declaration
    x86: clean up arch/x86/kernel/tsc_sync.c a bit
    x86: use symbolic name for VM86_SIGNAL when used as vm86 default return
    x86: added 'ifndef _ASM_X86_IOMAP_H' to iomap.h
    x86: avoid multiple declaration of kstack_depth_to_print
    x86: vdso/vma.c declare vdso_enabled and arch_setup_additional_pages before they get used
    x86: clean up declarations and variables
    x86: apic/x2apic_cluster.c x86_cpu_to_logical_apicid should be static
    x86 early quirks: eliminate unused function

    Linus Torvalds
     

05 Jun, 2009

1 commit

  • In order to make arch_vma_name() work from inside
    install_special_mapping() we need to set the context.vdso
    before calling it.

    ( This is needed for performance counters to be able to track
    this special executable area. )

    Signed-off-by: Peter Zijlstra
    Cc: Mike Galbraith
    Cc: Paul Mackerras
    Cc: Arnaldo Carvalho de Melo
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Peter Zijlstra
     

30 Apr, 2009

1 commit

  • 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
    #include

    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: John Wright
    Cc: Andi Kleen
    Cc: John Wright
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    John Wright
     

13 Apr, 2009

1 commit


21 Feb, 2009

1 commit

  • Impact: cleanup

    Rename TASK_SIZE64 to TASK_SIZE_MAX, and provide the
    define on 32-bit too. (mapped to TASK_SIZE)

    This allows 32-bit code to make use of the (former-) TASK_SIZE64
    symbol as well, in a clean way.

    Cc: Linus Torvalds
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

10 Feb, 2009

1 commit


29 Dec, 2008

1 commit

  • * 'for-linus' of git://git390.osdl.marist.edu/pub/scm/linux-2.6: (85 commits)
    [S390] provide documentation for hvc_iucv kernel parameter.
    [S390] convert ctcm printks to dev_xxx and pr_xxx macros.
    [S390] convert zfcp printks to pr_xxx macros.
    [S390] convert vmlogrdr printks to pr_xxx macros.
    [S390] convert zfcp dumper printks to pr_xxx macros.
    [S390] convert cpu related printks to pr_xxx macros.
    [S390] convert qeth printks to dev_xxx and pr_xxx macros.
    [S390] convert sclp printks to pr_xxx macros.
    [S390] convert iucv printks to dev_xxx and pr_xxx macros.
    [S390] convert ap_bus printks to pr_xxx macros.
    [S390] convert dcssblk and extmem printks messages to pr_xxx macros.
    [S390] convert monwriter printks to pr_xxx macros.
    [S390] convert s390 debug feature printks to pr_xxx macros.
    [S390] convert monreader printks to pr_xxx macros.
    [S390] convert appldata printks to pr_xxx macros.
    [S390] convert setup printks to pr_xxx macros.
    [S390] convert hypfs printks to pr_xxx macros.
    [S390] convert time printks to pr_xxx macros.
    [S390] convert cpacf printks to pr_xxx macros.
    [S390] convert cio printks to pr_xxx macros.
    ...

    Linus Torvalds
     

25 Dec, 2008

1 commit

  • arch_setup_additional_pages currently gets two arguments, the binary
    format descripton and an indication if the process uses an executable
    stack or not. The second argument is not used by anybody, it could
    be removed without replacement.

    What actually does make sense is to pass an indication if the process
    uses the elf interpreter or not. The glibc code will not use anything
    from the vdso if the process does not use the dynamic linker, so for
    statically linked binaries the architecture backend can choose not
    to map the vdso.

    Acked-by: Ingo Molnar
    Signed-off-by: Martin Schwidefsky

    Martin Schwidefsky
     

13 Nov, 2008

1 commit

  • Impact: name change of unlikely tracer and profiler

    Ingo Molnar suggested changing the config from UNLIKELY_PROFILE
    to BRANCH_PROFILING. I never did like the "unlikely" name so I
    went one step farther, and renamed all the unlikely configurations
    to a "BRANCH" variant.

    Signed-off-by: Steven Rostedt
    Signed-off-by: Ingo Molnar

    Steven Rostedt
     

12 Nov, 2008

1 commit

  • Impact: fix bootup crash

    the branch tracer missed arch/x86/vdso/vclock_gettime.c from
    disabling tracing, which caused such bootup crashes:

    [ 201.840097] init[1]: segfault at 7fffed3fe7c0 ip 00007fffed3fea2e sp 000077

    also clean up the ugly ifdefs in arch/x86/kernel/vsyscall_64.c by
    creating DISABLE_UNLIKELY_PROFILE facility for code to turn off
    instrumentation on a per file basis.

    Signed-off-by: Ingo Molnar

    Ingo Molnar
     

21 Jul, 2008

1 commit


19 Jul, 2008

1 commit

  • Even though it's only the difference of the two __initdata symbols
    that's being calculated, modpost still doesn't like this. So rather
    calculate the size once in an __init function and store it for later
    use.

    Signed-off-by: Jan Beulich
    Signed-off-by: H. Peter Anvin

    Jan Beulich
     

16 Jul, 2008

1 commit

  • AMD only supports "syscall" from 32-bit compat usermode.
    Intel and Centaur(?) only support "sysenter" from 32-bit compat usermode.

    Set the X86 feature bits accordingly, and set up the vdso in
    accordance with those bits. On the offchance we run on in a 64-bit
    environment which supports neither syscall nor sysenter from 32-bit
    mode, then fall back to the int $0x80 vdso.

    Signed-off-by: Jeremy Fitzhardinge
    Signed-off-by: H. Peter Anvin

    Jeremy Fitzhardinge
     

14 Jul, 2008

1 commit


11 Jul, 2008

1 commit


08 Jul, 2008

1 commit


16 Jun, 2008

1 commit


25 May, 2008

1 commit


24 May, 2008

1 commit


23 May, 2008

1 commit

  • Jeremy's gcc 3.4 seems to be unable to inline a 8 byte memcpy. But the
    vdso doesn't support external references. Copy the structure members
    of struct timezone explicitely instead.

    Signed-off-by: Andi Kleen
    Cc: Jeremy Fitzhardinge
    Signed-off-by: Andrew Morton
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Andi Kleen
     

05 May, 2008

1 commit


01 May, 2008

1 commit

  • The kernel prints the compat vdso address regardless of whether compat
    vdso mode is enabled or not, which is confusing. Given that this
    isn't very interesting information anyway, just remove the printk.

    Signed-off-by: Jeremy Fitzhardinge
    Cc: Gerhard Mack
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Jeremy Fitzhardinge
     

29 Apr, 2008

1 commit

  • The 64-bit vDSO image is in a special ".vdso" section for no reason
    I can determine. Furthermore, the location of the vdso_end symbol
    includes some wrongly-calculated padding space in the image, which
    is then (correctly) rounded to page size, resulting in an extra page
    of zeros in the image mapped in to user processes.

    This changes it to put the vdso.so image into normal initdata as we
    have always done for the 32-bit vDSO images. The extra padding is
    gone, so the user VMA is one page instead of two. The image that
    was already copied around at boot time is now in initdata, so we
    recover that wasted space after boot.

    Signed-off-by: Roland McGrath
    Signed-off-by: Linus Torvalds

    Roland McGrath
     

20 Apr, 2008

1 commit

  • The 64-bit vDSO's sources are compiled with -g0 for no good reason.
    Using -g when enabled lets their separate debug files be used at
    runtime via build ID matching, same as we can see 32-bit vDSO's
    assembly sources.

    Signed-off-by: Roland McGrath
    Acked-by: Sam Ravnborg
    Signed-off-by: Ingo Molnar
    Signed-off-by: Thomas Gleixner

    Roland McGrath
     

17 Apr, 2008

3 commits


01 Mar, 2008

1 commit

  • Priit Laes discovered that the sed command processing nm output was
    sensitive to locale settings. This was addressed in commit
    03994f01e8b72b3d01fd3d09d1cc7c9f421a727c by using [:alnum:] in place of
    [a-zA-Z0-9].

    But that solution too is locale-dependent and may not always match
    the identifiers it needs to. The better fix is just to run sed et al
    with a fixed locale setting in all builds.

    Signed-off-by: Roland McGrath
    CC: Priit Laes
    Signed-off-by: Ingo Molnar

    Roland McGrath