Skip to content
  1. Dec 17, 2020
    • Guo Ren's avatar
      riscv: Add support for function error injection · 1f2cb1bb
      Guo Ren authored
      
      
      Inspired by the commit 42d038c4 ("arm64: Add support for function
      error injection"), this patch supports function error injection for
      riscv.
      
      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 /
      [  313.176875] FAULT_INJECTION: forcing a failure.
      [  313.176875] name fail_function, interval 1, probability 100, space 0, times 1
      [  313.184357] CPU: 0 PID: 87 Comm: sh Not tainted 5.8.0-rc5-00007-g6a758cc #117
      [  313.187616] Call Trace:
      [  313.189100] [<ffffffe0002036b6>] walk_stackframe+0x0/0xc2
      [  313.191626] [<ffffffe00020395c>] show_stack+0x40/0x4c
      [  313.193927] [<ffffffe000556c60>] dump_stack+0x7c/0x96
      [  313.194795] [<ffffffe0005522e8>] should_fail+0x140/0x142
      [  313.195923] [<ffffffe000299ffc>] fei_kprobe_handler+0x2c/0x5a
      [  313.197687] [<ffffffe0009e2ec4>] kprobe_breakpoint_handler+0xb4/0x18a
      [  313.200054] [<ffffffe00020357e>] do_trap_break+0x36/0xca
      [  313.202147] [<ffffffe000201bca>] ret_from_exception+0x0/0xc
      [  313.204556] [<ffffffe000201bbc>] ret_from_syscall+0x0/0x2
      -sh: can't fork: Invalid argument
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Reviewed-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Palmer Dabbelt <palmerdabbelt@google.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      1f2cb1bb
    • Guo Ren's avatar
      riscv: Add uprobes supported · 2068d4c1
      Guo Ren authored
      
      
      This patch adds support for uprobes on riscv architecture.
      
      Just like kprobe, it support single-step and simulate instructions.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Reviewed-by: default avatarPekka Enberg <penberg@kernel.org>
      Cc: Oleg Nesterov <oleg@redhat.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Palmer Dabbelt <palmerdabbelt@google.com>
      2068d4c1
    • Guo Ren's avatar
      riscv: Add KPROBES_ON_FTRACE supported · 324534d9
      Guo Ren authored
      
      
      This patch adds support for kprobes on ftrace call sites to avoids
      much of the overhead with regular kprobes. Try it with simple
      steps:
      
       echo 'p:myprobe sys_clone a0=%a0 a1=%a1 stack_val=+4($stack)' > /sys/kernel/de
      bug/tracing/kprobe_events
       echo 1 > /sys/kernel/debug/tracing/events/kprobes/enable
       cat /sys/kernel/debug/tracing/trace
       tracer: nop
      
       entries-in-buffer/entries-written: 1/1   #P:1
      
                                      _-----=> irqs-off
                                     / _----=> need-resched
                                    | / _---=> hardirq/softirq
                                    || / _--=> preempt-depth
                                    ||| /     delay
                 TASK-PID     CPU#  ||||   TIMESTAMP  FUNCTION
                    | |         |   ||||      |         |
                    sh-92      [000] ....   369.899962: myprobe: (sys_clone+0x0/0x28) a0=0x1200011 a1=0x0 stack_val=0x201c20ffffffe0
       cat /sys/kernel/debug/kprobes/list
      ffffffe00020b584  k  sys_clone+0x0    [FTRACE]
                                             ^^^^^^
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Reviewed-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Cc: Palmer Dabbelt <palmerdabbelt@google.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Björn Töpel <bjorn.topel@gmail.com>
      Cc: Zong Li <zong.li@sifive.com>
      Cc: Pekka Enberg <penberg@kernel.org>
      324534d9
    • Guo Ren's avatar
      riscv: Add kprobes supported · ecc5df00
      Guo Ren authored
      This patch enables "kprobe & kretprobe" to work with ftrace
      interface. It utilized software breakpoint as single-step
      mechanism.
      
      Some instructions which can't be single-step executed must be
      simulated in kernel execution slot, such as: branch, jal, auipc,
      la ...
      
      Some instructions should be rejected for probing and we use a
      blacklist to filter, such as: ecall, ebreak, ...
      
      We use ebreak & c.ebreak to replace origin instruction and the
      kprobe handler prepares an executable memory slot for out-of-line
      execution with a copy of the original instruction being probed.
      In execution slot we add ebreak behind original instruction to
      simulate a single-setp mechanism.
      
      The patch is based on packi's work [1] and csky's work [2].
       - The kprobes_trampoline.S is all from packi's patch
       - The single-step mechanism is new designed for riscv without hw
         single-step trap
       - The simulation codes are from csky
       - Frankly, all codes refer to other archs' implementation
      
       [1] https://lore.kernel.org/linux-riscv/20181113195804.22825-1-me@packi.ch/
       [2] https://lore.kernel.org/linux-csky/20200403044150.20562-9-guoren@kernel.org/
      
      
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Co-developed-by: default avatarPatrick Stählin <me@packi.ch>
      Signed-off-by: default avatarPatrick Stählin <me@packi.ch>
      Acked-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Tested-by: default avatarZong Li <zong.li@sifive.com>
      Reviewed-by: default avatarPekka Enberg <penberg@kernel.org>
      Cc: Patrick Stählin <me@packi.ch>
      Cc: Palmer Dabbelt <palmerdabbelt@google.com>
      Cc: Björn Töpel <bjorn.topel@gmail.com>
      ecc5df00
    • Guo Ren's avatar
      riscv: Using PATCHABLE_FUNCTION_ENTRY instead of MCOUNT · 6db3a68f
      Guo Ren authored
      This patch changes the current detour mechanism of dynamic ftrace
      which has been discussed during LPC 2020 RISCV-MC [1].
      
      Before the patch, we used mcount for detour:
      <funca>:
      	addi sp,sp,-16
      	sd   ra,8(sp)
      	sd   s0,0(sp)
      	addi s0,sp,16
      	mv   a5,ra
      	mv   a0,a5
      	auipc ra,0x0 -> nop
      	jalr  -296(ra) <_mcount@plt> ->nop
      	...
      
      After the patch, we use nop call site area for detour:
      <funca>:
      	nop -> REG_S ra, -SZREG(sp)
      	nop -> auipc ra, 0x?
      	nop -> jalr ?(ra)
      	nop -> REG_L ra, -SZREG(sp)
      	...
      
      The mcount mechanism is mixed with gcc function prologue which is
      not very clear. The patchable function entry just put 16 bytes nop
      before the front of the function prologue which could be filled
      with a separated detour mechanism.
      
      [1] https://www.linuxplumbersconf.org/event/7/contributions/807/
      
      
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Alan Kao <alankao@andestech.com>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      6db3a68f
    • Guo Ren's avatar
      riscv: Fixup patch_text panic in ftrace · 0fe913ca
      Guo Ren authored
      Just like arm64, we can't trace the function in the patch_text path.
      
      Here is the bug log:
      
      [   45.234334] Unable to handle kernel paging request at virtual address ffffffd38ae80900
      [   45.242313] Oops [#1]
      [   45.244600] Modules linked in:
      [   45.247678] CPU: 0 PID: 11 Comm: migration/0 Not tainted 5.9.0-00025-g9b7db83-dirty #215
      [   45.255797] epc: ffffffe00021689a ra : ffffffe00021718e sp : ffffffe01afabb58
      [   45.262955]  gp : ffffffe00136afa0 tp : ffffffe01af94d00 t0 : 0000000000000002
      [   45.270200]  t1 : 0000000000000000 t2 : 0000000000000001 s0 : ffffffe01afabc08
      [   45.277443]  s1 : ffffffe0013718a8 a0 : 0000000000000000 a1 : ffffffe01afabba8
      [   45.284686]  a2 : 0000000000000000 a3 : 0000000000000000 a4 : c4c16ad38ae80900
      [   45.291929]  a5 : 0000000000000000 a6 : 0000000000000000 a7 : 0000000052464e43
      [   45.299173]  s2 : 0000000000000001 s3 : ffffffe000206a60 s4 : ffffffe000206a60
      [   45.306415]  s5 : 00000000000009ec s6 : ffffffe0013718a8 s7 : c4c16ad38ae80900
      [   45.313658]  s8 : 0000000000000004 s9 : 0000000000000001 s10: 0000000000000001
      [   45.320902]  s11: 0000000000000003 t3 : 0000000000000001 t4 : ffffffffd192fe79
      [   45.328144]  t5 : ffffffffb8f80000 t6 : 0000000000040000
      [   45.333472] status: 0000000200000100 badaddr: ffffffd38ae80900 cause: 000000000000000f
      [   45.341514] ---[ end trace d95102172248fdcf ]---
      [   45.346176] note: migration/0[11] exited with preempt_count 1
      
      (gdb) x /2i $pc
      => 0xffffffe00021689a <__do_proc_dointvec+196>: sd      zero,0(s7)
         0xffffffe00021689e <__do_proc_dointvec+200>: li      s11,0
      
      (gdb) bt
      0  __do_proc_dointvec (tbl_data=0x0, table=0xffffffe01afabba8,
      write=0, buffer=0x0, lenp=0x7bf897061f9a0800, ppos=0x4, conv=0x0,
      data=0x52464e43) at kernel/sysctl.c:581
      1  0xffffffe00021718e in do_proc_dointvec (data=<optimized out>,
      conv=<optimized out>, ppos=<optimized out>, lenp=<optimized out>,
      buffer=<optimized out>, write=<optimized out>, table=<optimized out>)
      at kernel/sysctl.c:964
      2  proc_dointvec_minmax (ppos=<optimized out>, lenp=<optimized out>,
      buffer=<optimized out>, write=<optimized out>, table=<optimized out>)
      at kernel/sysctl.c:964
      3  proc_do_static_key (table=<optimized out>, write=1, buffer=0x0,
      lenp=0x0, ppos=0x7bf897061f9a0800) at kernel/sysctl.c:1643
      4  0xffffffe000206792 in ftrace_make_call (rec=<optimized out>,
      addr=<optimized out>) at arch/riscv/kernel/ftrace.c:109
      5  0xffffffe0002c9c04 in __ftrace_replace_code
      (rec=0xffffffe01ae40c30, enable=3) at kernel/trace/ftrace.c:2503
      6  0xffffffe0002ca0b2 in ftrace_replace_code (mod_flags=<optimized
      out>) at kernel/trace/ftrace.c:2530
      7  0xffffffe0002ca26a in ftrace_modify_all_code (command=5) at
      kernel/trace/ftrace.c:2677
      8  0xffffffe0002ca30e in __ftrace_modify_code (data=<optimized out>)
      at kernel/trace/ftrace.c:2703
      9  0xffffffe0002c13b0 in multi_cpu_stop (data=0x0) at kernel/stop_machine.c:224
      10 0xffffffe0002c0fde in cpu_stopper_thread (cpu=<optimized out>) at
      kernel/stop_machine.c:491
      11 0xffffffe0002343de in smpboot_thread_fn (data=0x0) at kernel/smpboot.c:165
      12 0xffffffe00022f8b4 in kthread (_create=0xffffffe01af0c040) at
      kernel/kthread.c:292
      13 0xffffffe000201fac in handle_exception () at arch/riscv/kernel/entry.S:236
      
         0xffffffe00020678a <+114>:   auipc   ra,0xffffe
         0xffffffe00020678e <+118>:   jalr    -118(ra) # 0xffffffe000204714 <patch_text_nosync>
         0xffffffe000206792 <+122>:   snez    a0,a0
      
      (gdb) disassemble patch_text_nosync
      Dump of assembler code for function patch_text_nosync:
         0xffffffe000204714 <+0>:     addi    sp,sp,-32
         0xffffffe000204716 <+2>:     sd      s0,16(sp)
         0xffffffe000204718 <+4>:     sd      ra,24(sp)
         0xffffffe00020471a <+6>:     addi    s0,sp,32
         0xffffffe00020471c <+8>:     auipc   ra,0x0
         0xffffffe000204720 <+12>:    jalr    -384(ra) # 0xffffffe00020459c <patch_insn_write>
         0xffffffe000204724 <+16>:    beqz    a0,0xffffffe00020472e <patch_text_nosync+26>
         0xffffffe000204726 <+18>:    ld      ra,24(sp)
         0xffffffe000204728 <+20>:    ld      s0,16(sp)
         0xffffffe00020472a <+22>:    addi    sp,sp,32
         0xffffffe00020472c <+24>:    ret
         0xffffffe00020472e <+26>:    sd      a0,-24(s0)
         0xffffffe000204732 <+30>:    auipc   ra,0x4
         0xffffffe000204736 <+34>:    jalr    -1464(ra) # 0xffffffe00020817a <flush_icache_all>
         0xffffffe00020473a <+38>:    ld      a0,-24(s0)
         0xffffffe00020473e <+42>:    ld      ra,24(sp)
         0xffffffe000204740 <+44>:    ld      s0,16(sp)
         0xffffffe000204742 <+46>:    addi    sp,sp,32
         0xffffffe000204744 <+48>:    ret
      
      (gdb) disassemble flush_icache_all-4
      Dump of assembler code for function flush_icache_all:
         0xffffffe00020817a <+0>:     addi    sp,sp,-8
         0xffffffe00020817c <+2>:     sd      ra,0(sp)
         0xffffffe00020817e <+4>:     auipc   ra,0xfffff
         0xffffffe000208182 <+8>:     jalr    -1822(ra) # 0xffffffe000206a60 <ftrace_caller>
         0xffffffe000208186 <+12>:    ld      ra,0(sp)
         0xffffffe000208188 <+14>:    addi    sp,sp,8
         0xffffffe00020818a <+0>:     addi    sp,sp,-16
         0xffffffe00020818c <+2>:     sd      s0,0(sp)
         0xffffffe00020818e <+4>:     sd      ra,8(sp)
         0xffffffe000208190 <+6>:     addi    s0,sp,16
         0xffffffe000208192 <+8>:     li      a0,0
         0xffffffe000208194 <+10>:    auipc   ra,0xfffff
         0xffffffe000208198 <+14>:    jalr    -410(ra) # 0xffffffe000206ffa <sbi_remote_fence_i>
         0xffffffe00020819c <+18>:    ld      s0,0(sp)
         0xffffffe00020819e <+20>:    ld      ra,8(sp)
         0xffffffe0002081a0 <+22>:    addi    sp,sp,16
         0xffffffe0002081a2 <+24>:    ret
      
      (gdb) frame 5
      (rec=0xffffffe01ae40c30, enable=3) at kernel/trace/ftrace.c:2503
      2503                    return ftrace_make_call(rec, ftrace_addr);
      (gdb) p /x rec->ip
      $2 = 0xffffffe00020817a -> flush_icache_all !
      
      When we modified flush_icache_all's patchable-entry with ftrace_caller:
       - Insert ftrace_caller at flush_icache_all prologue.
       - Call flush_icache_all to sync I/Dcache, but flush_icache_all is
      just we modified by half.
      
      Link: https://lore.kernel.org/linux-riscv/CAJF2gTT=oDWesWe0JVWvTpGi60-gpbNhYLdFWN_5EbyeqoEDdw@mail.gmail.com/T/#t
      
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Atish Patra <atish.patra@wdc.com>
      Cc: Steven Rostedt (VMware) <rostedt@goodmis.org>
      0fe913ca
  2. Dec 14, 2020
    • Guo Ren's avatar
      riscv: Fixup wrong ftrace remove cflag · 38b2dc4e
      Guo Ren authored
      
      
      We must use $(CC_FLAGS_FTRACE) instead of directly using -pg. It
      will cause -fpatchable-function-entry error.
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      38b2dc4e
    • Guo Ren's avatar
      riscv: Fixup compile error BUILD_BUG_ON failed · 2455a2a1
      Guo Ren authored
      
      
      Unfortunately, the current code couldn't be compiled:
      
        CC      arch/riscv/kernel/patch.o
      In file included from ./include/linux/kernel.h:11,
                       from ./include/linux/list.h:9,
                       from ./include/linux/preempt.h:11,
                       from ./include/linux/spinlock.h:51,
                       from arch/riscv/kernel/patch.c:6:
      In function ‘fix_to_virt’,
          inlined from ‘patch_map’ at arch/riscv/kernel/patch.c:37:17:
      ./include/linux/compiler.h:392:38: error: call to ‘__compiletime_assert_205’ declared with attribute error: BUILD_BUG_ON failed: idx >= __end_of_fixed_addresses
        _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
                                            ^
      ./include/linux/compiler.h:373:4: note: in definition of macro ‘__compiletime_assert’
          prefix ## suffix();    \
          ^~~~~~
      ./include/linux/compiler.h:392:2: note: in expansion of macro ‘_compiletime_assert’
        _compiletime_assert(condition, msg, __compiletime_assert_, __COUNTER__)
        ^~~~~~~~~~~~~~~~~~~
      ./include/linux/build_bug.h:39:37: note: in expansion of macro ‘compiletime_assert’
       #define BUILD_BUG_ON_MSG(cond, msg) compiletime_assert(!(cond), msg)
                                           ^~~~~~~~~~~~~~~~~~
      ./include/linux/build_bug.h:50:2: note: in expansion of macro ‘BUILD_BUG_ON_MSG’
        BUILD_BUG_ON_MSG(condition, "BUILD_BUG_ON failed: " #condition)
        ^~~~~~~~~~~~~~~~
      ./include/asm-generic/fixmap.h:32:2: note: in expansion of macro ‘BUILD_BUG_ON’
        BUILD_BUG_ON(idx >= __end_of_fixed_addresses);
        ^~~~~~~~~~~~
      
      Because fix_to_virt(, idx) needs a const value, not a dynamic variable of
      reg-a0 or BUILD_BUG_ON failed with "idx >= __end_of_fixed_addresses".
      
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Reviewed-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Reviewed-by: default avatarPekka Enberg <penberg@kernel.org>
      Cc: Paul Walmsley <paul.walmsley@sifive.com>
      Cc: Palmer Dabbelt <palmer@dabbelt.com>
      2455a2a1
    • Patrick Stählin's avatar
      RISC-V: Implement ptrace regs and stack API · 3d4fd783
      Patrick Stählin authored
      
      
      Needed for kprobes support. Copied and adapted from arm64 code.
      
      Guo Ren fixup pt_regs type for linux-5.8-rc1.
      
      Signed-off-by: default avatarPatrick Stählin <me@packi.ch>
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Reviewed-by: default avatarPekka Enberg <penberg@kernel.org>
      Reviewed-by: default avatarZong Li <zong.li@sifive.com>
      Reviewed-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      3d4fd783
    • Linus Torvalds's avatar
      Linux 5.10 · 2c85ebc5
      Linus Torvalds authored
      2c85ebc5
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-12-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · ec6f5e0e
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "A set of x86 and membarrier fixes:
      
         - Correct a few problems in the x86 and the generic membarrier
           implementation. Small corrections for assumptions about visibility
           which have turned out not to be true.
      
         - Make the PAT bits for memory encryption correct vs 4K and 2M/1G
           page table entries as they are at a different location.
      
         - Fix a concurrency issue in the the local bandwidth readout of
           resource control leading to incorrect values
      
         - Fix the ordering of allocating a vector for an interrupt. The order
           missed to respect the provided cpumask when the first attempt of
           allocating node local in the mask fails. It then tries the node
           instead of trying the full provided mask first. This leads to
           erroneous error messages and breaking the (user) supplied affinity
           request. Reorder it.
      
         - Make the INT3 padding detection in optprobe work correctly"
      
      * tag 'x86-urgent-2020-12-13' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/kprobes: Fix optprobe to detect INT3 padding correctly
        x86/apic/vector: Fix ordering in vector assignment
        x86/resctrl: Fix incorrect local bandwidth when mba_sc is enabled
        x86/mm/mem_encrypt: Fix definition of PMD_FLAGS_DEC_WP
        membarrier: Execute SYNC_CORE on the calling thread
        membarrier: Explicitly sync remote cores when SYNC_CORE is requested
        membarrier: Add an actual barrier before rseq_preempt()
        x86/membarrier: Get rid of a dubious optimization
      ec6f5e0e
    • Linus Torvalds's avatar
      Merge tag 'block-5.10-2020-12-12' of git://git.kernel.dk/linux-block · d2360a39
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "This should be it for 5.10.
      
        Mike and Song looked into the warning case, and thankfully it appears
        the fix was pretty trivial - we can just change the md device chunk
        type to unsigned int to get rid of it. They cannot currently be < 0,
        and nobody is checking for that either.
      
        We're reverting the discard changes as the corruption reports came in
        very late, and there's just no time to attempt to deal with it at this
        point. Reverting the changes in question is the right call for 5.10"
      
      * tag 'block-5.10-2020-12-12' of git://git.kernel.dk/linux-block:
        md: change mddev 'chunk_sectors' from int to unsigned
        Revert "md: add md_submit_discard_bio() for submitting discard bio"
        Revert "md/raid10: extend r10bio devs to raid disks"
        Revert "md/raid10: pull codes that wait for blocked dev into one function"
        Revert "md/raid10: improve raid10 discard request"
        Revert "md/raid10: improve discard request for far layout"
        Revert "dm raid: remove unnecessary discard limits for raid10"
      d2360a39
  3. Dec 13, 2020
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 6bff9bb8
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Five small fixes.  Four in drivers:
      
         - hisi_sas: fix internal queue timeout
      
         - be2iscsi: revert a prior fix causing problems
      
         - bnx2i: add missing dependency
      
         - storvsc: late arriving revert of a problem fix
      
        and one in the core.
      
        The core one is a minor change to stop paying attention to the busy
        count when returning out of resources because there's a race window
        where the queue might not restart due to missing returning I/O"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        Revert "scsi: storvsc: Validate length of incoming packet in storvsc_on_channel_callback()"
        scsi: hisi_sas: Select a suitable queue for internal I/Os
        scsi: core: Fix race between handling STS_RESOURCE and completion
        scsi: be2iscsi: Revert "Fix a theoretical leak in beiscsi_create_eqs()"
        scsi: bnx2i: Requires MMU
      6bff9bb8
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 5ee595d9
      Linus Torvalds authored
      Pull i2c fix from Wolfram Sang:
       "Bugfix for the AT24 EEPROM driver"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        misc: eeprom: at24: fix NVMEM name with custom AT24 device name
      5ee595d9
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 7b1b868e
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "Bugfixes for ARM, x86 and tools"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        tools/kvm_stat: Exempt time-based counters
        KVM: mmu: Fix SPTE encoding of MMIO generation upper half
        kvm: x86/mmu: Use cpuid to determine max gfn
        kvm: svm: de-allocate svm_cpu_data for all cpus in svm_cpu_uninit()
        selftests: kvm/set_memory_region_test: Fix race in move region test
        KVM: arm64: Add usage of stage 2 fault lookup level in user_mem_abort()
        KVM: arm64: Fix handling of merging tables into a block entry
        KVM: arm64: Fix memory leak on stage2 update of a valid PTE
      7b1b868e
    • Linus Torvalds's avatar
      Merge tag 'for-linus-5.10c-rc8-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip · b53966ff
      Linus Torvalds authored
      Pull xen fixes from Juergen Gross:
       "A short series fixing a regression introduced in 5.9 for running as
        Xen dom0 on a system with NVMe backed storage"
      
      * tag 'for-linus-5.10c-rc8-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/xen/tip:
        xen: don't use page->lru for ZONE_DEVICE memory
        xen: add helpers for caching grant mapping pages
      b53966ff
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · b01deddb
      Linus Torvalds authored
      Pull RISC-V fix from Palmer Dabbelt:
       "Just one fix. It's nothing critical, just a randconfig that wasn't
        building. That said, it does seem pretty safe and is technically a
        regression so I'm sending it along for 5.10:
      
         - define get_cycles64() all the time, as it's used by most
           configurations"
      
      * tag 'riscv-for-linus-5.10-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        RISC-V: Define get_cycles64() regardless of M-mode
      b01deddb
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.10-2020-12-11' of git://git.kernel.dk/linux-block · 31d00f6e
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "Two fixes in here, fixing issues introduced in this merge window"
      
      * tag 'io_uring-5.10-2020-12-11' of git://git.kernel.dk/linux-block:
        io_uring: fix file leak on error path of io ctx creation
        io_uring: fix mis-seting personality's creds
      31d00f6e
    • Linus Torvalds's avatar
      Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input · 643e69af
      Linus Torvalds authored
      Pull input fixes from Dmitry Torokhov:
      
       - a fix for cm109 stomping on its own control URB if it tries to toggle
         buzzer immediately after userspace opens input device (found by
         syzcaller)
      
       - another fix for Raydium touchscreens that do not like splitting
         command transfers
      
       - quirks for i8042, soc_button_array, and goodix drivers to make them
         work better with certain hardware.
      
      * 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/dtor/input:
        Input: goodix - add upside-down quirk for Teclast X98 Pro tablet
        Input: cm109 - do not stomp on control URB
        Input: i8042 - add Acer laptops to the i8042 reset list
        Input: cros_ec_keyb - send 'scancodes' in addition to key events
        Input: soc_button_array - add Lenovo Yoga Tablet2 1051L to the dmi_use_low_level_irq list
        Input: raydium_ts_i2c - do not split tx transactions
      643e69af
    • Mike Snitzer's avatar
      md: change mddev 'chunk_sectors' from int to unsigned · 6ffeb1c3
      Mike Snitzer authored
      
      
      Commit e2782f56 ("Revert "dm raid: remove unnecessary discard
      limits for raid10"") exposed compiler warnings introduced by commit
      e0910c8e ("dm raid: fix discard limits for raid1 and raid10"):
      
      In file included from ./include/linux/kernel.h:14,
                       from ./include/asm-generic/bug.h:20,
                       from ./arch/x86/include/asm/bug.h:93,
                       from ./include/linux/bug.h:5,
                       from ./include/linux/mmdebug.h:5,
                       from ./include/linux/gfp.h:5,
                       from ./include/linux/slab.h:15,
                       from drivers/md/dm-raid.c:8:
      drivers/md/dm-raid.c: In function ‘raid_io_hints’:
      ./include/linux/minmax.h:18:28: warning: comparison of distinct pointer types lacks a cast
        (!!(sizeof((typeof(x) *)1 == (typeof(y) *)1)))
                                  ^~
      ./include/linux/minmax.h:32:4: note: in expansion of macro ‘__typecheck’
         (__typecheck(x, y) && __no_side_effects(x, y))
          ^~~~~~~~~~~
      ./include/linux/minmax.h:42:24: note: in expansion of macro ‘__safe_cmp’
        __builtin_choose_expr(__safe_cmp(x, y), \
                              ^~~~~~~~~~
      ./include/linux/minmax.h:51:19: note: in expansion of macro ‘__careful_cmp’
       #define min(x, y) __careful_cmp(x, y, <)
                         ^~~~~~~~~~~~~
      ./include/linux/minmax.h:84:39: note: in expansion of macro ‘min’
        __x == 0 ? __y : ((__y == 0) ? __x : min(__x, __y)); })
                                             ^~~
      drivers/md/dm-raid.c:3739:33: note: in expansion of macro ‘min_not_zero’
         limits->max_discard_sectors = min_not_zero(rs->md.chunk_sectors,
                                       ^~~~~~~~~~~~
      
      Fix this by changing the chunk_sectors member of 'struct mddev' from
      int to 'unsigned int' to match the type used for the 'chunk_sectors'
      member of 'struct queue_limits'.  Various MD code still uses 'int' but
      none of it appears to ever make use of signed int; and storing
      positive signed int in unsigned is perfectly safe.
      
      Reported-by: default avatarSong Liu <songliubraving@fb.com>
      Fixes: e2782f56 ("Revert "dm raid: remove unnecessary discard limits for raid10"")
      Fixes: e0910c8e ("dm raid: fix discard limits for raid1 and raid10")
      Cc: stable@vger,kernel.org # e0910c8e was marked for stable@
      Signed-off-by: default avatarMike Snitzer <snitzer@redhat.com>
      Reviewed-by: default avatarSong Liu <song@kernel.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6ffeb1c3
  4. Dec 12, 2020