25 Sep, 2009

1 commit


24 Sep, 2009

3 commits

  • * remove asm/atomic.h inclusion from linux/utsname.h --
    not needed after kref conversion
    * remove linux/utsname.h inclusion from files which do not need it

    NOTE: it looks like fs/binfmt_elf.c do not need utsname.h, however
    due to some personality stuff it _is_ needed -- cowardly leave ELF-related
    headers and files alone.

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     
  • * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-next: (30 commits)
    Use macros for .data.page_aligned section.
    Use macros for .bss.page_aligned section.
    Use new __init_task_data macro in arch init_task.c files.
    kbuild: Don't define ALIGN and ENTRY when preprocessing linker scripts.
    arm, cris, mips, sparc, powerpc, um, xtensa: fix build with bash 4.0
    kbuild: add static to prototypes
    kbuild: fail build if recordmcount.pl fails
    kbuild: set -fconserve-stack option for gcc 4.5
    kbuild: echo the record_mcount command
    gconfig: disable "typeahead find" search in treeviews
    kbuild: fix cc1 options check to ensure we do not use -fPIC when compiling
    checkincludes.pl: add option to remove duplicates in place
    markup_oops: use modinfo to avoid confusion with underscored module names
    checkincludes.pl: provide usage helper
    checkincludes.pl: close file as soon as we're done with it
    ctags: usability fix
    kernel hacking: move STRIP_ASM_SYMS from General
    gitignore usr/initramfs_data.cpio.bz2 and usr/initramfs_data.cpio.lzma
    kbuild: Check if linker supports the -X option
    kbuild: introduce ld-option
    ...

    Fix trivial conflict in scripts/basic/fixdep.c

    Linus Torvalds
     
  • Commit ebd2c8f6d2ec4012c267ecb95e72a57b8355a705 removed struct uart_info and
    commit bdc04e3174e18f475289fa8f4144f66686326b7e further moved delta_msr_wait.
    Fix up the MN10300 on-chip serial port drivers to comply with this.

    Signed-off-by: David Howells
    Signed-off-by: Linus Torvalds

    David Howells
     

23 Sep, 2009

1 commit

  • Make all seq_operations structs const, to help mitigate against
    revectoring user-triggerable function pointers.

    This is derived from the grsecurity patch, although generated from scratch
    because it's simpler than extracting the changes from there.

    Signed-off-by: James Morris
    Acked-by: Serge Hallyn
    Acked-by: Casey Schaufler
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    James Morris
     

21 Sep, 2009

2 commits

  • Bye-bye Performance Counters, welcome Performance Events!

    In the past few months the perfcounters subsystem has grown out its
    initial role of counting hardware events, and has become (and is
    becoming) a much broader generic event enumeration, reporting, logging,
    monitoring, analysis facility.

    Naming its core object 'perf_counter' and naming the subsystem
    'perfcounters' has become more and more of a misnomer. With pending
    code like hw-breakpoints support the 'counter' name is less and
    less appropriate.

    All in one, we've decided to rename the subsystem to 'performance
    events' and to propagate this rename through all fields, variables
    and API names. (in an ABI compatible fashion)

    The word 'event' is also a bit shorter than 'counter' - which makes
    it slightly more convenient to write/handle as well.

    Thanks goes to Stephane Eranian who first observed this misnomer and
    suggested a rename.

    User-space tooling and ABI compatibility is not affected - this patch
    should be function-invariant. (Also, defconfigs were not touched to
    keep the size down.)

    This patch has been generated via the following script:

    FILES=$(find * -type f | grep -vE 'oprofile|[^K]config')

    sed -i \
    -e 's/PERF_EVENT_/PERF_RECORD_/g' \
    -e 's/PERF_COUNTER/PERF_EVENT/g' \
    -e 's/perf_counter/perf_event/g' \
    -e 's/nb_counters/nb_events/g' \
    -e 's/swcounter/swevent/g' \
    -e 's/tpcounter_event/tp_event/g' \
    $FILES

    for N in $(find . -name perf_counter.[ch]); do
    M=$(echo $N | sed 's/perf_counter/perf_event/g')
    mv $N $M
    done

    FILES=$(find . -name perf_event.*)

    sed -i \
    -e 's/COUNTER_MASK/REG_MASK/g' \
    -e 's/COUNTER/EVENT/g' \
    -e 's/\/event_id/g' \
    -e 's/counter/event/g' \
    -e 's/Counter/Event/g' \
    $FILES

    ... to keep it as correct as possible. This script can also be
    used by anyone who has pending perfcounters patches - it converts
    a Linux kernel tree over to the new naming. We tried to time this
    change to the point in time where the amount of pending patches
    is the smallest: the end of the merge window.

    Namespace clashes were fixed up in a preparatory patch - and some
    stylistic fallout will be fixed up in a subsequent patch.

    ( NOTE: 'counters' are still the proper terminology when we deal
    with hardware registers - and these sed scripts are a bit
    over-eager in renaming them. I've undone some of that, but
    in case there's something left where 'counter' would be
    better than 'event' we can undo that on an individual basis
    instead of touching an otherwise nicely automated patch. )

    Suggested-by: Stephane Eranian
    Acked-by: Peter Zijlstra
    Acked-by: Paul Mackerras
    Reviewed-by: Arjan van de Ven
    Cc: Mike Galbraith
    Cc: Arnaldo Carvalho de Melo
    Cc: Frederic Weisbecker
    Cc: Steven Rostedt
    Cc: Benjamin Herrenschmidt
    Cc: David Howells
    Cc: Kyle McMartin
    Cc: Martin Schwidefsky
    Cc: "David S. Miller"
    Cc: Thomas Gleixner
    Cc: "H. Peter Anvin"
    Cc:
    LKML-Reference:
    Signed-off-by: Ingo Molnar

    Ingo Molnar
     
  • Signed-off-by: Joe Perches
    Signed-off-by: Tim Abbott
    Acked-by: Paul Mundt
    Signed-off-by: Sam Ravnborg

    Joe Perches
     

20 Sep, 2009

1 commit


16 Sep, 2009

1 commit

  • * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tj/percpu: (46 commits)
    powerpc64: convert to dynamic percpu allocator
    sparc64: use embedding percpu first chunk allocator
    percpu: kill lpage first chunk allocator
    x86,percpu: use embedding for 64bit NUMA and page for 32bit NUMA
    percpu: update embedding first chunk allocator to handle sparse units
    percpu: use group information to allocate vmap areas sparsely
    vmalloc: implement pcpu_get_vm_areas()
    vmalloc: separate out insert_vmalloc_vm()
    percpu: add chunk->base_addr
    percpu: add pcpu_unit_offsets[]
    percpu: introduce pcpu_alloc_info and pcpu_group_info
    percpu: move pcpu_lpage_build_unit_map() and pcpul_lpage_dump_cfg() upward
    percpu: add @align to pcpu_fc_alloc_fn_t
    percpu: make @dyn_size mandatory for pcpu_setup_first_chunk()
    percpu: drop @static_size from first chunk allocators
    percpu: generalize first chunk allocator selection
    percpu: build first chunk allocators selectively
    percpu: rename 4k first chunk allocator to page
    percpu: improve boot messages
    percpu: fix pcpu_reclaim() locking
    ...

    Fix trivial conflict as by Tejun Heo in kernel/sched.c

    Linus Torvalds
     

02 Sep, 2009

1 commit

  • Add a keyctl to install a process's session keyring onto its parent. This
    replaces the parent's session keyring. Because the COW credential code does
    not permit one process to change another process's credentials directly, the
    change is deferred until userspace next starts executing again. Normally this
    will be after a wait*() syscall.

    To support this, three new security hooks have been provided:
    cred_alloc_blank() to allocate unset security creds, cred_transfer() to fill in
    the blank security creds and key_session_to_parent() - which asks the LSM if
    the process may replace its parent's session keyring.

    The replacement may only happen if the process has the same ownership details
    as its parent, and the process has LINK permission on the session keyring, and
    the session keyring is owned by the process, and the LSM permits it.

    Note that this requires alteration to each architecture's notify_resume path.
    This has been done for all arches barring blackfin, m68k* and xtensa, all of
    which need assembly alteration to support TIF_NOTIFY_RESUME. This allows the
    replacement to be performed at the point the parent process resumes userspace
    execution.

    This allows the userspace AFS pioctl emulation to fully emulate newpag() and
    the VIOCSETTOK and VIOCSETTOK2 pioctls, all of which require the ability to
    alter the parent process's PAG membership. However, since kAFS doesn't use
    PAGs per se, but rather dumps the keys into the session keyring, the session
    keyring of the parent must be replaced if, for example, VIOCSETTOK is passed
    the newpag flag.

    This can be tested with the following program:

    #include
    #include
    #include

    #define KEYCTL_SESSION_TO_PARENT 18

    #define OSERROR(X, S) do { if ((long)(X) == -1) { perror(S); exit(1); } } while(0)

    int main(int argc, char **argv)
    {
    key_serial_t keyring, key;
    long ret;

    keyring = keyctl_join_session_keyring(argv[1]);
    OSERROR(keyring, "keyctl_join_session_keyring");

    key = add_key("user", "a", "b", 1, keyring);
    OSERROR(key, "add_key");

    ret = keyctl(KEYCTL_SESSION_TO_PARENT);
    OSERROR(ret, "KEYCTL_SESSION_TO_PARENT");

    return 0;
    }

    Compiled and linked with -lkeyutils, you should see something like:

    [dhowells@andromeda ~]$ keyctl show
    Session Keyring
    -3 --alswrv 4043 4043 keyring: _ses
    355907932 --alswrv 4043 -1 \_ keyring: _uid.4043
    [dhowells@andromeda ~]$ /tmp/newpag
    [dhowells@andromeda ~]$ keyctl show
    Session Keyring
    -3 --alswrv 4043 4043 keyring: _ses
    1055658746 --alswrv 4043 4043 \_ user: a
    [dhowells@andromeda ~]$ /tmp/newpag hello
    [dhowells@andromeda ~]$ keyctl show
    Session Keyring
    -3 --alswrv 4043 4043 keyring: hello
    340417692 --alswrv 4043 4043 \_ user: a

    Where the test program creates a new session keyring, sticks a user key named
    'a' into it and then installs it on its parent.

    Signed-off-by: David Howells
    Signed-off-by: James Morris

    David Howells
     

14 Aug, 2009

1 commit

  • Conflicts:
    arch/sparc/kernel/smp_64.c
    arch/x86/kernel/cpu/perf_counter.c
    arch/x86/kernel/setup_percpu.c
    drivers/cpufreq/cpufreq_ondemand.c
    mm/percpu.c

    Conflicts in core and arch percpu codes are mostly from commit
    ed78e1e078dd44249f88b1dd8c76dafb39567161 which substituted many
    num_possible_cpus() with nr_cpu_ids. As for-next branch has moved all
    the first chunk allocators into mm/percpu.c, the changes are moved
    from arch code to mm/percpu.c.

    Signed-off-by: Tejun Heo

    Tejun Heo
     

18 Jul, 2009

1 commit

  • The BSS section macros in vmlinux.lds.h currently place the .sbss
    input section outside the bounds of [__bss_start, __bss_end]. On all
    architectures except for microblaze that handle both .sbss and
    __bss_start/__bss_end, this is wrong: the .sbss input section is
    within the range [__bss_start, __bss_end]. Relatedly, the example
    code at the top of the file actually has __bss_start/__bss_end defined
    twice; I believe the right fix here is to define them in the
    BSS_SECTION macro but not in the BSS macro.

    Another problem with the current macros is that several
    architectures have an ALIGN(4) or some other small number just before
    __bss_stop in their linker scripts. The BSS_SECTION macro currently
    hardcodes this to 4; while it should really be an argument. It also
    ignores its sbss_align argument; fix that.

    mn10300 is the only user at present of any of the macros touched by
    this patch. It looks like mn10300 actually was incorrectly converted
    to use the new BSS() macro (the alignment of 4 prior to conversion was
    a __bss_stop alignment, but the argument to the BSS macro is a start
    alignment). So fix this as well.

    I'd like acks from Sam and David on this one. Also CCing Paul, since
    he has a patch from me which will need to be updated to use
    BSS_SECTION(0, PAGE_SIZE, 4) once this gets merged.

    Signed-off-by: Tim Abbott
    Cc: Paul Mundt
    Cc: David Howells
    Signed-off-by: Sam Ravnborg

    Tim Abbott
     

14 Jul, 2009

1 commit


13 Jul, 2009

1 commit

  • * Remove smp_lock.h from files which don't need it (including some headers!)
    * Add smp_lock.h to files which do need it
    * Make smp_lock.h include conditional in hardirq.h
    It's needed only for one kernel_locked() usage which is under CONFIG_PREEMPT

    This will make hardirq.h inclusion cheaper for every PREEMPT=n config
    (which includes allmodconfig/allyesconfig, BTW)

    Signed-off-by: Alexey Dobriyan
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

09 Jul, 2009

2 commits

  • Discarded sections in different archs share some commonality but have
    considerable differences. This led to linker script for each arch
    implementing its own /DISCARD/ definition, which makes maintaining
    tedious and adding new entries error-prone.

    This patch makes all linker scripts to move discard definitions to the
    end of the linker script and use the common DISCARDS macro. As ld
    uses the first matching section definition, archs can include default
    discarded sections by including them earlier in the linker script.

    ia64 is notable because it first throws away some ia64 specific
    subsections and then include the rest of the sections into the final
    image, so those sections must be discarded before the inclusion.

    defconfig compile tested for x86, x86-64, powerpc, powerpc64, ia64,
    alpha, sparc, sparc64 and s390. Michal Simek tested microblaze.

    Signed-off-by: Tejun Heo
    Acked-by: Paul Mundt
    Acked-by: Mike Frysinger
    Tested-by: Michal Simek
    Cc: linux-arch@vger.kernel.org
    Cc: Michal Simek
    Cc: microblaze-uclinux@itee.uq.edu.au
    Cc: Sam Ravnborg
    Cc: Tony Luck

    Tejun Heo
     
  • Commit 5fd29d6ccbc98884569d6f3105aeca70858b3e0f ("printk: clean up
    handling of log-levels and newlines") changed printk semantics. printk
    lines with multiple KERN_ prefixes are no longer emitted as
    before the patch.

    is now included in the output on each additional use.

    Remove all uses of multiple KERN_s in formats.

    Signed-off-by: Joe Perches
    Signed-off-by: Linus Torvalds

    Joe Perches
     

05 Jul, 2009

1 commit

  • * git://git.kernel.org/pub/scm/linux/kernel/git/sam/kbuild-fixes:
    kbuild: finally remove the obsolete variable $TOPDIR
    gitignore: ignore scripts/ihex2fw
    Kbuild: Disable the -Wformat-security gcc flag
    gitignore: ignore gcov output files
    kbuild: deb-pkg ship changelog
    Add new __init_task_data macro to be used in arch init_task.c files.
    asm-generic/vmlinux.lds.h: shuffle INIT_TASK* macro names in vmlinux.lds.h
    Add new macros for page-aligned data and bss sections.
    asm-generic/vmlinux.lds.h: Fix up RW_DATA_SECTION definition.

    Linus Torvalds
     

04 Jul, 2009

1 commit

  • Pull linus#master to merge PER_CPU_DEF_ATTRIBUTES and alpha build fix
    changes. As alpha in percpu tree uses 'weak' attribute instead of
    inline assembly, there's no need for __used attribute.

    Conflicts:
    arch/alpha/include/asm/percpu.h
    arch/mn10300/kernel/vmlinux.lds.S
    include/linux/percpu-defs.h

    Tejun Heo
     

01 Jul, 2009

1 commit


27 Jun, 2009

1 commit

  • We recently added a INIT_TASK(align) in include/asm-generic/vmlinux.lds.h,
    but there is already a macro INIT_TASK in include/linux/init_task.h, which
    is quite confusing. We should switch the macro in the linker script to
    INIT_TASK_DATA. (Sorry that I missed this in reviewing the patch). Since
    the macros are new, there is only one user of the INIT_TASK in
    vmlinux.lds.h, arch/mn10300/kernel/vmlinux.lds.S.

    However, we are currently using INIT_TASK_DATA for laying down an entire
    .data.init_task section. So rename that to INIT_TASK_DATA_SECTION.

    I would be worried about changing the meaning of INIT_TASK_DATA, but the
    old INIT_TASK_DATA implementation had no users, and in fact if anyone had
    tried to use it, it would have failed to compile because it didn't pass
    the alignment to the old INIT_TASK.

    Signed-off-by: Tim Abbott
    Cc: David Howells
    Cc: Jesper Nilsson

    Tim Abbott
     

24 Jun, 2009

1 commit

  • x86 throws away .discard section but no other archs do. Also,
    .discard is not thrown away while linking modules. Make every arch
    and module linking throw it away. This will be used to define dummy
    variables for percpu declarations and definitions.

    This patch is based on Ivan Kokshaysky's alpha percpu patch.

    [ Impact: always throw away everything in .discard ]

    Signed-off-by: Tejun Heo
    Cc: Ivan Kokshaysky
    Cc: Richard Henderson
    Cc: Russell King
    Cc: Haavard Skinnemoen
    Cc: Bryan Wu
    Cc: Mikael Starvik
    Cc: Jesper Nilsson
    Cc: David Howells
    Cc: Yoshinori Sato
    Cc: Tony Luck
    Cc: Hirokazu Takata
    Cc: Geert Uytterhoeven
    Cc: Michal Simek
    Cc: Ralf Baechle
    Cc: Kyle McMartin
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Paul Mundt
    Cc: David S. Miller
    Cc: Jeff Dike
    Cc: Chris Zankel
    Cc: Rusty Russell
    Cc: Ingo Molnar

    Tejun Heo
     

23 Jun, 2009

1 commit


19 Jun, 2009

2 commits


17 Jun, 2009

1 commit

  • * create mm/init-mm.c, move init_mm there
    * remove INIT_MM, initialize init_mm with C99 initializer
    * unexport init_mm on all arches:

    init_mm is already unexported on x86.

    One strange place is some OMAP driver (drivers/video/omap/) which
    won't build modular, but it's already wants get_vm_area() export.
    Somebody should look there.

    [akpm@linux-foundation.org: add missing #includes]
    Signed-off-by: Alexey Dobriyan
    Cc: Mike Frysinger
    Cc: Americo Wang
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexey Dobriyan
     

12 Jun, 2009

2 commits


27 Apr, 2009

1 commit

  • This has the consequence of changing the section name use for head
    code from ".text.head" to ".head.text". Since this commit changes all
    users in the architecture, this change should be harmless.

    Signed-off-by: Tim Abbott
    Cc: David Howells
    Acked-by: Sam Ravnborg
    Signed-off-by: Linus Torvalds

    Tim Abbott
     

16 Apr, 2009

2 commits


10 Apr, 2009

2 commits


03 Apr, 2009

1 commit


30 Mar, 2009

1 commit


28 Mar, 2009

1 commit


13 Feb, 2009

1 commit


21 Jan, 2009

1 commit


15 Jan, 2009

1 commit

  • Impact: fix build errors

    Since the SPARSE IRQS changes redefined how the kstat irqs are
    organized, arch's must use the new accessor function:

    kstat_incr_irqs_this_cpu(irq, DESC);

    If CONFIG_SPARSE_IRQS is set, then DESC is a pointer to the
    irq_desc which has a pointer to the kstat_irqs. If not, then
    the .irqs field of struct kernel_stat is used instead.

    Signed-off-by: Mike Travis
    Signed-off-by: Ingo Molnar

    Mike Travis
     

14 Jan, 2009

1 commit


11 Jan, 2009

1 commit

  • Impact: build fix

    Ingo Molnar wrote:

    > tip/arch/blackfin/kernel/irqchip.c: In function 'show_interrupts':
    > tip/arch/blackfin/kernel/irqchip.c:85: error: 'struct kernel_stat' has no member named 'irqs'
    > make[2]: *** [arch/blackfin/kernel/irqchip.o] Error 1
    > make[2]: *** Waiting for unfinished jobs....
    >

    So could move kstat_irqs array to irq_desc struct.

    (s390, m68k, sparc) are not touched yet, because they don't support genirq

    Signed-off-by: Yinghai Lu
    Signed-off-by: Ingo Molnar

    Yinghai Lu