1. 16 Jan, 2021 7 commits
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · acda701b
      Linus Torvalds authored
      Pull RISC-V fixes from Palmer Dabbelt:
       "There are a few more fixes than a normal rc4, largely due to the
        bubble introduced by the holiday break:
      
         - return -ENOSYS for syscall number -1, which previously returned an
           uninitialized value.
      
         - ensure of_clk_init() has been called in time_init(), without which
           clock drivers may not be initialized.
      
         - fix sifive,uart0 driver to properly display the baud rate. A fix to
           initialize MPIE that allows interrupts to be processed during
           system calls.
      
         - avoid erronously begin tracing IRQs when interrupts are disabled,
           which at least triggers suprious lockdep failures.
      
         - workaround for a warning related to calling smp_processor_id()
           while preemptible. The warning itself is suprious on currently
           availiable systems.
      
         - properly include the generic time VDSO calls. A fix to our kasan
           address mapping. A fix to the HiFive Unleashed device tree, which
           allows the Ethernet PHY to be properly initialized by Linux (as
           opposed to relying on the bootloader).
      
         - defconfig update to include SiFive's GPIO driver, which is present
           on the HiFive Unleashed and necessary to initialize the PHY.
      
         - avoid allocating memory while initializing reserved memory.
      
         - avoid allocating the last 4K of memory, as pointers there alias
           with syscall errors.
      
        There are also two cleanups that should have no functional effect but
        do fix build warnings:
      
         - drop a duplicated definition of PAGE_KERNEL_EXEC.
      
         - properly declare the asm register SP shim.
      
         - cleanup the rv32 memory size Kconfig entry, to reflect the actual
           size of memory availiable"
      
      * tag 'riscv-for-linus-5.11-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        RISC-V: Fix maximum allowed phsyical memory for RV32
        RISC-V: Set current memblock limit
        RISC-V: Do not allocate memblock while iterating reserved memblocks
        riscv: stacktrace: Move register keyword to beginning of declaration
        riscv: defconfig: enable gpio support for HiFive Unleashed
        dts: phy: add GPIO number and active state used for phy reset
        dts: phy: fix missing mdio device and probe failure of vsc8541-01 device
        riscv: Fix KASAN memory mapping.
        riscv: Fixup CONFIG_GENERIC_TIME_VSYSCALL
        riscv: cacheinfo: Fix using smp_processor_id() in preemptible
        riscv: Trace irq on only interrupt is enabled
        riscv: Drop a duplicated PAGE_KERNEL_EXEC
        riscv: Enable interrupts during syscalls with M-Mode
        riscv: Fix sifive serial driver
        riscv: Fix kernel time_init()
        riscv: return -ENOSYS for syscall -1
      acda701b
    • Linus Torvalds's avatar
      mm: don't play games with pinned pages in clear_page_refs · 9348b73c
      Linus Torvalds authored
      Turning a pinned page read-only breaks the pinning after COW.  Don't do it.
      
      The whole "track page soft dirty" state doesn't work with pinned pages
      anyway, since the page might be dirtied by the pinning entity without
      ever being noticed in the page tables.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      9348b73c
    • Linus Torvalds's avatar
      mm: fix clear_refs_write locking · 29a951df
      Linus Torvalds authored
      Turning page table entries read-only requires the mmap_sem held for
      writing.
      
      So stop doing the odd games with turning things from read locks to write
      locks and back.  Just get the write lock.
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      29a951df
    • Atish Patra's avatar
      RISC-V: Fix maximum allowed phsyical memory for RV32 · e5577937
      Atish Patra authored
      Linux kernel can only map 1GB of address space for RV32 as the page offset
      is set to 0xC0000000. The current description in the Kconfig is confusing
      as it indicates that RV32 can support 2GB of physical memory. That is
      simply not true for current kernel. In future, a 2GB split support can be
      added to allow 2GB physical address space.
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      e5577937
    • Atish Patra's avatar
      RISC-V: Set current memblock limit · abb8e86b
      Atish Patra authored
      Currently, linux kernel can not use last 4k bytes of addressable space
      because IS_ERR_VALUE macro treats those as an error. This will be an issue
      for RV32 as any memblock allocator potentially allocate chunk of memory
      from the end of DRAM (2GB) leading bad address error even though the
      address was technically valid.
      
      Fix this issue by limiting the memblock if available memory spans the
      entire address space.
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      abb8e86b
    • Atish Patra's avatar
      RISC-V: Do not allocate memblock while iterating reserved memblocks · 797f0375
      Atish Patra authored
      Currently, resource tree allocates memory blocks while iterating on the
      list. It leads to following kernel warning because memblock allocation
      also invokes memory block reservation API.
      
      [    0.000000] ------------[ cut here ]------------
      [    0.000000] WARNING: CPU: 0 PID: 0 at kernel/resource.c:795
      __insert_resource+0x8e/0xd0
      [    0.000000] Modules linked in:
      [    0.000000] CPU: 0 PID: 0 Comm: swapper Not tainted
      5.10.0-00022-ge20097fb37e2-dirty #549
      [    0.000000] epc: c00125c2 ra : c001262c sp : c1c01f50
      [    0.000000]  gp : c1d456e0 tp : c1c0a980 t0 : ffffcf20
      [    0.000000]  t1 : 00000000 t2 : 00000000 s0 : c1c01f60
      [    0.000000]  s1 : ffffcf00 a0 : ffffff00 a1 : c1c0c0c4
      [    0.000000]  a2 : 80c12b15 a3 : 80402000 a4 : 80402000
      [    0.000000]  a5 : c1c0c0c4 a6 : 80c12b15 a7 : f5faf600
      [    0.000000]  s2 : c1c0c0c4 s3 : c1c0e000 s4 : c1009a80
      [    0.000000]  s5 : c1c0c000 s6 : c1d48000 s7 : c1613b4c
      [    0.000000]  s8 : 00000fff s9 : 80000200 s10: c1613b40
      [    0.000000]  s11: 00000000 t3 : c1d4a000 t4 : ffffffff
      
      This is also unnecessary as we can pre-compute the total memblocks required
      for each memory region and allocate it before the loop. It save precious
      boot time not going through memblock allocation code every time.
      
      Fixes: 00ab027a ("RISC-V: Add kernel image sections to the resource tree")
      Reviewed-by: default avatarAnup Patel <anup@brainfault.org>
      Tested-by: default avatarGeert Uytterhoeven <geert@linux-m68k.org>
      Signed-off-by: default avatarAtish Patra <atish.patra@wdc.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      797f0375
    • Linus Torvalds's avatar
      Merge tag 'for-5.11/dm-fixes-1' of... · 1d94330a
      Linus Torvalds authored
      Merge tag 'for-5.11/dm-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm
      
      Pull device mapper fixes from Mike Snitzer:
      
       - Fix DM-raid's raid1 discard limits so discards work.
      
       - Select missing Kconfig dependencies for DM integrity and zoned
         targets.
      
       - Four fixes for DM crypt target's support to optionally bypass kcryptd
         workqueues.
      
       - Fix DM snapshot merge supports missing data flushes before committing
         metadata.
      
       - Fix DM integrity data device flushing when external metadata is used.
      
       - Fix DM integrity's maximum number of supported constructor arguments
         that user can request when creating an integrity device.
      
       - Eliminate DM core ioctl logging noise when an ioctl is issued without
         required CAP_SYS_RAWIO permission.
      
      * tag 'for-5.11/dm-fixes-1' of git://git.kernel.org/pub/scm/linux/kernel/git/device-mapper/linux-dm:
        dm crypt: defer decryption to a tasklet if interrupts disabled
        dm integrity: fix the maximum number of arguments
        dm crypt: do not call bio_endio() from the dm-crypt tasklet
        dm integrity: fix flush with external metadata device
        dm: eliminate potential source of excessive kernel log noise
        dm snapshot: flush merged data before committing metadata
        dm crypt: use GFP_ATOMIC when allocating crypto requests from softirq
        dm crypt: do not wait for backlogged crypto request completion in softirq
        dm zoned: select CONFIG_CRC32
        dm integrity: select CRYPTO_SKCIPHER
        dm raid: fix discard limits for raid1
      1d94330a
  2. 15 Jan, 2021 33 commits