28 Oct, 2020

1 commit


27 Oct, 2020

1 commit


23 Oct, 2020

1 commit

  • Pull initial set_fs() removal from Al Viro:
    "Christoph's set_fs base series + fixups"

    * 'work.set_fs' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
    fs: Allow a NULL pos pointer to __kernel_read
    fs: Allow a NULL pos pointer to __kernel_write
    powerpc: remove address space overrides using set_fs()
    powerpc: use non-set_fs based maccess routines
    x86: remove address space overrides using set_fs()
    x86: make TASK_SIZE_MAX usable from assembly code
    x86: move PAGE_OFFSET, TASK_SIZE & friends to page_{32,64}_types.h
    lkdtm: remove set_fs-based tests
    test_bitmap: remove user bitmap tests
    uaccess: add infrastructure for kernel builds with set_fs()
    fs: don't allow splice read/write without explicit ops
    fs: don't allow kernel reads and writes without iter ops
    sysctl: Convert to iter interfaces
    proc: add a read_iter method to proc proc_ops
    proc: cleanup the compat vs no compat file ops
    proc: remove a level of indentation in proc_get_inode

    Linus Torvalds
     

09 Oct, 2020

1 commit

  • In order to make adding configurable features into seccomp easier,
    it's better to have the options at one single location, considering
    especially that the bulk of seccomp code is arch-independent. An quick
    look also show that many SECCOMP descriptions are outdated; they talk
    about /proc rather than prctl.

    As a result of moving the config option and keeping it default on,
    architectures arm, arm64, csky, riscv, sh, and xtensa did not have SECCOMP
    on by default prior to this and SECCOMP will be default in this change.

    Architectures microblaze, mips, powerpc, s390, sh, and sparc have an
    outdated depend on PROC_FS and this dependency is removed in this change.

    Suggested-by: Jann Horn
    Link: https://lore.kernel.org/lkml/CAG48ez1YWz9cnp08UZgeieYRhHdqh-ch7aNwc4JRBnGyrmgfMg@mail.gmail.com/
    Signed-off-by: YiFei Zhu
    [kees: added HAVE_ARCH_SECCOMP help text, tweaked wording]
    Signed-off-by: Kees Cook
    Link: https://lore.kernel.org/r/9ede6ef35c847e58d61e476c6a39540520066613.1600951211.git.yifeifz2@illinois.edu

    YiFei Zhu
     

09 Sep, 2020

1 commit

  • Add a CONFIG_SET_FS option that is selected by architecturess that
    implement set_fs, which is all of them initially. If the option is not
    set stubs for routines related to overriding the address space are
    provided so that architectures can start to opt out of providing set_fs.

    Signed-off-by: Christoph Hellwig
    Reviewed-by: Kees Cook
    Signed-off-by: Al Viro

    Christoph Hellwig
     

07 Aug, 2020

1 commit

  • Pull arch/csky updates from Guo Ren:
    "New features:
    - seccomp-filter
    - err-injection
    - top-down&random mmap-layout
    - irq_work
    - show_ipi
    - context-tracking

    Fixes & Optimizations:
    - kprobe_on_ftrace
    - optimize panic print"

    * tag 'csky-for-linus-5.9-rc1' of https://github.com/c-sky/csky-linux:
    csky: Add context tracking support
    csky: Add arch_show_interrupts for IPI interrupts
    csky: Add irq_work support
    csky: Fixup warning by EXPORT_SYMBOL(kmap)
    csky: Set CONFIG_NR_CPU 4 as default
    csky: Use top-down mmap layout
    csky: Optimize the trap processing flow
    csky: Add support for function error injection
    csky: Fixup kprobes handler couldn't change pc
    csky: Fixup duplicated restore sp in RESTORE_REGS_FTRACE
    csky: Add cpu feature register hint for smp
    csky: Add SECCOMP_FILTER supported
    csky: remove unusued thread_saved_pc and *_segments functions/macros

    Linus Torvalds
     

01 Aug, 2020

1 commit

  • This patch support context tracking with no hz full.

    Here is the test result with dynticks-testing (see tick_stop):

    cat /sys/kernel/debug/tracing/per_cpu/cpu0/trace
    tracer: nop

    entries-in-buffer/entries-written: 356/356 #P:1

    _-----=> irqs-off
    / _----=> need-resched
    | / _---=> hardirq/softirq
    || / _--=> preempt-depth
    ||| / delay
    TASK-PID CPU# |||| TIMESTAMP FUNCTION
    | | | |||| | |
    ...
    sleep-192 [000] d.h. 167.088270: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=166436355700
    sleep-192 [000] d.h. 167.092279: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=166440365700
    -0 [000] d.h2 167.096492: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=166444578400
    -0 [000] d..1 167.097876: tick_stop: success=1 dependency=NONE
    ^^^^^^^^^
    -0 [000] d.h1 168.818206: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=168166280900
    kworker/u2:0-7 [000] .... 168.821760: workqueue_execute_start: work struct (ptrval): function wb_workfn
    kworker/u2:0-7 [000] d.h1 168.824464: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=168172547100
    kworker/0:1-18 [000] .... 168.825053: workqueue_execute_start: work struct (ptrval): function vmstat_update
    kworker/0:1-18 [000] .... 168.825238: workqueue_execute_start: work struct (ptrval): function vmstat_shepherd
    kworker/0:1-18 [000] .... 168.825516: workqueue_execute_start: work struct (ptrval): function neigh_periodic_work
    -0 [000] d..1 168.826121: tick_stop: success=1 dependency=NONE
    kworker/u2:0-7 [000] .... 169.377327: workqueue_execute_start: work struct (ptrval): function flush_to_ldisc
    -0 [000] d..1 169.379832: tick_stop: success=1 dependency=NONE
    kworker/u2:0-7 [000] .... 169.607935: workqueue_execute_start: work struct (ptrval): function flush_to_ldisc
    kworker/u2:0-7 [000] d.h1 169.608148: hrtimer_expire_entry: hrtimer=(ptrval) function=tick_sched_timer now=168956235500
    -0 [000] d..1 169.608654: tick_stop: success=1 dependency=NONE

    Signed-off-by: Guo Ren
    Cc: Greentime Hu
    Cc: Arnd Bergmann

    Guo Ren
     

31 Jul, 2020

4 commits

  • The C860 processors support 4 cores smp for maximum, so set NR_CPU
    to 4 as default

    Signed-off-by: Guo Ren
    Cc: Arnd Bergmann

    Guo Ren
     
  • Follow riscv mmap layout with commit "riscv: make mmap allocation
    top-down by default (54c95a11cc1b)".

    Before:
    cat /proc/self/maps
    00008000-000dc000 r-xp 00000000 fe:00 17 /bin/busybox
    000dc000-000dd000 r--p 000d3000 fe:00 17 /bin/busybox
    000dd000-000de000 rw-p 000d4000 fe:00 17 /bin/busybox
    2aaa8000-2aac6000 r-xp 00000000 fe:00 196 /lib/ld-2.28.9000.so
    2aac6000-2aac7000 r-xp 00000000 00:00 0 [vdso]
    2aac7000-2aac8000 r--p 0001e000 fe:00 196 /lib/ld-2.28.9000.so
    2aac8000-2aac9000 rw-p 0001f000 fe:00 196 /lib/ld-2.28.9000.so
    2aac9000-2aad9000 r-xp 00000000 fe:00 219 /lib/libresolv-2.28.9000.so
    2aad9000-2aada000 r--p 0000f000 fe:00 219 /lib/libresolv-2.28.9000.so
    2aada000-2aadb000 rw-p 00010000 fe:00 219 /lib/libresolv-2.28.9000.so
    2aadb000-2aadd000 rw-p 00000000 00:00 0
    2aadd000-2ac27000 r-xp 00000000 fe:00 203 /lib/libc-2.28.9000.so
    2ac27000-2ac28000 ---p 0014a000 fe:00 203 /lib/libc-2.28.9000.so
    2ac28000-2ac2a000 r--p 0014a000 fe:00 203 /lib/libc-2.28.9000.so
    2ac2a000-2ac2b000 rw-p 0014c000 fe:00 203 /lib/libc-2.28.9000.so
    2ac2b000-2ac2e000 rw-p 00000000 00:00 0
    7fb99000-7fbba000 rwxp 00000000 00:00 0 [stack]

    After:
    cat /proc/self/maps
    00008000-000dc000 r-xp 00000000 fe:00 17 /bin/busybox
    000dc000-000dd000 r--p 000d3000 fe:00 17 /bin/busybox
    000dd000-000de000 rw-p 000d4000 fe:00 17 /bin/busybox
    77e13000-77f5d000 r-xp 00000000 fe:00 203 /lib/libc-2.28.9000.so
    77f5d000-77f5e000 ---p 0014a000 fe:00 203 /lib/libc-2.28.9000.so
    77f5e000-77f60000 r--p 0014a000 fe:00 203 /lib/libc-2.28.9000.so
    77f60000-77f61000 rw-p 0014c000 fe:00 203 /lib/libc-2.28.9000.so
    77f61000-77f66000 rw-p 00000000 00:00 0
    77f66000-77f76000 r-xp 00000000 fe:00 219 /lib/libresolv-2.28.9000.so
    77f76000-77f77000 r--p 0000f000 fe:00 219 /lib/libresolv-2.28.9000.so
    77f77000-77f78000 rw-p 00010000 fe:00 219 /lib/libresolv-2.28.9000.so
    77f78000-77f96000 r-xp 00000000 fe:00 196 /lib/ld-2.28.9000.so
    77f96000-77f97000 r-xp 00000000 00:00 0 [vdso]
    77f97000-77f98000 r--p 0001e000 fe:00 196 /lib/ld-2.28.9000.so
    77f98000-77f99000 rw-p 0001f000 fe:00 196 /lib/ld-2.28.9000.so
    7fd7b000-7fd9c000 rwxp 00000000 00:00 0 [stack]

    Signed-off-by: Guo Ren
    Cc: Arnd Bergmann

    Guo Ren
     
  • Inspired by the commit 42d038c4fb00 ("arm64: Add support for function
    error injection"), this patch supports function error injection for
    csky.

    This patch mainly support two functions: one is regs_set_return_value()
    which is used to overwrite the return value; the another function is
    override_function_with_return() which is to override the probed
    function returning and jump to its caller.

    Test log:

    cd /sys/kernel/debug/fail_function/
    echo sys_clone > inject
    echo 100 > probability
    echo 1 > interval
    ls /
    [ 108.644163] FAULT_INJECTION: forcing a failure.
    [ 108.644163] name fail_function, interval 1, probability 100, space 0, times 1
    [ 108.647799] CPU: 0 PID: 104 Comm: sh Not tainted 5.8.0-rc5+ #46
    [ 108.648384] Call Trace:
    [ 108.649339] [] walk_stackframe+0x0/0xf0
    [ 108.649679] [] show_stack+0x32/0x5c
    [ 108.649927] [] dump_stack+0x6e/0x9c
    [ 108.650271] [] should_fail+0x15e/0x1ac
    [ 108.650720] [] fei_kprobe_handler+0x28/0x5c
    [ 108.651519] [] kprobe_breakpoint_handler+0x144/0x1cc
    [ 108.652289] [] trap_c+0x8e/0x110
    [ 108.652816] [] csky_trap+0x5c/0x70
    -sh: can't fork: Invalid argument

    Signed-off-by: Guo Ren
    Cc: Arnd Bergmann

    Guo Ren
     
  • secure_computing() is called first in syscall_trace_enter() so that
    a system call will be aborted quickly without doing succeeding syscall
    tracing if seccomp rules want to deny that system call.

    TODO:
    - Update https://github.com/seccomp/libseccomp csky support

    Signed-off-by: Guo Ren
    Cc: Arnd Bergmann

    Guo Ren
     

05 Jul, 2020

1 commit

  • All architectures support copy_thread_tls() now, so remove the legacy
    copy_thread() function and the HAVE_COPY_THREAD_TLS config option. Everyone
    uses the same process creation calling convention based on
    copy_thread_tls() and struct kernel_clone_args. This will make it easier to
    maintain the core process creation code under kernel/, simplifies the
    callpaths and makes the identical for all architectures.

    Cc: linux-arch@vger.kernel.org
    Acked-by: Thomas Bogendoerfer
    Acked-by: Greentime Hu
    Acked-by: Geert Uytterhoeven
    Reviewed-by: Kees Cook
    Signed-off-by: Christian Brauner

    Christian Brauner
     

13 May, 2020

1 commit

  • The implementation of show_stack will panic with wrong fp:

    addr = *fp++;

    because the fp isn't checked properly.

    The current implementations of show_stack, wchan and stack_trace
    haven't been designed properly, so just deprecate them.

    This patch is a reference to riscv's way, all codes are modified from
    arm's. The patch is passed with:

    - cat /proc//stack
    - cat /proc//wchan
    - echo c > /proc/sysrq-trigger

    Signed-off-by: Guo Ren

    Guo Ren
     

03 Apr, 2020

2 commits

  • This patch adds support for uprobes on csky architecture.

    Just like kprobe, it support single-step and simulate instructions.

    Signed-off-by: Guo Ren
    Cc: Arnd Bergmann
    Cc: Steven Rostedt (VMware)

    Guo Ren
     
  • This patch enable kprobes, kretprobes, ftrace interface. It utilized
    software breakpoint and single step debug exceptions, instructions
    simulation on csky.

    We use USR_BKPT replace origin instruction, and the kprobe handler
    prepares an excutable memory slot for out-of-line execution with a
    copy of the original instruction being probed. Most of instructions
    could be executed by single-step, but some instructions need origin
    pc value to execute and we need software simulate these instructions.

    Signed-off-by: Guo Ren
    Cc: Arnd Bergmann
    Cc: Steven Rostedt (VMware)

    Guo Ren
     

02 Apr, 2020

1 commit


01 Apr, 2020

1 commit


08 Mar, 2020

3 commits

  • This patch implements FTRACE_WITH_REGS for csky, which allows a traced
    function's arguments (and some other registers) to be captured into a
    struct pt_regs, allowing these to be inspected and/or modified.

    Signed-off-by: Guo Ren

    Guo Ren
     
  • Copied and adapted from vincent's patch, but modified for csky.

    ref:
    https://lore.kernel.org/linux-riscv/1572919114-3886-3-git-send-email-vincent.chen@sifive.com/raw

    Add calls to rseq_signal_deliver(), rseq_handle_notify_resume() and
    rseq_syscall() to introduce RSEQ support.

    1. Call the rseq_handle_notify_resume() function on return to userspace
    if TIF_NOTIFY_RESUME thread flag is set.

    2. Call the rseq_signal_deliver() function to fixup on the pre-signal
    frame when a signal is delivered on top of a restartable sequence
    critical section.

    3. Check that system calls are not invoked from within rseq critical
    sections by invoking rseq_signal() from ret_from_syscall(). With
    CONFIG_DEBUG_RSEQ, such behavior results in termination of the
    process with SIGSEGV.

    Signed-off-by: Guo Ren

    Guo Ren
     
  • Needed for kprobes support. Copied and adapted from Patrick's patch,
    but it has been modified for csky's pt_regs.

    ref:
    https://lore.kernel.org/linux-riscv/1572919114-3886-2-git-send-email-vincent.chen@sifive.com/raw

    Signed-off-by: Guo Ren
    Cc: Patrick Staehlin

    Guo Ren
     

21 Feb, 2020

9 commits

  • This is required for clone3 which passes the TLS value through a
    struct rather than a register.

    Cc: Amanieu d'Antras
    Signed-off-by: Guo Ren

    Guo Ren
     
  • Add the pci related code for csky arch to support basic pci virtual
    function, such as qemu virt-pci-9pfs.

    Signed-off-by: MaJun
    Signed-off-by: Guo Ren

    MaJun
     
  • CONFIG_CLKSRC_OF is gone since commit bb0eb050a577
    ("clocksource/drivers: Rename CLKSRC_OF to TIMER_OF"). The platform
    already selects TIMER_OF.

    CONFIG_HAVE_DMA_API_DEBUG is gone since commit 6e88628d03dd ("dma-debug:
    remove CONFIG_HAVE_DMA_API_DEBUG").

    CONFIG_DEFAULT_DEADLINE is gone since commit f382fb0bcef4 ("block:
    remove legacy IO schedulers").

    Signed-off-by: Krzysztof Kozlowski
    Signed-off-by: Guo Ren

    Krzysztof Kozlowski
     
  • Fix wording in help text for the CPU_HAS_LDSTEX symbol.

    Signed-off-by: Randy Dunlap
    Signed-off-by: Guo Ren
    Signed-off-by: Guo Ren

    Randy Dunlap
     
  • Some CPUs don't support icache specific instructions to flush icache
    lines in broadcast way. We use cpu control registers to flush local
    icache and use IPI to notify other cores.

    Signed-off-by: Guo Ren

    Guo Ren
     
  • Such as snps,dw-apb-ictl

    Signed-off-by: Guo Ren

    Guo Ren
     
  • After fixaddr_init is separated from highmem, we could use tcm
    without highmem selected. (610 (abiv1) don't support highmem,
    but it could use tcm now.)

    Signed-off-by: Guo Ren

    Guo Ren
     
  • The implementation are not only used by TCM but also used by sram on
    SOC bus. It follow existed linux tcm software interface, so that old
    tcm application codes could be re-used directly.

    Software interface list in asm/tcm.h:
    - Variables/Const: __tcmdata, __tcmconst
    - Functions: __tcmfunc, __tcmlocalfunc
    - Malloc/Free: tcm_alloc, tcm_free

    In linux menuconfig:
    - Choose a TCM contain instrctions + data or separated in ITCM/DTCM.
    - Determine TCM_BASE (DTCM_BASE) in phyiscal address.
    - Determine size of TCM or ITCM(DTCM) in page counts.

    Here is hello tcm example from Documentation/arm/tcm.rst which could
    be directly used:

    /* Uninitialized data */
    static u32 __tcmdata tcmvar;
    /* Initialized data */
    static u32 __tcmdata tcmassigned = 0x2BADBABEU;
    /* Constant */
    static const u32 __tcmconst tcmconst = 0xCAFEBABEU;

    static void __tcmlocalfunc tcm_to_tcm(void)
    {
    int i;
    for (i = 0; i < 100; i++)
    tcmvar ++;
    }

    static void __tcmfunc hello_tcm(void)
    {
    /* Some abstract code that runs in ITCM */
    int i;
    for (i = 0; i < 100; i++) {
    tcmvar ++;
    }
    tcm_to_tcm();
    }

    static void __init test_tcm(void)
    {
    u32 *tcmem;
    int i;

    hello_tcm();
    printk("Hello TCM executed from ITCM RAM\n");

    printk("TCM variable from testrun: %u @ %p\n", tcmvar, &tcmvar);
    tcmvar = 0xDEADBEEFU;
    printk("TCM variable: 0x%x @ %p\n", tcmvar, &tcmvar);

    printk("TCM assigned variable: 0x%x @ %p\n", tcmassigned, &tcmassigned);

    printk("TCM constant: 0x%x @ %p\n", tcmconst, &tcmconst);

    /* Allocate some TCM memory from the pool */
    tcmem = tcm_alloc(20);
    if (tcmem) {
    printk("TCM Allocated 20 bytes of TCM @ %p\n", tcmem);
    tcmem[0] = 0xDEADBEEFU;
    tcmem[1] = 0x2BADBABEU;
    tcmem[2] = 0xCAFEBABEU;
    tcmem[3] = 0xDEADBEEFU;
    tcmem[4] = 0x2BADBABEU;
    for (i = 0; i < 5; i++)
    printk("TCM tcmem[%d] = %08x\n", i, tcmem[i]);
    tcm_free(tcmem, 20);
    }
    }

    TODO:
    - Separate fixup mapping from highmem
    - Support abiv1

    Signed-off-by: Guo Ren

    Guo Ren
     
  • This is a basic -fstack-protector support without per-task canary
    switching. The protector will report something like when stack
    corruption is detected:

    It's tested with strcpy local array overflow in sys_kill and get:
    stack-protector: Kernel stack is corrupted in: sys_kill+0x23c/0x23c

    TODO:
    - Support task switch for different cannary

    Signed-off-by: Mao Han
    Signed-off-by: Guo Ren

    Mao Han
     

12 Nov, 2019

1 commit


19 Jul, 2019

1 commit


21 May, 2019

1 commit


09 May, 2019

2 commits

  • Pull DMA mapping updates from Christoph Hellwig:

    - remove the already broken support for NULL dev arguments to the DMA
    API calls

    - Kconfig tidyups

    * tag 'dma-mapping-5.2' of git://git.infradead.org/users/hch/dma-mapping:
    dma-mapping: add a Kconfig symbol to indicate arch_dma_prep_coherent presence
    dma-mapping: remove an unnecessary NULL check
    x86/dma: Remove the x86_dma_fallback_dev hack
    dma-mapping: remove leftover NULL device support
    arm: use a dummy struct device for ISA DMA use of the DMA API
    pxa3xx-gcu: pass struct device to dma_mmap_coherent
    gbefb: switch to managed version of the DMA allocator
    da8xx-fb: pass struct device to DMA API functions
    parport_ip32: pass struct device to DMA API functions
    dma: select GENERIC_ALLOCATOR for DMA_REMAP

    Linus Torvalds
     
  • Pull arch/csky updates from Guo Ren:

    - Fixup vdsp&fpu issues in kernel

    - Add dynamic function tracer

    - Use in_syscall & forget_syscall instead of r11_sig

    - Reconstruct signal processing

    - Support dynamic start physical address

    - Fixup wrong update_mmu_cache implementation

    - Support vmlinux bootup with MMU off

    - Use va_pa_offset instead of phys_offset

    - Fixup syscall_trace return processing flow

    - Add perf callchain support

    - Add perf_arch_fetch_caller_regs support

    - Add page fault perf event support

    - Add support for perf registers sampling

    * tag 'csky-for-linus-5.2-rc1' of git://github.com/c-sky/csky-linux:
    csky/syscall_trace: Fixup return processing flow
    csky: Fixup compile warning
    csky: Add support for perf registers sampling
    csky: add page fault perf event support
    csky: Use va_pa_offset instead of phys_offset
    csky: Support vmlinux bootup with MMU off
    csky: Add perf_arch_fetch_caller_regs support
    csky: Fixup wrong update_mmu_cache implementation
    csky: Support dynamic start physical address
    csky: Reconstruct signal processing
    csky: Use in_syscall & forget_syscall instead of r11_sig
    csky: Add non-uapi asm/ptrace.h namespace
    csky: mm/fault.c: Remove duplicate header
    csky: remove redundant generic-y
    csky: Update syscall_trace_enter/exit implementation
    csky: Add perf callchain support
    csky/ftrace: Add dynamic function tracer (include graph tracer)
    csky: Fixup vdsp&fpu issues in kernel

    Linus Torvalds
     

06 May, 2019

1 commit


22 Apr, 2019

3 commits

  • This patch implements the perf registers sampling and validation API
    for csky arch. The valid registers and their register ID are defined in
    perf_regs.h. Perf tool can backtrace in userspace with unwind library
    and the registers/user stack dump support.

    Signed-off-by: Mao Han
    Signed-off-by: Guo Ren

    Mao Han
     
  • Previous syscall_trace implementation couldn't support AUDITSYSCALL and
    SYSCALL_TRACEPOINTS. Now we redesign it to support audit_syscall
    and syscall_tracepoints just like other archs'.

    Signed-off-by: Guo Ren
    Cc: Dmitry V. Levin
    Cc: Arnd Bergmann

    Guo Ren
     
  • Support dynamic ftrace including dynamic graph tracer. Gcc-csky with -pg
    will produce call site in every function prologue and we can use these
    call site to hook trace function.

    gcc with -pg origin call site:
    push lr
    jbsr _mcount
    nop32
    nop32

    If the (callee - caller)'s offset is in range of bsr instruction, we'll
    modify code with:
    push lr
    bsr _mcount
    nop32
    nop32
    Else if the (callee - caller)'s offset is out of bsr instrunction, we'll
    modify code with:
    push lr
    movih r26, ...
    ori r26, ...
    jsr r26

    (r26 is reserved for jsr link reg in csky abiv2 spec.)

    Signed-off-by: Guo Ren

    Guo Ren
     

03 Apr, 2019

1 commit

  • Currently, we have two different implementation of rwsem:

    1) CONFIG_RWSEM_GENERIC_SPINLOCK (rwsem-spinlock.c)
    2) CONFIG_RWSEM_XCHGADD_ALGORITHM (rwsem-xadd.c)

    As we are going to use a single generic implementation for rwsem-xadd.c
    and no architecture-specific code will be needed, there is no point
    in keeping two different implementations of rwsem. In most cases, the
    performance of rwsem-spinlock.c will be worse. It also doesn't get all
    the performance tuning and optimizations that had been implemented in
    rwsem-xadd.c over the years.

    For simplication, we are going to remove rwsem-spinlock.c and make all
    architectures use a single implementation of rwsem - rwsem-xadd.c.

    All references to RWSEM_GENERIC_SPINLOCK and RWSEM_XCHGADD_ALGORITHM
    in the code are removed.

    Suggested-by: Peter Zijlstra
    Signed-off-by: Waiman Long
    Signed-off-by: Peter Zijlstra (Intel)
    Acked-by: Linus Torvalds
    Cc: Andrew Morton
    Cc: Arnd Bergmann
    Cc: Borislav Petkov
    Cc: Davidlohr Bueso
    Cc: H. Peter Anvin
    Cc: Paul E. McKenney
    Cc: Thomas Gleixner
    Cc: Tim Chen
    Cc: Will Deacon
    Cc: linux-arm-kernel@lists.infradead.org
    Cc: linux-c6x-dev@linux-c6x.org
    Cc: linux-m68k@lists.linux-m68k.org
    Cc: linux-riscv@lists.infradead.org
    Cc: linux-um@lists.infradead.org
    Cc: linux-xtensa@linux-xtensa.org
    Cc: linuxppc-dev@lists.ozlabs.org
    Cc: nios2-dev@lists.rocketboards.org
    Cc: openrisc@lists.librecores.org
    Cc: uclinux-h8-devel@lists.sourceforge.jp
    Link: https://lkml.kernel.org/r/20190322143008.21313-3-longman@redhat.com
    Signed-off-by: Ingo Molnar

    Waiman Long
     

11 Mar, 2019

1 commit

  • Pull DMA mapping updates from Christoph Hellwig:

    - add debugfs support for dumping dma-debug information (Corentin
    Labbe)

    - Kconfig cleanups (Andy Shevchenko and me)

    - debugfs cleanups (Greg Kroah-Hartman)

    - improve dma_map_resource and use it in the media code

    - arch_setup_dma_ops / arch_teardown_dma_ops cleanups

    - various small cleanups and improvements for the per-device coherent
    allocator

    - make the DMA mask an upper bound and don't fail "too large" dma mask
    in the remaning two architectures - this will allow big driver
    cleanups in the following merge windows

    * tag 'dma-mapping-5.1' of git://git.infradead.org/users/hch/dma-mapping: (21 commits)
    Documentation/DMA-API-HOWTO: update dma_mask sections
    sparc64/pci_sun4v: allow large DMA masks
    sparc64/iommu: allow large DMA masks
    sparc64: refactor the ali DMA quirk
    ccio: allow large DMA masks
    dma-mapping: remove the DMA_MEMORY_EXCLUSIVE flag
    dma-mapping: remove dma_mark_declared_memory_occupied
    dma-mapping: move CONFIG_DMA_CMA to kernel/dma/Kconfig
    dma-mapping: improve selection of dma_declare_coherent availability
    dma-mapping: remove an incorrect __iommem annotation
    of: select OF_RESERVED_MEM automatically
    device.h: dma_mem is only needed for HAVE_GENERIC_DMA_COHERENT
    mfd/sm501: depend on HAS_DMA
    dma-mapping: add a kconfig symbol for arch_teardown_dma_ops availability
    dma-mapping: add a kconfig symbol for arch_setup_dma_ops availability
    dma-mapping: move debug configuration options to kernel/dma
    dma-debug: add dumping facility via debugfs
    dma: debug: no need to check return value of debugfs_create functions
    videobuf2: replace a layering violation with dma_map_resource
    dma-mapping: don't BUG when calling dma_map_resource on RAM
    ...

    Linus Torvalds