08 Oct, 2016

1 commit

  • When doing an nmi backtrace of many cores, most of which are idle, the
    output is a little overwhelming and very uninformative. Suppress
    messages for cpus that are idling when they are interrupted and just
    emit one line, "NMI backtrace for N skipped: idling at pc 0xNNN".

    We do this by grouping all the cpuidle code together into a new
    .cpuidle.text section, and then checking the address of the interrupted
    PC to see if it lies within that section.

    This commit suitably tags x86 and tile idle routines, and only adds in
    the minimal framework for other architectures.

    Link: http://lkml.kernel.org/r/1472487169-14923-5-git-send-email-cmetcalf@mellanox.com
    Signed-off-by: Chris Metcalf
    Acked-by: Peter Zijlstra (Intel)
    Tested-by: Peter Zijlstra (Intel)
    Tested-by: Daniel Thompson [arm]
    Tested-by: Petr Mladek
    Cc: Aaron Tomlin
    Cc: Peter Zijlstra (Intel)
    Cc: "Rafael J. Wysocki"
    Cc: Russell King
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Chris Metcalf
     

04 Aug, 2016

1 commit

  • The dma-mapping core and the implementations do not change the DMA
    attributes passed by pointer. Thus the pointer can point to const data.
    However the attributes do not have to be a bitfield. Instead unsigned
    long will do fine:

    1. This is just simpler. Both in terms of reading the code and setting
    attributes. Instead of initializing local attributes on the stack
    and passing pointer to it to dma_set_attr(), just set the bits.

    2. It brings safeness and checking for const correctness because the
    attributes are passed by value.

    Semantic patches for this change (at least most of them):

    virtual patch
    virtual context

    @r@
    identifier f, attrs;

    @@
    f(...,
    - struct dma_attrs *attrs
    + unsigned long attrs
    , ...)
    {
    ...
    }

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    and

    // Options: --all-includes
    virtual patch
    virtual context

    @r@
    identifier f, attrs;
    type t;

    @@
    t f(..., struct dma_attrs *attrs);

    @@
    identifier r.f;
    @@
    f(...,
    - NULL
    + 0
    )

    Link: http://lkml.kernel.org/r/1468399300-5399-2-git-send-email-k.kozlowski@samsung.com
    Signed-off-by: Krzysztof Kozlowski
    Acked-by: Vineet Gupta
    Acked-by: Robin Murphy
    Acked-by: Hans-Christian Noren Egtvedt
    Acked-by: Mark Salter [c6x]
    Acked-by: Jesper Nilsson [cris]
    Acked-by: Daniel Vetter [drm]
    Reviewed-by: Bart Van Assche
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Fabien Dessenne [bdisp]
    Reviewed-by: Marek Szyprowski [vb2-core]
    Acked-by: David Vrabel [xen]
    Acked-by: Konrad Rzeszutek Wilk [xen swiotlb]
    Acked-by: Joerg Roedel [iommu]
    Acked-by: Richard Kuo [hexagon]
    Acked-by: Geert Uytterhoeven [m68k]
    Acked-by: Gerald Schaefer [s390]
    Acked-by: Bjorn Andersson
    Acked-by: Hans-Christian Noren Egtvedt [avr32]
    Acked-by: Vineet Gupta [arc]
    Acked-by: Robin Murphy [arm64 and dma-iommu]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Krzysztof Kozlowski
     

26 Mar, 2016

1 commit

  • KASAN needs to know whether the allocation happens in an IRQ handler.
    This lets us strip everything below the IRQ entry point to reduce the
    number of unique stack traces needed to be stored.

    Move the definition of __irq_entry to so that the
    users don't need to pull in . Also introduce the
    __softirq_entry macro which is similar to __irq_entry, but puts the
    corresponding functions to the .softirqentry.text section.

    Signed-off-by: Alexander Potapenko
    Acked-by: Steven Rostedt
    Cc: Christoph Lameter
    Cc: Pekka Enberg
    Cc: David Rientjes
    Cc: Joonsoo Kim
    Cc: Andrey Konovalov
    Cc: Dmitry Vyukov
    Cc: Andrey Ryabinin
    Cc: Konstantin Serebryany
    Cc: Dmitry Chernenkov
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Alexander Potapenko
     

10 Aug, 2015

1 commit

  • Migrate openrisc driver to the new 'set-state' interface provided by
    clockevents core, the earlier 'set-mode' interface is marked obsolete
    now.

    This also enables us to implement callbacks for new states of clockevent
    devices, for example: ONESHOT_STOPPED.

    We weren't doing anything in the ->set_mode() callback. So, this patch
    doesn't provide any set-state callbacks.

    Cc: Jonas Bonn
    Cc: linux@lists.openrisc.net
    Signed-off-by: Viresh Kumar
    Signed-off-by: Daniel Lezcano

    Viresh Kumar
     

16 Apr, 2015

3 commits

  • Merge second patchbomb from Andrew Morton:

    - the rest of MM

    - various misc bits

    - add ability to run /sbin/reboot at reboot time

    - printk/vsprintf changes

    - fiddle with seq_printf() return value

    * akpm: (114 commits)
    parisc: remove use of seq_printf return value
    lru_cache: remove use of seq_printf return value
    tracing: remove use of seq_printf return value
    cgroup: remove use of seq_printf return value
    proc: remove use of seq_printf return value
    s390: remove use of seq_printf return value
    cris fasttimer: remove use of seq_printf return value
    cris: remove use of seq_printf return value
    openrisc: remove use of seq_printf return value
    ARM: plat-pxa: remove use of seq_printf return value
    nios2: cpuinfo: remove use of seq_printf return value
    microblaze: mb: remove use of seq_printf return value
    ipc: remove use of seq_printf return value
    rtc: remove use of seq_printf return value
    power: wakeup: remove use of seq_printf return value
    x86: mtrr: if: remove use of seq_printf return value
    linux/bitmap.h: improve BITMAP_{LAST,FIRST}_WORD_MASK
    MAINTAINERS: CREDITS: remove Stefano Brivio from B43
    .mailmap: add Ricardo Ribalda
    CREDITS: add Ricardo Ribalda Delgado
    ...

    Linus Torvalds
     
  • The seq_printf return value, because it's frequently misused,
    will eventually be converted to void.

    See: commit 1f33c41c03da ("seq_file: Rename seq_overflow() to
    seq_has_overflowed() and make public")

    Signed-off-by: Joe Perches
    Cc: Jonas Bonn
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Joe Perches
     
  • Pull exec domain removal from Richard Weinberger:
    "This series removes execution domain support from Linux.

    The idea behind exec domains was to support different ABIs. The
    feature was never complete nor stable. Let's rip it out and make the
    kernel signal handling code less complicated"

    * 'exec_domain_rip_v2' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc: (27 commits)
    arm64: Removed unused variable
    sparc: Fix execution domain removal
    Remove rest of exec domains.
    arch: Remove exec_domain from remaining archs
    arc: Remove signal translation and exec_domain
    xtensa: Remove signal translation and exec_domain
    xtensa: Autogenerate offsets in struct thread_info
    x86: Remove signal translation and exec_domain
    unicore32: Remove signal translation and exec_domain
    um: Remove signal translation and exec_domain
    tile: Remove signal translation and exec_domain
    sparc: Remove signal translation and exec_domain
    sh: Remove signal translation and exec_domain
    s390: Remove signal translation and exec_domain
    mn10300: Remove signal translation and exec_domain
    microblaze: Remove signal translation and exec_domain
    m68k: Remove signal translation and exec_domain
    m32r: Remove signal translation and exec_domain
    m32r: Autogenerate offsets in struct thread_info
    frv: Remove signal translation and exec_domain
    ...

    Linus Torvalds
     

13 Apr, 2015

1 commit


12 Apr, 2015

1 commit


13 Feb, 2015

1 commit

  • If an attacker can cause a controlled kernel stack overflow, overwriting
    the restart block is a very juicy exploit target. This is because the
    restart_block is held in the same memory allocation as the kernel stack.

    Moving the restart block to struct task_struct prevents this exploit by
    making the restart_block harder to locate.

    Note that there are other fields in thread_info that are also easy
    targets, at least on some architectures.

    It's also a decent simplification, since the restart code is more or less
    identical on all architectures.

    [james.hogan@imgtec.com: metag: align thread_info::supervisor_stack]
    Signed-off-by: Andy Lutomirski
    Cc: Thomas Gleixner
    Cc: Al Viro
    Cc: "H. Peter Anvin"
    Cc: Ingo Molnar
    Cc: Kees Cook
    Cc: David Miller
    Acked-by: Richard Weinberger
    Cc: Richard Henderson
    Cc: Ivan Kokshaysky
    Cc: Matt Turner
    Cc: Vineet Gupta
    Cc: Russell King
    Cc: Catalin Marinas
    Cc: Will Deacon
    Cc: Haavard Skinnemoen
    Cc: Hans-Christian Egtvedt
    Cc: Steven Miao
    Cc: Mark Salter
    Cc: Aurelien Jacquiot
    Cc: Mikael Starvik
    Cc: Jesper Nilsson
    Cc: David Howells
    Cc: Richard Kuo
    Cc: "Luck, Tony"
    Cc: Geert Uytterhoeven
    Cc: Michal Simek
    Cc: Ralf Baechle
    Cc: Jonas Bonn
    Cc: "James E.J. Bottomley"
    Cc: Helge Deller
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Acked-by: Michael Ellerman (powerpc)
    Tested-by: Michael Ellerman (powerpc)
    Cc: Martin Schwidefsky
    Cc: Heiko Carstens
    Cc: Chen Liqin
    Cc: Lennox Wu
    Cc: Chris Metcalf
    Cc: Guan Xuetao
    Cc: Chris Zankel
    Cc: Max Filippov
    Cc: Oleg Nesterov
    Cc: Guenter Roeck
    Signed-off-by: James Hogan
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Andy Lutomirski
     

11 Feb, 2015

1 commit


20 Oct, 2014

1 commit

  • Pull audit updates from Eric Paris:
    "So this change across a whole bunch of arches really solves one basic
    problem. We want to audit when seccomp is killing a process. seccomp
    hooks in before the audit syscall entry code. audit_syscall_entry
    took as an argument the arch of the given syscall. Since the arch is
    part of what makes a syscall number meaningful it's an important part
    of the record, but it isn't available when seccomp shoots the
    syscall...

    For most arch's we have a better way to get the arch (syscall_get_arch)
    So the solution was two fold: Implement syscall_get_arch() everywhere
    there is audit which didn't have it. Use syscall_get_arch() in the
    seccomp audit code. Having syscall_get_arch() everywhere meant it was
    a useless flag on the stack and we could get rid of it for the typical
    syscall entry.

    The other changes inside the audit system aren't grand, fixed some
    records that had invalid spaces. Better locking around the task comm
    field. Removing some dead functions and structs. Make some things
    static. Really minor stuff"

    * git://git.infradead.org/users/eparis/audit: (31 commits)
    audit: rename audit_log_remove_rule to disambiguate for trees
    audit: cull redundancy in audit_rule_change
    audit: WARN if audit_rule_change called illegally
    audit: put rule existence check in canonical order
    next: openrisc: Fix build
    audit: get comm using lock to avoid race in string printing
    audit: remove open_arg() function that is never used
    audit: correct AUDIT_GET_FEATURE return message type
    audit: set nlmsg_len for multicast messages.
    audit: use union for audit_field values since they are mutually exclusive
    audit: invalid op= values for rules
    audit: use atomic_t to simplify audit_serial()
    kernel/audit.c: use ARRAY_SIZE instead of sizeof/sizeof[0]
    audit: reduce scope of audit_log_fcaps
    audit: reduce scope of audit_net_id
    audit: arm64: Remove the audit arch argument to audit_syscall_entry
    arm64: audit: Add audit hook in syscall_trace_enter/exit()
    audit: x86: drop arch from __audit_syscall_entry() interface
    sparc: implement is_32bit_task
    sparc: properly conditionalize use of TIF_32BIT
    ...

    Linus Torvalds
     

24 Sep, 2014

1 commit

  • We have a function where the arch can be queried, syscall_get_arch().
    So rather than have every single piece of arch specific code use and/or
    duplicate syscall_get_arch(), just have the audit code use the
    syscall_get_arch() code.

    Based-on-patch-by: Richard Briggs
    Signed-off-by: Eric Paris
    Cc: linux-alpha@vger.kernel.org
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-ia64@vger.kernel.org
    Cc: microblaze-uclinux@itee.uq.edu.au
    Cc: linux-mips@linux-mips.org
    Cc: linux@lists.openrisc.net
    Cc: linux-parisc@vger.kernel.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: linux-s390@vger.kernel.org
    Cc: linux-sh@vger.kernel.org
    Cc: sparclinux@vger.kernel.org
    Cc: user-mode-linux-devel@lists.sourceforge.net
    Cc: linux-xtensa@linux-xtensa.org
    Cc: x86@kernel.org

    Eric Paris
     

03 Sep, 2014

2 commits

  • The openrisc irqchip driver has been converted to handle_domain_irq,
    making it possible to remove the handle_IRQ stub entierely.

    Signed-off-by: Marc Zyngier
    Acked-by: Stefan Kristiansson
    Link: https://lkml.kernel.org/r/1409047421-27649-27-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Jason Cooper

    Marc Zyngier
     
  • In order to limit code duplication, convert the architecture specific
    handle_IRQ to use the generic __handle_domain_irq function.

    Signed-off-by: Marc Zyngier
    Acked-by: Stefan Kristiansson
    Link: https://lkml.kernel.org/r/1409047421-27649-5-git-send-email-marc.zyngier@arm.com
    Signed-off-by: Jason Cooper

    Marc Zyngier
     

10 Aug, 2014

1 commit

  • Pull arch signal handling cleanup from Richard Weinberger:
    "This patch series moves all remaining archs to the get_signal(),
    signal_setup_done() and sigsp() functions.

    Currently these archs use open coded variants of the said functions.
    Further, unused parameters get removed from get_signal_to_deliver(),
    tracehook_signal_handler() and signal_delivered().

    At the end of the day we save around 500 lines of code."

    * 'signal-cleanup' of git://git.kernel.org/pub/scm/linux/kernel/git/rw/misc: (43 commits)
    powerpc: Use sigsp()
    openrisc: Use sigsp()
    mn10300: Use sigsp()
    mips: Use sigsp()
    microblaze: Use sigsp()
    metag: Use sigsp()
    m68k: Use sigsp()
    m32r: Use sigsp()
    hexagon: Use sigsp()
    frv: Use sigsp()
    cris: Use sigsp()
    c6x: Use sigsp()
    blackfin: Use sigsp()
    avr32: Use sigsp()
    arm64: Use sigsp()
    arc: Use sigsp()
    sas_ss_flags: Remove nested ternary if
    Rip out get_signal_to_deliver()
    Clean up signal_delivered()
    tracehook_signal_handler: Remove sig, info, ka and regs
    ...

    Linus Torvalds
     

06 Aug, 2014

1 commit


01 Jul, 2014

1 commit

  • In addition to consolidating the or1k-pic with other interrupt
    controllers, this makes OpenRISC less tied to its on-cpu
    interrupt controller.

    All or1k-pic specific parts are moved out of irq.c and into
    drivers/irqchip/irq-or1k-pic.c

    In that transition, the functionality have been divided into
    three chip variants.
    One that handles level triggered interrupts, one that handles edge
    triggered interrupts and one that handles the interrupt
    controller that is present in the or1200 OpenRISC cpu
    implementation.

    Signed-off-by: Stefan Kristiansson
    Link: https://lkml.kernel.org/r/1401136302-27654-1-git-send-email-stefan.kristiansson@saunalahti.fi
    Acked-by: Jonas Bonn
    Signed-off-by: Jason Cooper

    Stefan Kristiansson
     

30 Apr, 2014

1 commit

  • Unify the various architectures __dtb_start and __dtb_end definitions
    moving them into of_fdt.h.

    Signed-off-by: Rob Herring
    Acked-by: Vineet Gupta
    Acked-by: James Hogan
    Tested-by: Michal Simek
    Cc: Ralf Baechle
    Cc: Jonas Bonn
    Cc: Chris Zankel
    Cc: Max Filippov
    Cc: linux-metag@vger.kernel.org
    Cc: linux-mips@linux-mips.org
    Cc: linux@lists.openrisc.net
    Cc: linux-xtensa@linux-xtensa.org
    Tested-by: Grant Likely
    Tested-by: Stephen Chivers

    Rob Herring
     

09 Jan, 2014

2 commits

  • Use the more generic functions get_signal() signal_setup_done()
    for signal delivery.

    Signed-off-by: Richard Weinberger
    Signed-off-by: Jonas Bonn

    Richard Weinberger
     
  • The mainline signal handling code for OpenRISC has been buggy since day
    one with respect to syscall restart. This patch significantly reworks
    the signal handling code:

    i) Move the "work pending" loop to C code (borrowed from ARM arch)

    ii) Allow a tracer to muck about with the IP and skip syscall restart
    in that case (again, borrowed from ARM)

    iii) Make signal handling WRT syscall restart actually work

    v) Make the signal handling code look more like that of other
    architectures so that it's easier for others to follow

    Reported-by: Anders Nystrom
    Signed-off-by: Jonas Bonn

    Jonas Bonn
     

16 Nov, 2013

1 commit

  • Pull OpenRISC updates from Jonas Bonn:
    - small cleanups to make allmodconfig pass
    - defconfig refresh
    - a handful of code sanitization patches

    * tag 'for-3.13' of git://git.openrisc.net/~jonas/linux:
    openrisc: Refactor or32_early_setup()
    openrisc: Remove unused declaration of __initramfs_start
    openrisc: Use the declarations provided by
    openrisc: Refresh or1ksim_defconfig for v3.12
    openrisc: Refactor 16-bit constant relocation
    openrisc: include: asm: Kbuild: add default "vga.h"
    openrisc: Makefile: append "-D__linux__" to KBUILD_CFLAGS

    Linus Torvalds
     

15 Nov, 2013

3 commits


05 Nov, 2013

1 commit

  • arch/openrisc/kernel/module.c: In function 'apply_relocate_add':
    arch/openrisc/kernel/module.c:50:13: warning: assignment from incompatible pointer type
    arch/openrisc/kernel/module.c:54:13: warning: assignment from incompatible pointer type

    Move the pointer increments to the dereference statements to avoid
    incompatible pointer assignments, and remove superfluous casts.

    Signed-off-by: Geert Uytterhoeven
    Signed-off-by: Jonas Bonn

    Geert Uytterhoeven
     

10 Oct, 2013

6 commits

  • It appears openrisc prom.c was just copied from another arch with a
    bunch of unnecessary includes. Remove all the unecessary ones.

    Signed-off-by: Rob Herring
    Cc: Jonas Bonn
    Cc: linux@lists.openrisc.net

    Rob Herring
     
  • All arches do essentially the same thing now for
    early_init_dt_setup_initrd_arch, so it can now be removed.

    Signed-off-by: Rob Herring
    Acked-by: Vineet Gupta
    Cc: Russell King
    Cc: Mark Salter
    Cc: Aurelien Jacquiot
    Cc: James Hogan
    Cc: Michal Simek
    Cc: Ralf Baechle
    Cc: Jonas Bonn
    Cc: Benjamin Herrenschmidt
    Cc: Paul Mackerras
    Cc: Thomas Gleixner
    Cc: Ingo Molnar
    Cc: "H. Peter Anvin"
    Cc: x86@kernel.org
    Cc: Chris Zankel
    Cc: Max Filippov
    Acked-by: Grant Likely

    Rob Herring
     
  • Create a weak version of early_init_dt_add_memory_arch which uses
    memblock. This will unify all architectures except ones with custom
    memory bank structs.

    Signed-off-by: Rob Herring
    Acked-by: Catalin Marinas
    Cc: Will Deacon
    Cc: Michal Simek
    Cc: Jonas Bonn
    Acked-by: Grant Likely
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: microblaze-uclinux@itee.uq.edu.au
    Cc: linux@lists.openrisc.net
    Cc: devicetree@vger.kernel.org

    Rob Herring
     
  • Convert openrisc to use new early_init_dt_scan function.

    Signed-off-by: Rob Herring
    Cc: Jonas Bonn
    Cc: linux@lists.openrisc.net

    Rob Herring
     
  • Use the common unflatten_and_copy_device_tree to copy the built-in FDT
    out of init section. This moves the copy later in the boot, but there
    do not appear to be any references to strings in the FDT before the copy.

    Signed-off-by: Rob Herring
    Cc: Jonas Bonn
    Cc: linux@lists.openrisc.net

    Rob Herring
     
  • Save some pointless copying of the kernel command line and just use
    boot_command_line instead. The DT code already handles CONFIG_CMDLINE,
    so a separate copy is not needed.

    Signed-off-by: Rob Herring
    Cc: Jonas Bonn
    Cc: linux@lists.openrisc.net
    Reviewed-by: Grant Likely

    Rob Herring
     

29 Aug, 2013

1 commit


24 Jul, 2013

1 commit

  • On some PAE architectures, the entire range of physical memory could reside
    outside the 32-bit limit. These systems need the ability to specify the
    initrd location using 64-bit numbers.

    This patch globally modifies the early_init_dt_setup_initrd_arch() function to
    use 64-bit numbers instead of the current unsigned long.

    There has been quite a bit of debate about whether to use u64 or phys_addr_t.
    It was concluded to stick to u64 to be consistent with rest of the device
    tree code. As summarized by Geert, "The address to load the initrd is decided
    by the bootloader/user and set at that point later in time. The dtb should not
    be tied to the kernel you are booting"

    More details on the discussion can be found here:
    https://lkml.org/lkml/2013/6/20/690
    https://lkml.org/lkml/2012/9/13/544

    Signed-off-by: Santosh Shilimkar
    Acked-by: Rob Herring
    Acked-by: Vineet Gupta
    Acked-by: Jean-Christophe PLAGNIOL-VILLARD
    Signed-off-by: Grant Likely

    Santosh Shilimkar
     

15 Jul, 2013

1 commit

  • The __cpuinit type of throwaway sections might have made sense
    some time ago when RAM was more constrained, but now the savings
    do not offset the cost and complications. For example, the fix in
    commit 5e427ec2d0 ("x86: Fix bit corruption at CPU resume time")
    is a good example of the nasty type of bugs that can be created
    with improper use of the various __init prefixes.

    After a discussion on LKML[1] it was decided that cpuinit should go
    the way of devinit and be phased out. Once all the users are gone,
    we can then finally remove the macros themselves from linux/init.h.

    Note that some harmless section mismatch warnings may result, since
    notify_cpu_starting() and cpu_up() are arch independent (kernel/cpu.c)
    are flagged as __cpuinit -- so if we remove the __cpuinit from
    arch specific callers, we will also get section mismatch warnings.
    As an intermediate step, we intend to turn the linux/init.h cpuinit
    content into no-ops as early as possible, since that will get rid
    of these warnings. In any case, they are temporary and harmless.

    This removes all the arch/openrisc uses of the __cpuinit macros from
    all C files. Currently openrisc does not have any __CPUINIT used in
    assembly files.

    [1] https://lkml.org/lkml/2013/5/20/589

    Cc: Jonas Bonn
    Cc: linux@lists.openrisc.net
    Signed-off-by: Paul Gortmaker

    Paul Gortmaker
     

01 May, 2013

2 commits

  • show_regs() is inherently arch-dependent but it does make sense to print
    generic debug information and some archs already do albeit in slightly
    different forms. This patch introduces a generic function to print debug
    information from show_regs() so that different archs print out the same
    information and it's much easier to modify what's printed.

    show_regs_print_info() prints out the same debug info as dump_stack()
    does plus task and thread_info pointers.

    * Archs which didn't print debug info now do.

    alpha, arc, blackfin, c6x, cris, frv, h8300, hexagon, ia64, m32r,
    metag, microblaze, mn10300, openrisc, parisc, score, sh64, sparc,
    um, xtensa

    * Already prints debug info. Replaced with show_regs_print_info().
    The printed information is superset of what used to be there.

    arm, arm64, avr32, mips, powerpc, sh32, tile, unicore32, x86

    * s390 is special in that it used to print arch-specific information
    along with generic debug info. Heiko and Martin think that the
    arch-specific extra isn't worth keeping s390 specfic implementation.
    Converted to use the generic version.

    Note that now all archs print the debug info before actual register
    dumps.

    An example BUG() dump follows.

    kernel BUG at /work/os/work/kernel/workqueue.c:4841!
    invalid opcode: 0000 [#1] PREEMPT SMP DEBUG_PAGEALLOC
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.9.0-rc1-work+ #7
    Hardware name: empty empty/S3992, BIOS 080011 10/26/2007
    task: ffff88007c85e040 ti: ffff88007c860000 task.ti: ffff88007c860000
    RIP: 0010:[] [] init_workqueues+0x4/0x6
    RSP: 0000:ffff88007c861ec8 EFLAGS: 00010246
    RAX: ffff88007c861fd8 RBX: ffffffff824466a8 RCX: 0000000000000001
    RDX: 0000000000000046 RSI: 0000000000000001 RDI: ffffffff8234a07a
    RBP: ffff88007c861ec8 R08: 0000000000000000 R09: 0000000000000000
    R10: 0000000000000001 R11: 0000000000000000 R12: ffffffff8234a07a
    R13: 0000000000000000 R14: 0000000000000000 R15: 0000000000000000
    FS: 0000000000000000(0000) GS:ffff88007dc00000(0000) knlGS:0000000000000000
    CS: 0010 DS: 0000 ES: 0000 CR0: 000000008005003b
    CR2: ffff88015f7ff000 CR3: 00000000021f1000 CR4: 00000000000007f0
    DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
    DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
    Stack:
    ffff88007c861ef8 ffffffff81000312 ffffffff824466a8 ffff88007c85e650
    0000000000000003 0000000000000000 ffff88007c861f38 ffffffff82335e5d
    ffff88007c862080 ffffffff8223d8c0 ffff88007c862080 ffffffff81c47760
    Call Trace:
    [] do_one_initcall+0x122/0x170
    [] kernel_init_freeable+0x9b/0x1c8
    [] ? rest_init+0x140/0x140
    [] kernel_init+0xe/0xf0
    [] ret_from_fork+0x7c/0xb0
    [] ? rest_init+0x140/0x140
    ...

    v2: Typo fix in x86-32.

    v3: CPU number dropped from show_regs_print_info() as
    dump_stack_print_info() has been updated to print it. s390
    specific implementation dropped as requested by s390 maintainers.

    Signed-off-by: Tejun Heo
    Acked-by: David S. Miller
    Acked-by: Jesper Nilsson
    Cc: Heiko Carstens
    Cc: Martin Schwidefsky
    Cc: Bjorn Helgaas
    Cc: Fengguang Wu
    Cc: Mike Frysinger
    Cc: Vineet Gupta
    Cc: Sam Ravnborg
    Acked-by: Chris Metcalf [tile bits]
    Acked-by: Richard Kuo [hexagon bits]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     
  • Both dump_stack() and show_stack() are currently implemented by each
    architecture. show_stack(NULL, NULL) dumps the backtrace for the
    current task as does dump_stack(). On some archs, dump_stack() prints
    extra information - pid, utsname and so on - in addition to the
    backtrace while the two are identical on other archs.

    The usages in arch-independent code of the two functions indicate
    show_stack(NULL, NULL) should print out bare backtrace while
    dump_stack() is used for debugging purposes when something went wrong,
    so it does make sense to print additional information on the task which
    triggered dump_stack().

    There's no reason to require archs to implement two separate but mostly
    identical functions. It leads to unnecessary subtle information.

    This patch expands the dummy fallback dump_stack() implementation in
    lib/dump_stack.c such that it prints out debug information (taken from
    x86) and invokes show_stack(NULL, NULL) and drops arch-specific
    dump_stack() implementations in all archs except blackfin. Blackfin's
    dump_stack() does something wonky that I don't understand.

    Debug information can be printed separately by calling
    dump_stack_print_info() so that arch-specific dump_stack()
    implementation can still emit the same debug information. This is used
    in blackfin.

    This patch brings the following behavior changes.

    * On some archs, an extra level in backtrace for show_stack() could be
    printed. This is because the top frame was determined in
    dump_stack() on those archs while generic dump_stack() can't do that
    reliably. It can be compensated by inlining dump_stack() but not
    sure whether that'd be necessary.

    * Most archs didn't use to print debug info on dump_stack(). They do
    now.

    An example WARN dump follows.

    WARNING: at kernel/workqueue.c:4841 init_workqueues+0x35/0x505()
    Hardware name: empty
    Modules linked in:
    CPU: 0 PID: 1 Comm: swapper/0 Not tainted 3.9.0-rc1-work+ #9
    0000000000000009 ffff88007c861e08 ffffffff81c614dc ffff88007c861e48
    ffffffff8108f50f ffffffff82228240 0000000000000040 ffffffff8234a03c
    0000000000000000 0000000000000000 0000000000000000 ffff88007c861e58
    Call Trace:
    [] dump_stack+0x19/0x1b
    [] warn_slowpath_common+0x7f/0xc0
    [] warn_slowpath_null+0x1a/0x20
    [] init_workqueues+0x35/0x505
    ...

    v2: CPU number added to the generic debug info as requested by s390
    folks and dropped the s390 specific dump_stack(). This loses %ksp
    from the debug message which the maintainers think isn't important
    enough to keep the s390-specific dump_stack() implementation.

    dump_stack_print_info() is moved to kernel/printk.c from
    lib/dump_stack.c. Because linkage is per objecct file,
    dump_stack_print_info() living in the same lib file as generic
    dump_stack() means that archs which implement custom dump_stack()
    - at this point, only blackfin - can't use dump_stack_print_info()
    as that will bring in the generic version of dump_stack() too. v1
    The v1 patch broke build on blackfin due to this issue. The build
    breakage was reported by Fengguang Wu.

    Signed-off-by: Tejun Heo
    Acked-by: David S. Miller
    Acked-by: Vineet Gupta
    Acked-by: Jesper Nilsson
    Acked-by: Vineet Gupta
    Acked-by: Martin Schwidefsky [s390 bits]
    Cc: Heiko Carstens
    Cc: Mike Frysinger
    Cc: Fengguang Wu
    Cc: Bjorn Helgaas
    Cc: Sam Ravnborg
    Acked-by: Richard Kuo [hexagon bits]
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Tejun Heo
     

08 Apr, 2013

1 commit

  • Idle poller with an extra check_pgt_cache() invocation. Use the core
    code.

    Signed-off-by: Thomas Gleixner
    Cc: Linus Torvalds
    Cc: Rusty Russell
    Cc: Paul McKenney
    Cc: Peter Zijlstra
    Reviewed-by: Cc: Srivatsa S. Bhat
    Cc: Magnus Damm
    Link: http://lkml.kernel.org/r/20130321215234.886530981@linutronix.de
    Signed-off-by: Thomas Gleixner

    Thomas Gleixner
     

27 Feb, 2013

1 commit

  • Pull OpenRISC updates from Jonas Bonn:
    "An equal number of bug fixes and trivial cleanups; no new features.

    - Two patches to fix errors thrown by the updated toolchain.

    - Three other bug fixes.

    - Four trivial cleanups."

    * 'for-upstream' of git://openrisc.net/jonas/linux:
    openrisc: add missing header inclusion
    openrisc: really pass correct arg to schedule_tail
    Add bitops include needed for ext2 filesystem
    openrisc: update DTLB-miss handler last
    openrisc: fix up vmalloc page table loading
    openrisc idle: delete pm_idle
    openrisc: remove CONFIG_SYMBOL_PREFIX
    openrisc: avoid using function parameter regs in reset vector
    openrisc: remove unused current_regs

    Linus Torvalds
     

26 Feb, 2013

1 commit