15 Mar, 2017

3 commits

  • This was detected by allmodconfig, errors reported:

    ERROR: "empty_zero_page" [net/ceph/libceph.ko] undefined!
    ERROR: "__ucmpdi2" [lib/842/842_decompress.ko] undefined!
    ERROR: "empty_zero_page" [fs/nfs/objlayout/objlayoutdriver.ko] undefined!
    ERROR: "empty_zero_page" [fs/exofs/exofs.ko] undefined!
    ERROR: "empty_zero_page" [fs/crypto/fscrypto.ko] undefined!
    ERROR: "__ucmpdi2" [fs/btrfs/btrfs.ko] undefined!
    ERROR: "pm_power_off" [drivers/regulator/act8865-regulator.ko] undefined!
    ERROR: "__ucmpdi2" [drivers/media/i2c/adv7842.ko] undefined!
    ERROR: "__clear_user" [drivers/md/dm-mod.ko] undefined!
    ERROR: "__clear_user" [net/netfilter/x_tables.ko] undefined!

    Signed-off-by: Stafford Horne

    Stafford Horne
     
  • Was getting the following error with allmodconfig:

    ERROR: "__get_user_bad" [lib/test_user_copy.ko] undefined!

    This was simply a missing break statement, causing an unwanted fall
    through.

    Signed-off-by: Stafford Horne

    Stafford Horne
     
  • When building allmodconfig this warning shows.

    fs/ocfs2/file.c: In function 'ocfs2_file_write_iter':
    ./arch/openrisc/include/asm/cmpxchg.h:81:3: warning: value computed is
    not used [-Wunused-value]
    ((typeof(*(ptr)))__xchg((unsigned long)(with), (ptr), sizeof(*(ptr))))
    ^

    Applying the same patch logic that was done to the cmpxchg macro.

    Signed-off-by: Stafford Horne

    Stafford Horne
     

10 Mar, 2017

1 commit

  • If an architecture uses 4level-fixup.h we don't need to do anything as
    it includes 5level-fixup.h.

    If an architecture uses pgtable-nop*d.h, define __ARCH_USE_5LEVEL_HACK
    before inclusion of the header. It makes asm-generic code to use
    5level-fixup.h.

    If an architecture has 4-level paging or folds levels on its own,
    include 5level-fixup.h directly.

    Signed-off-by: Kirill A. Shutemov
    Acked-by: Michal Hocko
    Signed-off-by: Linus Torvalds

    Kirill A. Shutemov
     

02 Mar, 2017

5 commits


28 Feb, 2017

3 commits

  • Fix typos and add the following to the scripts/spelling.txt:

    efective||effective

    While we are here, fix the "addres" as well in the touched line in
    arch/openrisc/kernel/entry.S.

    Link: http://lkml.kernel.org/r/1481573103-11329-10-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Acked-by: Geert Uytterhoeven
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     
  • Fix typos and add the following to the scripts/spelling.txt:

    aligment||alignment

    I did not touch the "N_BYTE_ALIGMENT" macro in
    drivers/net/wireless/realtek/rtlwifi/wifi.h to avoid unpredictable
    impact.

    I fixed "_aligment_handler" in arch/openrisc/kernel/entry.S because
    it is surrounded by #if 0 ... #endif. It is surely safe and I
    confirmed "_alignment_handler" is correct.

    I also fixed the "controler" I found in the same hunk in
    arch/openrisc/kernel/head.S.

    Link: http://lkml.kernel.org/r/1481573103-11329-8-git-send-email-yamada.masahiro@socionext.com
    Signed-off-by: Masahiro Yamada
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Masahiro Yamada
     
  • Often all is needed is these small helpers, instead of compiler.h or a
    full kprobes.h. This is important for asm helpers, in fact even some
    asm/kprobes.h make use of these helpers... instead just keep a generic
    asm file with helpers useful for asm code with the least amount of
    clutter as possible.

    Likewise we need now to also address what to do about this file for both
    when architectures have CONFIG_HAVE_KPROBES, and when they do not. Then
    for when architectures have CONFIG_HAVE_KPROBES but have disabled
    CONFIG_KPROBES.

    Right now most asm/kprobes.h do not have guards against CONFIG_KPROBES,
    this means most architecture code cannot include asm/kprobes.h safely.
    Correct this and add guards for architectures missing them.
    Additionally provide architectures that not have kprobes support with
    the default asm-generic solution. This lets us force asm/kprobes.h on
    the header include/linux/kprobes.h always, but most importantly we can
    now safely include just asm/kprobes.h on architecture code without
    bringing the full kitchen sink of header files.

    Two architectures already provided a guard against CONFIG_KPROBES on its
    kprobes.h: sh, arch. The rest of the architectures needed gaurds added.
    We avoid including any not-needed headers on asm/kprobes.h unless
    kprobes have been enabled.

    In a subsequent atomic change we can try now to remove compiler.h from
    include/linux/kprobes.h.

    During this sweep I've also identified a few architectures defining a
    common macro needed for both kprobes and ftrace, that of the definition
    of the breakput instruction up. Some refer to this as
    BREAKPOINT_INSTRUCTION. This must be kept outside of the #ifdef
    CONFIG_KPROBES guard.

    [mcgrof@kernel.org: fix arm64 build]
    Link: http://lkml.kernel.org/r/CAB=NE6X1WMByuARS4mZ1g9+W=LuVBnMDnh_5zyN0CLADaVh=Jw@mail.gmail.com
    [sfr@canb.auug.org.au: fixup for kprobes declarations moving]
    Link: http://lkml.kernel.org/r/20170214165933.13ebd4f4@canb.auug.org.au
    Link: http://lkml.kernel.org/r/20170203233139.32682-1-mcgrof@kernel.org
    Signed-off-by: Luis R. Rodriguez
    Signed-off-by: Stephen Rothwell
    Acked-by: Masami Hiramatsu
    Cc: Arnd Bergmann
    Cc: Masami Hiramatsu
    Cc: Ananth N Mavinakayanahalli
    Cc: Anil S Keshavamurthy
    Cc: David S. Miller
    Cc: Ingo Molnar
    Cc: Thomas Gleixner
    Cc: H. Peter Anvin
    Cc: Andy Lutomirski
    Cc: Steven Rostedt
    Signed-off-by: Andrew Morton
    Signed-off-by: Linus Torvalds

    Luis R. Rodriguez
     

26 Feb, 2017

1 commit

  • Pull rdma DMA mapping updates from Doug Ledford:
    "Drop IB DMA mapping code and use core DMA code instead.

    Bart Van Assche noted that the ib DMA mapping code was significantly
    similar enough to the core DMA mapping code that with a few changes it
    was possible to remove the IB DMA mapping code entirely and switch the
    RDMA stack to use the core DMA mapping code.

    This resulted in a nice set of cleanups, but touched the entire tree
    and has been kept separate for that reason."

    * tag 'for-next-dma_ops' of git://git.kernel.org/pub/scm/linux/kernel/git/dledford/rdma: (37 commits)
    IB/rxe, IB/rdmavt: Use dma_virt_ops instead of duplicating it
    IB/core: Remove ib_device.dma_device
    nvme-rdma: Switch from dma_device to dev.parent
    RDS: net: Switch from dma_device to dev.parent
    IB/srpt: Modify a debug statement
    IB/srp: Switch from dma_device to dev.parent
    IB/iser: Switch from dma_device to dev.parent
    IB/IPoIB: Switch from dma_device to dev.parent
    IB/rxe: Switch from dma_device to dev.parent
    IB/vmw_pvrdma: Switch from dma_device to dev.parent
    IB/usnic: Switch from dma_device to dev.parent
    IB/qib: Switch from dma_device to dev.parent
    IB/qedr: Switch from dma_device to dev.parent
    IB/ocrdma: Switch from dma_device to dev.parent
    IB/nes: Remove a superfluous assignment statement
    IB/mthca: Switch from dma_device to dev.parent
    IB/mlx5: Switch from dma_device to dev.parent
    IB/mlx4: Switch from dma_device to dev.parent
    IB/i40iw: Remove a superfluous assignment statement
    IB/hns: Switch from dma_device to dev.parent
    ...

    Linus Torvalds
     

25 Feb, 2017

18 commits

  • Pull OpenRISC updates from Stafford Horne:
    "Highlights include:

    - optimized memset and memcpy routines, ~20% boot time saving

    - support for cpu idling

    - adding support for l.swa and l.lwa atomic operations (in spec from
    2014)

    - use atomics to implement: bitops, cmpxchg, futex

    - the atomics are in preparation for SMP support"

    * tag 'openrisc-for-linus' of git://github.com/openrisc/linux: (25 commits)
    openrisc: head: Init r0 to 0 on start
    openrisc: Export ioremap symbols used by modules
    arch/openrisc/lib/memcpy.c: use correct OR1200 option
    openrisc: head: Remove unused strings
    openrisc: head: Move init strings to rodata section
    openrisc: entry: Fix delay slot detection
    openrisc: entry: Whitespace and comment cleanups
    scripts/checkstack.pl: Add openrisc support
    MAINTAINERS: Add the openrisc official repository
    openrisc: Add .gitignore
    openrisc: Add optimized memcpy routine
    openrisc: Add optimized memset
    openrisc: Initial support for the idle state
    openrisc: Fix the bitmask for the unit present register
    openrisc: remove unnecessary stddef.h include
    openrisc: add futex_atomic_* implementations
    openrisc: add optimized atomic operations
    openrisc: add cmpxchg and xchg implementations
    openrisc: add atomic bitops
    openrisc: add l.lwa/l.swa emulation
    ...

    Linus Torvalds
     
  • Originally openrisc spec 0 specified that r0 would be wired to ground.
    This is no longer the case. r0 is not guaranteed to be 0 at init, so we
    need to initialize it to 0 before using it.

    Also, if we are clearing r0 we cant use r0 to clear itself. Change the
    the CLEAR_GPR macro to use movhi for clearing.

    Reported-by: Jakob Viketoft
    Signed-off-by: Stafford Horne

    Stafford Horne
     
  • Noticed this when building with allyesconfig. Got build failures due
    to iounmap and __ioremap symbols missing. This patch exports them so
    modules can use them. This is inline with other architectures.

    Signed-off-by: Stafford Horne

    Stafford Horne
     
  • The Kconfig option for OR12000 is OR1K_1200.

    Signed-off-by: Valentin Rothberg
    Signed-off-by: Stafford Horne

    Valentin Rothberg
     
  • These string definitions are no longer used removed them. Noticed this
    while working on a CONFIG_DEBUG_INFO build issue.

    Signed-off-by: Stafford Horne

    Stafford Horne
     
  • The strings used during the head/init phase of openrisc bootup were
    stored in the executable section of the binary.

    This causes compilation to fail when using CONFIG_DEBUG_INFO with
    error:
    Error: unaligned opcodes detected in executable segment

    Signed-off-by: Stafford Horne

    Stafford Horne
     
  • Use execption SR stored in pt_regs for detection, the current SR is not
    correct as the handler is running after return from exception.

    Also, The code that checks for a delay slot uses a flag bitmask and then
    wants to check if the result is not zero. The test it implemented was
    wrong.

    Correct it by changing the test to check result against non zero.

    Signed-off-by: Stafford Horne

    Stafford Horne
     
  • Cleanups to whitespace and add some comments. Reading through the delay
    slot logic I noticed some things:
    - Delay slot instructions were not indented
    - Some comments are not lined up
    - Use tabs and spaces consistent with other code

    No functional change

    Signed-off-by: Stafford Horne

    Stafford Horne
     
  • This helps to suppress the vmlinux.lds file.

    Signed-off-by: Stafford Horne

    Stafford Horne
     
  • The generic memcpy routine provided in kernel does only byte copies.
    Using word copies we can lower boot time and cycles spend in memcpy
    quite significantly.

    Booting on my de0 nano I see boot times go from 7.2 to 5.6 seconds.
    The avg cycles in memcpy during boot go from 6467 to 1887.

    I tested several algorithms (see code in previous patch mails)

    The implementations I tested and avg cycles:
    - Word Copies + Loop Unrolls + Non Aligned 1882
    - Word Copies + Loop Unrolls 1887
    - Word Copies 2441
    - Byte Copies + Loop Unrolls 6467
    - Byte Copies 7600

    In the end I ended up going with Word Copies + Loop Unrolls as it
    provides best tradeoff between simplicity and boot speedups.

    Signed-off-by: Stafford Horne

    Stafford Horne
     
  • This adds a hand-optimized assembler version of memset and sets
    __HAVE_ARCH_MEMSET to use this version instead of the generic C
    routine

    Signed-off-by: Olof Kindgren
    Signed-off-by: Stafford Horne

    Olof Kindgren
     
  • This patch adds basic support for the idle state of the cpu.
    The patch overrides the regular idle function, enables the interupts,
    checks for the power management unit and enables the cpu doze mode
    if available.

    Signed-off-by: Sebastian Macke
    [shorne@gmail.com: Fixed checkpatch, blankline after declarations]
    Signed-off-by: Stafford Horne

    Sebastian Macke
     
  • The bits were swapped, as per spec and processor implementation the
    power management present bit is 9 and PIC bit is 8. This patch brings
    the definitions into spec.

    Signed-off-by: Sebastian Macke
    [shorne@gmail.com: Added commit body]
    Signed-off-by: Stafford Horne

    Sebastian Macke
     
  • This causes the build to fail when building with the or1k-musl-linux-
    toolchain and it is not needed.

    Signed-off-by: Stafford Horne

    Stefan Kristiansson
     
  • Support for the futex_atomic_* operations by using the
    load-link/store-conditional l.lwa/l.swa instructions.
    Most openrisc cores provide these instructions now if not available,
    emulation is provided.

    Acked-by: Peter Zijlstra (Intel)
    Cc: Peter Zijlstra
    Signed-off-by: Stefan Kristiansson
    [shorne@gmail.com: remove OPENRISC_HAVE_INST_LWA_SWA config suggesed by
    Alan Cox https://lkml.org/lkml/2014/7/23/666]
    Signed-off-by: Stafford Horne

    Stefan Kristiansson
     
  • Using the l.lwa and l.swa atomic instruction pair.
    Most openrisc processor cores provide these instructions now. If the
    instructions are not available emulation is provided.

    Acked-by: Peter Zijlstra (Intel)
    Cc: Peter Zijlstra
    Signed-off-by: Stefan Kristiansson
    [shorne@gmail.com: remove OPENRISC_HAVE_INST_LWA_SWA config suggesed by
    Alan Cox https://lkml.org/lkml/2014/7/23/666]
    [shorne@gmail.com: expand to implement all ops suggested by Peter
    Zijlstra https://lkml.org/lkml/2017/2/20/317]
    Signed-off-by: Stafford Horne

    Stefan Kristiansson
     
  • Optimized version that make use of the l.lwa and l.swa atomic instruction
    pair.
    Most openrisc cores provide these instructions now, if not available
    emulation is provided.

    Acked-by: Peter Zijlstra (Intel)
    Cc: Peter Zijlstra
    Signed-off-by: Stefan Kristiansson
    [shorne@gmail.com: remove OPENRISC_HAVE_INST_LWA_SWA config suggesed by
    Alan Cox https://lkml.org/lkml/2014/7/23/666]
    [shorne@gmail.com: fixed unused calculated value compiler warning in
    define cmpxchg]
    Signed-off-by: Stafford Horne

    Stefan Kristiansson
     
  • This utilize the load-link/store-conditional l.lwa and l.swa
    instructions to implement the atomic bitops.
    When those instructions are not available emulation is provided.

    Acked-by: Peter Zijlstra (Intel)
    Cc: Peter Zijlstra
    Signed-off-by: Stefan Kristiansson
    [shorne@gmail.com: remove OPENRISC_HAVE_INST_LWA_SWA config suggesed by
    Alan Cox https://lkml.org/lkml/2014/7/23/666, implement
    test_and_change_bit]
    Signed-off-by: Stafford Horne

    Stefan Kristiansson
     

22 Feb, 2017

1 commit

  • Pull exception table module split from Paul Gortmaker:
    "Final extable.h related changes.

    This completes the separation of exception table content from the
    module.h header file. This is achieved with the final commit that
    removes the one line back compatible change that sourced extable.h
    into the module.h file.

    The commits are unchanged since January, with the exception of a
    couple Acks that came in for the last two commits a bit later. The
    changes have been in linux-next for quite some time[1] and have got
    widespread arch coverage via toolchains I have and also from
    additional ones the kbuild bot has.

    Maintaners of the various arch were Cc'd during the postings to
    lkml[2] and informed that the intention was to take the remaining arch
    specific changes and lump them together with the final two non-arch
    specific changes and submit for this merge window.

    The ia64 diffstat stands out and probably warrants a mention. In an
    earlier review, Al Viro made a valid comment that the original header
    separation of content left something to be desired, and that it get
    fixed as a part of this change, hence the larger diffstat"

    * tag 'extable-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/paulg/linux: (21 commits)
    module.h: remove extable.h include now users have migrated
    core: migrate exception table users off module.h and onto extable.h
    cris: migrate exception table users off module.h and onto extable.h
    hexagon: migrate exception table users off module.h and onto extable.h
    microblaze: migrate exception table users off module.h and onto extable.h
    unicore32: migrate exception table users off module.h and onto extable.h
    score: migrate exception table users off module.h and onto extable.h
    metag: migrate exception table users off module.h and onto extable.h
    arc: migrate exception table users off module.h and onto extable.h
    nios2: migrate exception table users off module.h and onto extable.h
    sparc: migrate exception table users onto extable.h
    openrisc: migrate exception table users off module.h and onto extable.h
    frv: migrate exception table users off module.h and onto extable.h
    sh: migrate exception table users off module.h and onto extable.h
    xtensa: migrate exception table users off module.h and onto extable.h
    mn10300: migrate exception table users off module.h and onto extable.h
    alpha: migrate exception table users off module.h and onto extable.h
    arm: migrate exception table users off module.h and onto extable.h
    m32r: migrate exception table users off module.h and onto extable.h
    ia64: ensure exception table search users include extable.h
    ...

    Linus Torvalds
     

06 Feb, 2017

6 commits


01 Feb, 2017

1 commit

  • cputime_t is now only used by two architectures:

    * powerpc (when CONFIG_VIRT_CPU_ACCOUNTING_NATIVE=y)
    * s390

    And since the core doesn't use it anymore, we don't need any arch support
    from the others. So we can remove their stub implementations.

    A final cleanup would be to provide an efficient pure arch
    implementation of cputime_to_nsec() for s390 and powerpc and finally
    remove include/linux/cputime.h .

    Signed-off-by: Frederic Weisbecker
    Cc: Benjamin Herrenschmidt
    Cc: Fenghua Yu
    Cc: Heiko Carstens
    Cc: Linus Torvalds
    Cc: Martin Schwidefsky
    Cc: Michael Ellerman
    Cc: Paul Mackerras
    Cc: Peter Zijlstra
    Cc: Rik van Riel
    Cc: Stanislaw Gruszka
    Cc: Thomas Gleixner
    Cc: Tony Luck
    Cc: Wanpeng Li
    Link: http://lkml.kernel.org/r/1485832191-26889-36-git-send-email-fweisbec@gmail.com
    Signed-off-by: Ingo Molnar

    Frederic Weisbecker
     

26 Jan, 2017

1 commit

  • These files were only including module.h for exception table related
    functions. We've now separated that content out into its own file
    "extable.h" so now move over to that and avoid all the extra header
    content in module.h that we don't really need to compile these files.

    Reported-by: kbuild test robot
    Cc: Jonas Bonn
    Cc: Stefan Kristiansson
    Cc: Stafford Horne
    Cc: openrisc@lists.librecores.org
    Signed-off-by: Paul Gortmaker

    Paul Gortmaker