1. 27 Jul, 2022 3 commits
  2. 26 Jul, 2022 2 commits
  3. 24 Jul, 2022 6 commits
  4. 23 Jul, 2022 2 commits
  5. 22 Jul, 2022 15 commits
  6. 21 Jul, 2022 12 commits
    • Ben Dooks's avatar
      riscv: add as-options for modules with assembly compontents · c1f6eff3
      Ben Dooks authored
      When trying to load modules built for RISC-V which include assembly files
      the kernel loader errors with "unexpected relocation type 'R_RISCV_ALIGN'"
      due to R_RISCV_ALIGN relocations being generated by the assembler.
      
      The R_RISCV_ALIGN relocations can be removed at the expense of code space
      by adding -mno-relax to gcc and as.  In commit 7a8e7da4
      ("RISC-V: Fixes to module loading") -mno-relax is added to the build
      variable KBUILD_CFLAGS_MODULE. See [1] for more info.
      
      The issue is that when kbuild builds a .S file, it invokes gcc with
      the -mno-relax flag, but this is not being passed through to the
      assembler. Adding -Wa,-mno-relax to KBUILD_AFLAGS_MODULE ensures that
      the assembler is invoked correctly. This may have now been fixed in
      gcc[2] and this addition should not stop newer gcc and as from working.
      
      [1] https://github.com/riscv/riscv-elf-psabi-doc/issues/183
      [2] https://github.com/gcc-mirror/gcc/commit/3b0a7d624e64eeb81e4d5e8c62c46d86ef521857Signed-off-by: default avatarBen Dooks <ben.dooks@codethink.co.uk>
      Reviewed-by: default avatarBin Meng <bmeng.cn@gmail.com>
      Link: https://lore.kernel.org/r/20220529152200.609809-1-ben.dooks@codethink.co.uk
      Fixes: ab1ef68e ("RISC-V: Add sections of PLT and GOT for kernel module")
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPalmer Dabbelt <palmer@rivosinc.com>
      c1f6eff3
    • Linus Torvalds's avatar
      Merge tag 'mtd/fixes-for-5.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux · 68e77ffb
      Linus Torvalds authored
      Pull MTD fix from Richard Weinberger:
       "A aingle NAND controller fix:
      
         - gpmi: Fix busy timeout setting (wrong calculation, yes again)"
      
      * tag 'mtd/fixes-for-5.19-final' of git://git.kernel.org/pub/scm/linux/kernel/git/mtd/linux:
        mtd: rawnand: gpmi: Set WAIT_FOR_READY timeout based on program/erase times
      68e77ffb
    • Linus Torvalds's avatar
      Merge tag 'net-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net · 7ca433dc
      Linus Torvalds authored
      Pull networking fixes from Paolo Abeni:
       "Including fixes from can.
      
        Still no major regressions, most of the changes are still due to data
        races fixes, plus the usual bunch of drivers fixes.
      
        Previous releases - regressions:
      
         - tcp/udp: make early_demux back namespacified.
      
         - dsa: fix issues with vlan_filtering_is_global
      
        Previous releases - always broken:
      
         - ip: fix data-races around ipv4_net_table (round 2, 3 & 4)
      
         - amt: fix validation and synchronization bugs
      
         - can: fix detection of mcp251863
      
         - eth: iavf: fix handling of dummy receive descriptors
      
         - eth: lan966x: fix issues with MAC table
      
         - eth: stmmac: dwmac-mediatek: fix clock issue
      
        Misc:
      
         - dsa: update documentation"
      
      * tag 'net-5.19-rc8' of git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net: (107 commits)
        mlxsw: spectrum_router: Fix IPv4 nexthop gateway indication
        net/sched: cls_api: Fix flow action initialization
        tcp: Fix data-races around sysctl_tcp_max_reordering.
        tcp: Fix a data-race around sysctl_tcp_abort_on_overflow.
        tcp: Fix a data-race around sysctl_tcp_rfc1337.
        tcp: Fix a data-race around sysctl_tcp_stdurg.
        tcp: Fix a data-race around sysctl_tcp_retrans_collapse.
        tcp: Fix data-races around sysctl_tcp_slow_start_after_idle.
        tcp: Fix a data-race around sysctl_tcp_thin_linear_timeouts.
        tcp: Fix data-races around sysctl_tcp_recovery.
        tcp: Fix a data-race around sysctl_tcp_early_retrans.
        tcp: Fix data-races around sysctl knobs related to SYN option.
        udp: Fix a data-race around sysctl_udp_l3mdev_accept.
        ip: Fix data-races around sysctl_ip_prot_sock.
        ipv4: Fix data-races around sysctl_fib_multipath_hash_fields.
        ipv4: Fix data-races around sysctl_fib_multipath_hash_policy.
        ipv4: Fix a data-race around sysctl_fib_multipath_use_neigh.
        can: rcar_canfd: Add missing of_node_put() in rcar_canfd_probe()
        can: mcp251xfd: fix detection of mcp251863
        Documentation: fix udp_wmem_min in ip-sysctl.rst
        ...
      7ca433dc
    • Harald Freudenberger's avatar
      s390/archrandom: prevent CPACF trng invocations in interrupt context · 918e75f7
      Harald Freudenberger authored
      This patch slightly reworks the s390 arch_get_random_seed_{int,long}
      implementation: Make sure the CPACF trng instruction is never
      called in any interrupt context. This is done by adding an
      additional condition in_task().
      
      Justification:
      
      There are some constrains to satisfy for the invocation of the
      arch_get_random_seed_{int,long}() functions:
      - They should provide good random data during kernel initialization.
      - They should not be called in interrupt context as the TRNG
        instruction is relatively heavy weight and may for example
        make some network loads cause to timeout and buck.
      
      However, it was not clear what kind of interrupt context is exactly
      encountered during kernel init or network traffic eventually calling
      arch_get_random_seed_long().
      
      After some days of investigations it is clear that the s390
      start_kernel function is not running in any interrupt context and
      so the trng is called:
      
      Jul 11 18:33:39 t35lp54 kernel:  [<00000001064e90ca>] arch_get_random_seed_long.part.0+0x32/0x70
      Jul 11 18:33:39 t35lp54 kernel:  [<000000010715f246>] random_init+0xf6/0x238
      Jul 11 18:33:39 t35lp54 kernel:  [<000000010712545c>] start_kernel+0x4a4/0x628
      Jul 11 18:33:39 t35lp54 kernel:  [<000000010590402a>] startup_continue+0x2a/0x40
      
      The condition in_task() is true and the CPACF trng provides random data
      during kernel startup.
      
      The network traffic however, is more difficult. A typical call stack
      looks like this:
      
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b5600fc>] extract_entropy.constprop.0+0x23c/0x240
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b560136>] crng_reseed+0x36/0xd8
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b5604b8>] crng_make_state+0x78/0x340
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b5607e0>] _get_random_bytes+0x60/0xf8
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b56108a>] get_random_u32+0xda/0x248
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008aefe7a8>] kfence_guarded_alloc+0x48/0x4b8
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008aeff35e>] __kfence_alloc+0x18e/0x1b8
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008aef7f10>] __kmalloc_node_track_caller+0x368/0x4d8
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b611eac>] kmalloc_reserve+0x44/0xa0
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b611f98>] __alloc_skb+0x90/0x178
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b6120dc>] __napi_alloc_skb+0x5c/0x118
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b8f06b4>] qeth_extract_skb+0x13c/0x680
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b8f6526>] qeth_poll+0x256/0x3f8
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b63d76e>] __napi_poll.constprop.0+0x46/0x2f8
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b63dbec>] net_rx_action+0x1cc/0x408
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b937302>] __do_softirq+0x132/0x6b0
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008abf46ce>] __irq_exit_rcu+0x13e/0x170
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008abf531a>] irq_exit_rcu+0x22/0x50
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b922506>] do_io_irq+0xe6/0x198
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b935826>] io_int_handler+0xd6/0x110
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b9358a6>] psw_idle_exit+0x0/0xa
      Jul 06 17:37:07 t35lp54 kernel: ([<000000008ab9c59a>] arch_cpu_idle+0x52/0xe0)
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b933cfe>] default_idle_call+0x6e/0xd0
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008ac59f4e>] do_idle+0xf6/0x1b0
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008ac5a28e>] cpu_startup_entry+0x36/0x40
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008abb0d90>] smp_start_secondary+0x148/0x158
      Jul 06 17:37:07 t35lp54 kernel:  [<000000008b935b9e>] restart_int_handler+0x6e/0x90
      
      which confirms that the call is in softirq context. So in_task() covers exactly
      the cases where we want to have CPACF trng called: not in nmi, not in hard irq,
      not in soft irq but in normal task context and during kernel init.
      Signed-off-by: default avatarHarald Freudenberger <freude@linux.ibm.com>
      Acked-by: default avatarJason A. Donenfeld <Jason@zx2c4.com>
      Reviewed-by: default avatarJuergen Christ <jchrist@linux.ibm.com>
      Link: https://lore.kernel.org/r/20220713131721.257907-1-freude@linux.ibm.com
      Fixes: e4f74400 ("s390/archrandom: simplify back to earlier design and initialize earlier")
      [agordeev@linux.ibm.com changed desc, added Fixes and Link, removed -stable]
      Signed-off-by: default avatarAlexander Gordeev <agordeev@linux.ibm.com>
      918e75f7
    • Peter Zijlstra's avatar
      mmu_gather: Force tlb-flush VM_PFNMAP vmas · b67fbebd
      Peter Zijlstra authored
      Jann reported a race between munmap() and unmap_mapping_range(), where
      unmap_mapping_range() will no-op once unmap_vmas() has unlinked the
      VMA; however munmap() will not yet have invalidated the TLBs.
      
      Therefore unmap_mapping_range() will complete while there are still
      (stale) TLB entries for the specified range.
      
      Mitigate this by force flushing TLBs for VM_PFNMAP ranges.
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarWill Deacon <will@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      b67fbebd
    • Peter Zijlstra's avatar
      mmu_gather: Let there be one tlb_{start,end}_vma() implementation · 18ba064e
      Peter Zijlstra authored
      Now that architectures are no longer allowed to override
      tlb_{start,end}_vma() re-arrange code so that there is only one
      implementation for each of these functions.
      
      This much simplifies trying to figure out what they actually do.
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarWill Deacon <will@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      18ba064e
    • Peter Zijlstra's avatar
      csky/tlb: Remove tlb_flush() define · 1d7708e7
      Peter Zijlstra authored
      The previous patch removed the tlb_flush_end() implementation which
      used tlb_flush_range(). This means:
      
       - csky did double invalidates, a range invalidate per vma and a full
         invalidate at the end
      
       - csky actually has range invalidates and as such the generic
         tlb_flush implementation is more efficient for it.
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarWill Deacon <will@kernel.org>
      Tested-by: default avatarGuo Ren <guoren@kernel.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1d7708e7
    • Peter Zijlstra's avatar
      mmu_gather: Remove per arch tlb_{start,end}_vma() · 1e9fdf21
      Peter Zijlstra authored
      Scattered across the archs are 3 basic forms of tlb_{start,end}_vma().
      Provide two new MMU_GATHER_knobs to enumerate them and remove the per
      arch tlb_{start,end}_vma() implementations.
      
       - MMU_GATHER_NO_FLUSH_CACHE indicates the arch has flush_cache_range()
         but does *NOT* want to call it for each VMA.
      
       - MMU_GATHER_MERGE_VMAS indicates the arch wants to merge the
         invalidate across multiple VMAs if possible.
      
      With these it is possible to capture the three forms:
      
        1) empty stubs;
           select MMU_GATHER_NO_FLUSH_CACHE and MMU_GATHER_MERGE_VMAS
      
        2) start: flush_cache_range(), end: empty;
           select MMU_GATHER_MERGE_VMAS
      
        3) start: flush_cache_range(), end: flush_tlb_range();
           default
      
      Obviously, if the architecture does not have flush_cache_range() then
      it also doesn't need to select MMU_GATHER_NO_FLUSH_CACHE.
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Acked-by: default avatarWill Deacon <will@kernel.org>
      Cc: David Miller <davem@davemloft.net>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      1e9fdf21
    • Khalid Masum's avatar
      scripts/gdb: Fix gdb 'lx-symbols' command · 23a67619
      Khalid Masum authored
      Currently the command 'lx-symbols' in gdb exits with the error`Function
      "do_init_module" not defined in "kernel/module.c"`. This occurs because
      the file kernel/module.c was moved to kernel/module/main.c.
      
      Fix this breakage by changing the path to "kernel/module/main.c" in
      LoadModuleBreakpoint.
      Signed-off-by: default avatarKhalid Masum <khalid.masum.92@gmail.com>
      Acked-by: default avatarLuis Chamberlain <mcgrof@kernel.org>
      Fixes: cfc1d277 ("module: Move all into module/")
      Reviewed-by: default avatarDouglas Anderson <dianders@chromium.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      23a67619
    • Linus Torvalds's avatar
      watch-queue: remove spurious double semicolon · 44e29e64
      Linus Torvalds authored
      Sedat Dilek noticed that I had an extraneous semicolon at the end of a
      line in the previous patch.
      
      It's harmless, but unintentional, and while compilers just treat it as
      an extra empty statement, for all I know some other tooling might warn
      about it. So clean it up before other people notice too ;)
      
      Fixes: 353f7988 ("watchqueue: make sure to serialize 'wqueue->defunct' properly")
      Reported-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      Reported-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      44e29e64
    • Biju Das's avatar
      spi: spi-rspi: Fix PIO fallback on RZ platforms · b620aa3a
      Biju Das authored
      RSPI IP on RZ/{A, G2L} SoC's has the same signal for both interrupt
      and DMA transfer request. Setting DMARS register for DMA transfer
      makes the signal to work as a DMA transfer request signal and
      subsequent interrupt requests to the interrupt controller
      are masked.
      
      PIO fallback does not work as interrupt signal is disabled.
      
      This patch fixes this issue by re-enabling the interrupts by
      calling dmaengine_synchronize().
      Signed-off-by: default avatarBiju Das <biju.das.jz@bp.renesas.com>
      Reviewed-by: default avatarGeert Uytterhoeven <geert+renesas@glider.be>
      Link: https://lore.kernel.org/r/20220721143449.879257-1-biju.das.jz@bp.renesas.comSigned-off-by: default avatarMark Brown <broonie@kernel.org>
      b620aa3a
    • Dylan Yudaken's avatar
      io_uring: do not recycle buffer in READV · 934447a6
      Dylan Yudaken authored
      READV cannot recycle buffers as it would lose some of the data required to
      reimport that buffer.
      Reported-by: default avatarAmmar Faizi <ammarfaizi2@gnuweeb.org>
      Fixes: b66e65f4 ("io_uring: never call io_buffer_select() for a buffer re-select")
      Signed-off-by: default avatarDylan Yudaken <dylany@fb.com>
      Link: https://lore.kernel.org/r/20220721131325.624788-1-dylany@fb.comSigned-off-by: default avatarJens Axboe <axboe@kernel.dk>
      934447a6