1. 02 Mar, 2021 2 commits
    • Christophe Leroy's avatar
      powerpc: Force inlining of mmu_has_feature to fix build failure · acdad8fb
      Christophe Leroy authored
      The test robot has managed to generate a random config leading
      to following build failure:
      
        LD      .tmp_vmlinux.kallsyms1
      powerpc64-linux-ld: arch/powerpc/mm/pgtable.o: in function `ptep_set_access_flags':
      pgtable.c:(.text.ptep_set_access_flags+0xf0): undefined reference to `hash__flush_tlb_page'
      powerpc64-linux-ld: arch/powerpc/mm/book3s32/mmu.o: in function `MMU_init_hw_patch':
      mmu.c:(.init.text+0x452): undefined reference to `patch__hash_page_A0'
      powerpc64-linux-ld: mmu.c:(.init.text+0x45e): undefined reference to `patch__hash_page_A0'
      powerpc64-linux-ld: mmu.c:(.init.text+0x46a): undefined reference to `patch__hash_page_A1'
      powerpc64-linux-ld: mmu.c:(.init.text+0x476): undefined reference to `patch__hash_page_A1'
      powerpc64-linux-ld: mmu.c:(.init.text+0x482): undefined reference to `patch__hash_page_A2'
      powerpc64-linux-ld: mmu.c:(.init.text+0x48e): undefined reference to `patch__hash_page_A2'
      powerpc64-linux-ld: mmu.c:(.init.text+0x49e): undefined reference to `patch__hash_page_B'
      powerpc64-linux-ld: mmu.c:(.init.text+0x4aa): undefined reference to `patch__hash_page_B'
      powerpc64-linux-ld: mmu.c:(.init.text+0x4b6): undefined reference to `patch__hash_page_C'
      powerpc64-linux-ld: mmu.c:(.init.text+0x4c2): undefined reference to `patch__hash_page_C'
      powerpc64-linux-ld: mmu.c:(.init.text+0x4ce): undefined reference to `patch__flush_hash_A0'
      powerpc64-linux-ld: mmu.c:(.init.text+0x4da): undefined reference to `patch__flush_hash_A0'
      powerpc64-linux-ld: mmu.c:(.init.text+0x4e6): undefined reference to `patch__flush_hash_A1'
      powerpc64-linux-ld: mmu.c:(.init.text+0x4f2): undefined reference to `patch__flush_hash_A1'
      powerpc64-linux-ld: mmu.c:(.init.text+0x4fe): undefined reference to `patch__flush_hash_A2'
      powerpc64-linux-ld: mmu.c:(.init.text+0x50a): undefined reference to `patch__flush_hash_A2'
      powerpc64-linux-ld: mmu.c:(.init.text+0x522): undefined reference to `patch__flush_hash_B'
      powerpc64-linux-ld: mmu.c:(.init.text+0x532): undefined reference to `patch__flush_hash_B'
      powerpc64-linux-ld: arch/powerpc/mm/book3s32/mmu.o: in function `update_mmu_cache':
      mmu.c:(.text.update_mmu_cache+0xa0): undefined reference to `add_hash_page'
      powerpc64-linux-ld: mm/memory.o: in function `zap_pte_range':
      memory.c:(.text.zap_pte_range+0x160): undefined reference to `flush_hash_pages'
      powerpc64-linux-ld: mm/memory.o: in function `handle_pte_fault':
      memory.c:(.text.handle_pte_fault+0x180): undefined reference to `hash__flush_tlb_page'
      
      This is due to mmu_has_feature() not being inlined. See extract of build of
      mmu.c with -Winline:
      
      In file included from ./include/linux/mm_types.h:19,
                       from ./include/linux/mmzone.h:21,
                       from ./include/linux/gfp.h:6,
                       from ./include/linux/mm.h:10,
                       from arch/powerpc/mm/book3s32/mmu.c:21:
      ./arch/powerpc/include/asm/mmu.h: In function 'find_free_bat':
      ./arch/powerpc/include/asm/mmu.h:231:20: warning: inlining failed in call to 'early_mmu_has_feature': call is unlikely and code size would grow [-Winline]
        231 | static inline bool early_mmu_has_feature(unsigned long feature)
            |                    ^~~~~~~~~~~~~~~~~~~~~
      ./arch/powerpc/include/asm/mmu.h:291:9: note: called from here
        291 |  return early_mmu_has_feature(feature);
            |         ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
      
      The code relies on constant folding of MMU_FTRS_POSSIBLE at buildtime
      and elimination of non possible parts of code at compile time.
      For this to work, mmu_has_feature() and early_mmu_has_feature()
      must be inlined.
      
      Fixes: 259149cf ("powerpc/32s: Only build hash code when CONFIG_PPC_BOOK3S_604 is selected")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/cf61345912c078c96f171afd0fcc48ef27cbdc3f.1614443418.git.christophe.leroy@csgroup.eu
      acdad8fb
    • Uwe Kleine-König's avatar
      vio: make remove callback return void · 386a966f
      Uwe Kleine-König authored
      The driver core ignores the return value of struct bus_type::remove()
      because there is only little that can be done. To simplify the quest to
      make this function return void, let struct vio_driver::remove() return
      void, too. All users already unconditionally return 0, this commit makes
      it obvious that returning an error code is a bad idea.
      
      Note there are two nominally different implementations for a vio bus:
      one in arch/sparc/kernel/vio.c and the other in
      arch/powerpc/platforms/pseries/vio.c. This patch only adapts the powerpc
      one.
      
      Before this patch for a device that was bound to a driver without a
      remove callback vio_cmo_bus_remove(viodev) wasn't called. As the device
      core still considers the device unbound after vio_bus_remove() returns
      calling this unconditionally is the consistent behaviour which is
      implemented here.
      Signed-off-by: default avatarUwe Kleine-König <uwe@kleine-koenig.org>
      Reviewed-by: default avatarTyrel Datwyler <tyreld@linux.ibm.com>
      Acked-by: default avatarLijun Pan <ljp@linux.ibm.com>
      Acked-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
      [mpe: Drop unneeded hvcs_remove() forward declaration, squash in
       change from sfr to drop ibmvnic_remove() forward declaration]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210225221834.160083-1-uwe@kleine-koenig.org
      386a966f
  2. 01 Mar, 2021 5 commits
    • Christophe Leroy's avatar
      powerpc/syscall: Force inlining of __prep_irq_for_enabled_exit() · 91b6c5db
      Christophe Leroy authored
      As reported by kernel test robot, a randconfig with high amount of
      debuging options can lead to build failure for undefined reference
      to replay_soft_interrupts() on ppc32.
      
      This is due to gcc not seeing that __prep_irq_for_enabled_exit()
      always returns true on ppc32 because it doesn't inline it for
      some reason.
      
      Force inlining of __prep_irq_for_enabled_exit() to fix the build.
      
      Fixes: 344bb20b ("powerpc/syscall: Make interrupt.c buildable on PPC32")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Acked-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/53f3a1f719441761000c41154602bf097d4350b5.1614148356.git.christophe.leroy@csgroup.eu
      91b6c5db
    • Christophe Leroy's avatar
      powerpc/603: Fix protection of user pages mapped with PROT_NONE · c119565a
      Christophe Leroy authored
      On book3s/32, page protection is defined by the PP bits in the PTE
      which provide the following protection depending on the access
      keys defined in the matching segment register:
      - PP 00 means RW with key 0 and N/A with key 1.
      - PP 01 means RW with key 0 and RO with key 1.
      - PP 10 means RW with both key 0 and key 1.
      - PP 11 means RO with both key 0 and key 1.
      
      Since the implementation of kernel userspace access protection,
      PP bits have been set as follows:
      - PP00 for pages without _PAGE_USER
      - PP01 for pages with _PAGE_USER and _PAGE_RW
      - PP11 for pages with _PAGE_USER and without _PAGE_RW
      
      For kernelspace segments, kernel accesses are performed with key 0
      and user accesses are performed with key 1. As PP00 is used for
      non _PAGE_USER pages, user can't access kernel pages not flagged
      _PAGE_USER while kernel can.
      
      For userspace segments, both kernel and user accesses are performed
      with key 0, therefore pages not flagged _PAGE_USER are still
      accessible to the user.
      
      This shouldn't be an issue, because userspace is expected to be
      accessible to the user. But unlike most other architectures, powerpc
      implements PROT_NONE protection by removing _PAGE_USER flag instead of
      flagging the page as not valid. This means that pages in userspace
      that are not flagged _PAGE_USER shall remain inaccessible.
      
      To get the expected behaviour, just mimic other architectures in the
      TLB miss handler by checking _PAGE_USER permission on userspace
      accesses as if it was the _PAGE_PRESENT bit.
      
      Note that this problem only is only for 603 cores. The 604+ have
      an hash table, and hash_page() function already implement the
      verification of _PAGE_USER permission on userspace pages.
      
      Fixes: f342adca ("powerpc/32s: Prepare Kernel Userspace Access Protection")
      Cc: stable@vger.kernel.org # v5.2+
      Reported-by: default avatarChristoph Plattner <christoph.plattner@thalesgroup.com>
      Signed-off-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/4a0c6e3bb8f0c162457bf54d9bc6fd8d7b55129f.1612160907.git.christophe.leroy@csgroup.eu
      c119565a
    • Greg Kurz's avatar
      powerpc/pseries: Don't enforce MSI affinity with kdump · f9619d5e
      Greg Kurz authored
      Depending on the number of online CPUs in the original kernel, it is
      likely for CPU #0 to be offline in a kdump kernel. The associated IRQs
      in the affinity mappings provided by irq_create_affinity_masks() are
      thus not started by irq_startup(), as per-design with managed IRQs.
      
      This can be a problem with multi-queue block devices driven by blk-mq :
      such a non-started IRQ is very likely paired with the single queue
      enforced by blk-mq during kdump (see blk_mq_alloc_tag_set()). This
      causes the device to remain silent and likely hangs the guest at
      some point.
      
      This is a regression caused by commit 9ea69a55 ("powerpc/pseries:
      Pass MSI affinity to irq_create_mapping()"). Note that this only happens
      with the XIVE interrupt controller because XICS has a workaround to bypass
      affinity, which is activated during kdump with the "noirqdistrib" kernel
      parameter.
      
      The issue comes from a combination of factors:
      - discrepancy between the number of queues detected by the multi-queue
        block driver, that was used to create the MSI vectors, and the single
        queue mode enforced later on by blk-mq because of kdump (i.e. keeping
        all queues fixes the issue)
      - CPU#0 offline (i.e. kdump always succeed with CPU#0)
      
      Given that I couldn't reproduce on x86, which seems to always have CPU#0
      online even during kdump, I'm not sure where this should be fixed. Hence
      going for another approach : fine-grained affinity is for performance
      and we don't really care about that during kdump. Simply revert to the
      previous working behavior of ignoring affinity masks in this case only.
      
      Fixes: 9ea69a55 ("powerpc/pseries: Pass MSI affinity to irq_create_mapping()")
      Cc: stable@vger.kernel.org # v5.10+
      Signed-off-by: default avatarGreg Kurz <groug@kaod.org>
      Reviewed-by: default avatarLaurent Vivier <lvivier@redhat.com>
      Reviewed-by: default avatarCédric Le Goater <clg@kaod.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20210215094506.1196119-1-groug@kaod.org
      f9619d5e
    • Michael Ellerman's avatar
      powerpc/4xx: Fix build errors from mfdcr() · eead0893
      Michael Ellerman authored
      lkp reported a build error in fsp2.o:
      
        CC      arch/powerpc/platforms/44x/fsp2.o
        {standard input}:577: Error: unsupported relocation against base
      
      Which comes from:
      
        pr_err("GESR0: 0x%08x\n", mfdcr(base + PLB4OPB_GESR0));
      
      Where our mfdcr() macro is stringifying "base + PLB4OPB_GESR0", and
      passing that to the assembler, which obviously doesn't work.
      
      The mfdcr() macro already checks that the argument is constant using
      __builtin_constant_p(), and if not calls the out-of-line version of
      mfdcr(). But in this case GCC is smart enough to notice that "base +
      PLB4OPB_GESR0" will be constant, even though it's not something we can
      immediately stringify into a register number.
      
      Segher pointed out that passing the register number to the inline asm
      as a constant would be better, and in fact it fixes the build error,
      presumably because it gives GCC a chance to resolve the value.
      
      While we're at it, change mtdcr() similarly.
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Suggested-by: default avatarSegher Boessenkool <segher@kernel.crashing.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Acked-by: default avatarFeng Tang <feng.tang@intel.com>
      Link: https://lore.kernel.org/r/20210218123058.748882-1-mpe@ellerman.id.au
      eead0893
    • Linus Torvalds's avatar
      Linux 5.12-rc1 · fe07bfda
      Linus Torvalds authored
      fe07bfda
  3. 28 Feb, 2021 12 commits
    • Linus Torvalds's avatar
      Merge tag 'ide-5.11-2021-02-28' of git://git.kernel.dk/linux-block · d346da4a
      Linus Torvalds authored
      Pull ide fix from Jens Axboe:
       "This is a leftover fix from 5.11, where I forgot to ship it your way"
      
      * tag 'ide-5.11-2021-02-28' of git://git.kernel.dk/linux-block:
        ide/falconide: Fix module unload
      d346da4a
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v5.12' of... · 06d5d309
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Fix UNUSED_KSYMS_WHITELIST for Clang LTO
      
       - Make -s builds really silent irrespective of V= option
      
       - Fix build error when SUBLEVEL or PATCHLEVEL is empty
      
      * tag 'kbuild-fixes-v5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL again
        kbuild: make -s option take precedence over V=1
        ia64: remove redundant READELF from arch/ia64/Makefile
        kbuild: do not include include/config/auto.conf from adjust_autoksyms.sh
        kbuild: fix UNUSED_KSYMS_WHITELIST for Clang LTO
        kbuild: lto: add _mcount to list of used symbols
      06d5d309
    • Linus Torvalds's avatar
      Merge tag 'csky-for-linus-5.12-rc1' of git://github.com/c-sky/csky-linux · cd278456
      Linus Torvalds authored
      Pull arch/csky updates from Guo Ren:
       "Features:
         - add new memory layout 2.5G(user):1.5G(kernel)
         - add kmemleak support
         - reconstruct VDSO framework: add VDSO with GENERIC_GETTIMEOFDAY,
           GENERIC_TIME_VSYSCALL, HAVE_GENERIC_VDSO
         - add faulthandler_disabled() check
         - support (fix) swapon
         - add (fix) _PAGE_ACCESSED for default pgprot
         - abort uaccess retries upon fatal signal (from arm)
      
        Fixes and optimizations:
         - fix perf probe failure
         - fix show_regs doesn't contain regs->usp
         - remove custom asm/atomic.h implementation
         - fix barrier design
         - fix futex SMP implementation
         - fix asm/cmpxchg.h with correct ordering barrier
         - cleanup asm/spinlock.h
         - fix PTE global for 2.5:1.5 virtual memory
         - remove prologue of page fault handler in entry.S
         - fix TLB maintenance synchronization problem
         - add show_tlb for CPU_CK860 debug
         - fix FAULT_FLAG_XXX param for handle_mm_fault
         - fix update_mmu_cache called with user io mapping
         - fix do_page_fault parent irq status
         - fix a size determination in gpr_get()
         - pgtable.h: Coding convention
         - kprobe: Fix code in simulate without 'long'
         - fix pfn_valid error with wrong max_mapnr
         - use free_initmem_default() in free_initmem()
         - fix compile error"
      
      * tag 'csky-for-linus-5.12-rc1' of git://github.com/c-sky/csky-linux: (30 commits)
        csky: Fixup compile error
        csky: use free_initmem_default() in free_initmem()
        csky: Fixup pfn_valid error with wrong max_mapnr
        csky: Add VDSO with GENERIC_GETTIMEOFDAY, GENERIC_TIME_VSYSCALL, HAVE_GENERIC_VDSO
        csky: kprobe: Fixup code in simulate without 'long'
        csky: Fixup swapon
        csky: pgtable.h: Coding convention
        csky: Fixup _PAGE_ACCESSED for default pgprot
        csky: remove unused including <linux/version.h>
        csky: Fix a size determination in gpr_get()
        csky: Reconstruct VDSO framework
        csky: mm: abort uaccess retries upon fatal signal
        csky: Sync riscv mm/fault.c for easy maintenance
        csky: Fixup do_page_fault parent irq status
        csky: Add faulthandler_disabled() check
        csky: Fixup update_mmu_cache called with user io mapping
        csky: Fixup FAULT_FLAG_XXX param for handle_mm_fault
        csky: Add show_tlb for CPU_CK860 debug
        csky: Fix TLB maintenance synchronization problem
        csky: Add kmemleak support
        ...
      cd278456
    • Linus Torvalds's avatar
      Merge tag 'riscv-for-linus-5.12-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux · 7d19ea5e
      Linus Torvalds authored
      Pull more RISC-V updates from Palmer Dabbelt:
       "A pair of patches that slipped through the cracks:
      
         - enable CPU hotplug in the defconfigs
      
         - some cleanups to setup_bootmem
      
        There's also a single fix for some randconfig build failures:
      
         - make NUMA depend on SMP"
      
      * tag 'riscv-for-linus-5.12-mw1' of git://git.kernel.org/pub/scm/linux/kernel/git/riscv/linux:
        riscv: Cleanup setup_bootmem()
        RISC-V: Enable CPU Hotplug in defconfigs
        RISC-V: Make NUMA depend on SMP
      7d19ea5e
    • Linus Torvalds's avatar
      Merge tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 0b311e34
      Linus Torvalds authored
      Pull more SCSI updates from James Bottomley:
       "This is a few driver updates (iscsi, mpt3sas) that were still in the
        staging queue when the merge window opened (all committed on or before
        8 Feb) and some small bug fixes which came in during the merge window
        (all committed on 22 Feb)"
      
      * tag 'scsi-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: (30 commits)
        scsi: hpsa: Correct dev cmds outstanding for retried cmds
        scsi: sd: Fix Opal support
        scsi: target: tcmu: Fix memory leak caused by wrong uio usage
        scsi: target: tcmu: Move some functions without code change
        scsi: sd: sd_zbc: Don't pass GFP_NOIO to kvcalloc
        scsi: aic7xxx: Remove unused function pointer typedef ahc_bus_suspend/resume_t
        scsi: bnx2fc: Fix Kconfig warning & CNIC build errors
        scsi: ufs: Fix a duplicate dev quirk number
        scsi: aic79xx: Fix spelling of version
        scsi: target: core: Prevent underflow for service actions
        scsi: target: core: Add cmd length set before cmd complete
        scsi: iscsi: Drop session lock in iscsi_session_chkready()
        scsi: qla4xxx: Use iscsi_is_session_online()
        scsi: libiscsi: Reset max/exp cmdsn during recovery
        scsi: iscsi_tcp: Fix shost can_queue initialization
        scsi: libiscsi: Add helper to calculate max SCSI cmds per session
        scsi: libiscsi: Fix iSCSI host workq destruction
        scsi: libiscsi: Fix iscsi_task use after free()
        scsi: libiscsi: Drop taskqueuelock
        scsi: libiscsi: Fix iscsi_prep_scsi_cmd_pdu() error handling
        ...
      0b311e34
    • Linus Torvalds's avatar
      Merge tag 'xfs-5.12-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 03dc748b
      Linus Torvalds authored
      Pull more xfs updates from Darrick Wong:
       "The most notable fix here prevents premature reuse of freed metadata
        blocks, and adding the ability to detect accidental nested
        transactions, which are not allowed here.
      
         - Restore a disused sysctl control knob that was inadvertently
           dropped during the merge window to avoid fstests regressions.
      
         - Don't speculatively release freed blocks from the busy list until
           we're actually allocating them, which fixes a rare log recovery
           regression.
      
         - Don't nest transactions when scanning for free space.
      
         - Add an idiot^Wmaintainer light to detect nested transactions. ;)"
      
      * tag 'xfs-5.12-merge-6' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: use current->journal_info for detecting transaction recursion
        xfs: don't nest transactions when scanning for eofblocks
        xfs: don't reuse busy extents on extent trim
        xfs: restore speculative_cow_prealloc_lifetime sysctl
      03dc748b
    • Linus Torvalds's avatar
      Merge tag 'block-5.12-2021-02-27' of git://git.kernel.dk/linux-block · 3ab6608e
      Linus Torvalds authored
      Pull more block updates from Jens Axboe:
       "A few stragglers (and one due to me missing it originally), and fixes
        for changes in this merge window mostly. In particular:
      
         - blktrace cleanups (Chaitanya, Greg)
      
         - Kill dead blk_pm_* functions (Bart)
      
         - Fixes for the bio alloc changes (Christoph)
      
         - Fix for the partition changes (Christoph, Ming)
      
         - Fix for turning off iopoll with polled IO inflight (Jeffle)
      
         - nbd disconnect fix (Josef)
      
         - loop fsync error fix (Mauricio)
      
         - kyber update depth fix (Yang)
      
         - max_sectors alignment fix (Mikulas)
      
         - Add bio_max_segs helper (Matthew)"
      
      * tag 'block-5.12-2021-02-27' of git://git.kernel.dk/linux-block: (21 commits)
        block: Add bio_max_segs
        blktrace: fix documentation for blk_fill_rw()
        block: memory allocations in bounce_clone_bio must not fail
        block: remove the gfp_mask argument to bounce_clone_bio
        block: fix bounce_clone_bio for passthrough bios
        block-crypto-fallback: use a bio_set for splitting bios
        block: fix logging on capacity change
        blk-settings: align max_sectors on "logical_block_size" boundary
        block: reopen the device in blkdev_reread_part
        block: don't skip empty device in in disk_uevent
        blktrace: remove debugfs file dentries from struct blk_trace
        nbd: handle device refs for DESTROY_ON_DISCONNECT properly
        kyber: introduce kyber_depth_updated()
        loop: fix I/O error on fsync() in detached loop devices
        block: fix potential IO hang when turning off io_poll
        block: get rid of the trace rq insert wrapper
        blktrace: fix blk_rq_merge documentation
        blktrace: fix blk_rq_issue documentation
        blktrace: add blk_fill_rwbs documentation comment
        block: remove superfluous param in blk_fill_rwbs()
        ...
      3ab6608e
    • Masahiro Yamada's avatar
      kbuild: Fix <linux/version.h> for empty SUBLEVEL or PATCHLEVEL again · 207da4c8
      Masahiro Yamada authored
      Commit 78d3bb44 ("kbuild: Fix <linux/version.h> for empty SUBLEVEL
      or PATCHLEVEL") fixed the build error for empty SUBLEVEL or PATCHLEVEL
      by prepending a zero.
      
      Commit 9b82f13e ("kbuild: clamp SUBLEVEL to 255") re-introduced
      this issue.
      
      This time, we cannot take the same approach because we have C code:
      
        #define LINUX_VERSION_PATCHLEVEL $(PATCHLEVEL)
        #define LINUX_VERSION_SUBLEVEL $(SUBLEVEL)
      
      Replace empty SUBLEVEL/PATCHLEVEL with a zero.
      
      Fixes: 9b82f13e ("kbuild: clamp SUBLEVEL to 255")
      Reported-by: default avatarChristian Zigotzky <chzigotzky@xenosoft.de>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Reviewed-and-tested-by: default avatarSasha Levin <sashal@kernel.org>
      207da4c8
    • Masahiro Yamada's avatar
      kbuild: make -s option take precedence over V=1 · 22149454
      Masahiro Yamada authored
      'make -s' should be really silent. However, 'make -s V=1' prints noisy
      log messages from some shell scripts.
      
      Of course, such a combination is odd, but the build system needs to do
      the right thing even if a user gives strange input.
      
      If -s is given, KBUILD_VERBOSE should be forced to 0.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      22149454
    • Masahiro Yamada's avatar
      ia64: remove redundant READELF from arch/ia64/Makefile · ad7953e7
      Masahiro Yamada authored
      READELF is defined by the top Makefile.
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      ad7953e7
    • Masahiro Yamada's avatar
      kbuild: do not include include/config/auto.conf from adjust_autoksyms.sh · 12e9dea6
      Masahiro Yamada authored
      Commit cd195bc4 ("kbuild: split adjust_autoksyms.sh in two parts")
      split out the code that needs include/config/auto.conf.
      
      This script no longer needs to include include/config/auto.conf.
      
      Fixes: cd195bc4 ("kbuild: split adjust_autoksyms.sh in two parts")
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      12e9dea6
    • Masahiro Yamada's avatar
      kbuild: fix UNUSED_KSYMS_WHITELIST for Clang LTO · a6aaeb84
      Masahiro Yamada authored
      Commit fbe078d3 ("kbuild: lto: add a default list of used symbols")
      does not work as expected if the .config file has already specified
      CONFIG_UNUSED_KSYMS_WHITELIST="my/own/white/list" before enabling
      CONFIG_LTO_CLANG.
      
      So, the user-supplied whitelist and LTO-specific white list must be
      independent of each other.
      
      I refactored the shell script so CONFIG_MODVERSIONS and CONFIG_CLANG_LTO
      handle whitelists in the same way.
      
      Fixes: fbe078d3 ("kbuild: lto: add a default list of used symbols")
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: default avatarSedat Dilek <sedat.dilek@gmail.com>
      a6aaeb84
  4. 27 Feb, 2021 14 commits
    • Linus Torvalds's avatar
      Merge tag 'io_uring-worker.v3-2021-02-25' of git://git.kernel.dk/linux-block · 5695e516
      Linus Torvalds authored
      Pull io_uring thread rewrite from Jens Axboe:
       "This converts the io-wq workers to be forked off the tasks in question
        instead of being kernel threads that assume various bits of the
        original task identity.
      
        This kills > 400 lines of code from io_uring/io-wq, and it's the worst
        part of the code. We've had several bugs in this area, and the worry
        is always that we could be missing some pieces for file types doing
        unusual things (recent /dev/tty example comes to mind, userfaultfd
        reads installing file descriptors is another fun one... - both of
        which need special handling, and I bet it's not the last weird oddity
        we'll find).
      
        With these identical workers, we can have full confidence that we're
        never missing anything. That, in itself, is a huge win. Outside of
        that, it's also more efficient since we're not wasting space and code
        on tracking state, or switching between different states.
      
        I'm sure we're going to find little things to patch up after this
        series, but testing has been pretty thorough, from the usual
        regression suite to production. Any issue that may crop up should be
        manageable.
      
        There's also a nice series of further reductions we can do on top of
        this, but I wanted to get the meat of it out sooner rather than later.
        The general worry here isn't that it's fundamentally broken. Most of
        the little issues we've found over the last week have been related to
        just changes in how thread startup/exit is done, since that's the main
        difference between using kthreads and these kinds of threads. In fact,
        if all goes according to plan, I want to get this into the 5.10 and
        5.11 stable branches as well.
      
        That said, the changes outside of io_uring/io-wq are:
      
         - arch setup, simple one-liner to each arch copy_thread()
           implementation.
      
         - Removal of net and proc restrictions for io_uring, they are no
           longer needed or useful"
      
      * tag 'io_uring-worker.v3-2021-02-25' of git://git.kernel.dk/linux-block: (30 commits)
        io-wq: remove now unused IO_WQ_BIT_ERROR
        io_uring: fix SQPOLL thread handling over exec
        io-wq: improve manager/worker handling over exec
        io_uring: ensure SQPOLL startup is triggered before error shutdown
        io-wq: make buffered file write hashed work map per-ctx
        io-wq: fix race around io_worker grabbing
        io-wq: fix races around manager/worker creation and task exit
        io_uring: ensure io-wq context is always destroyed for tasks
        arch: ensure parisc/powerpc handle PF_IO_WORKER in copy_thread()
        io_uring: cleanup ->user usage
        io-wq: remove nr_process accounting
        io_uring: flag new native workers with IORING_FEAT_NATIVE_WORKERS
        net: remove cmsg restriction from io_uring based send/recvmsg calls
        Revert "proc: don't allow async path resolution of /proc/self components"
        Revert "proc: don't allow async path resolution of /proc/thread-self components"
        io_uring: move SQPOLL thread io-wq forked worker
        io-wq: make io_wq_fork_thread() available to other users
        io-wq: only remove worker from free_list, if it was there
        io_uring: remove io_identity
        io_uring: remove any grabbing of context
        ...
      5695e516
    • Linus Torvalds's avatar
      Merge branch 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs · 5ceabb60
      Linus Torvalds authored
      Pull misc vfs updates from Al Viro:
       "Assorted stuff pile - no common topic here"
      
      * 'work.misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs:
        whack-a-mole: don't open-code iminor/imajor
        9p: fix misuse of sscanf() in v9fs_stat2inode()
        audit_alloc_mark(): don't open-code ERR_CAST()
        fs/inode.c: make inode_init_always() initialize i_ino to 0
        vfs: don't unnecessarily clone write access for writable fds
      5ceabb60
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · 580cd773
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Three more bugfixes and one revert. I accidently applied one patch too
        early"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: exynos5: Preserve high speed master code
        Revert "i2c: i2c-qcom-geni: Add shutdown callback for i2c"
        i2c: designware: Get right data length
        i2c: brcmstb: Fix brcmstd_send_i2c_cmd condition
      580cd773
    • Guo Ren's avatar
      csky: Fixup compile error · 6607aa6f
      Guo Ren authored
      : error: C++ style comments are not allowed in ISO C90
       // Copyright (C) 2018 Hangzhou C-SKY Microsystems co.,ltd.
       ^
      error: (this will be reported only once per input file)
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      6607aa6f
    • David Hildenbrand's avatar
      csky: use free_initmem_default() in free_initmem() · 5d3f410f
      David Hildenbrand authored
      The existing code is essentially
      free_initmem_default()->free_reserved_area() without poisoning.
      
      Note that existing code missed to update the managed page count of the
      zone.
      
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Cc: Mike Rapoport <rppt@kernel.org>
      Cc: Oscar Salvador <osalvador@suse.de>
      Cc: Michal Hocko <mhocko@kernel.org>
      Cc: Wei Yang <richard.weiyang@linux.alibaba.com>
      Tested-by: default avatarGuo Ren <guoren@kernel.org>
      Signed-off-by: default avatarGuo Ren <guoren@kernel.org>
      Signed-off-by: default avatarDavid Hildenbrand <david@redhat.com>
      5d3f410f
    • Guo Ren's avatar
      csky: Fixup pfn_valid error with wrong max_mapnr · c47e1a1c
      Guo Ren authored
      The max_mapnr is the number of PFNs, not absolute PFN offset.
      Using set_max_mapnr API instead of setting the value directly.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      c47e1a1c
    • Guo Ren's avatar
      csky: Add VDSO with GENERIC_GETTIMEOFDAY, GENERIC_TIME_VSYSCALL, HAVE_GENERIC_VDSO · 0d3b051a
      Guo Ren authored
      It could help to reduce the latency of the time-related functions
      in user space.
      
      We have referenced arm's and riscv's implementation for the patch.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Vincent Chen <vincent.chen@sifive.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      0d3b051a
    • Guo Ren's avatar
      csky: kprobe: Fixup code in simulate without 'long' · 8dcbc611
      Guo Ren authored
      The type of 'val' is 'unsigned long' in simulate_blz32, so 'val < 0'
      can't be true.
      
      Cast 'val' to 'long' here to determine branch token or not,
      
      Fixup instructions: bnezad32, bhsz32, bhz32, blsz32, blz32
      
      Link: https://lore.kernel.org/linux-csky/CAJF2gTQjKXR9gpo06WAWG1aquiT87mATiMGorXs6ChxOxoe90Q@mail.gmail.com/T/#tSigned-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Co-developed-by: default avatarMenglong Dong <dong.menglong@zte.com.cn>
      Signed-off-by: default avatarMenglong Dong <dong.menglong@zte.com.cn>
      8dcbc611
    • Guo Ren's avatar
      csky: Fixup swapon · af94002b
      Guo Ren authored
      Current csky's swappon is broken by wrong swap PTE entry format.
      Now redesign the new format for abiv1 & abiv2 and make swappon +
      zram work properly on csky machines.
      
      C-SKY PTE has VALID, DIRTY to emulate PRESENT, READ, WRITE, EXEC
      attributes. GLOBAL bit is shared by two pages in the same tlb
      entry. So we need to keep GLOBAL, VALID, PRESENT zero in swp_pte.
      
      To distinguish PAGE_NONE and swp_pte, we need to use an additional
      bit (abiv1 is _PAGE_READ, abiv2 is _PAGE_WRITE).
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      af94002b
    • Guo Ren's avatar
      csky: pgtable.h: Coding convention · a8fac05a
      Guo Ren authored
      C-SKY page table attributes only have 'Dirty' and 'Valid' to
      emulate 'PRESENT, READ, WRITE, EXEC, DIRTY, ACCESSED'.
      
      This patch cleanup unnecessary definition.
      Signed-off-by: default avatarGuo Ren <guoren@linux.alibaba.com>
      Cc: Arnd Bergmann <arnd@arndb.de>
      a8fac05a
    • Arnd Bergmann's avatar
      kbuild: lto: add _mcount to list of used symbols · da83616b
      Arnd Bergmann authored
      Some randconfig builds fail with undefined references to _mcount
      when CONFIG_TRIM_UNUSED_KSYMS is set:
      
      ERROR: modpost: "_mcount" [drivers/tee/optee/optee.ko] undefined!
      ERROR: modpost: "_mcount" [drivers/fsi/fsi-occ.ko] undefined!
      ERROR: modpost: "_mcount" [drivers/fpga/dfl-pci.ko] undefined!
      
      Since there is already a list of symbols that get generated at link
      time, add this one as well.
      
      Fixes: fbe078d3 ("kbuild: lto: add a default list of used symbols")
      Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      da83616b
    • Kefeng Wang's avatar
      riscv: Cleanup setup_bootmem() · dd2d082b
      Kefeng Wang authored
      After the following patches,
      
        commit de043da0 ("RISC-V: Fix usage of memblock_enforce_memory_limit")
        commit 1bd14a66 ("RISC-V: Remove any memblock representing unusable memory area")
        commit b10d6bca ("arch, drivers: replace for_each_membock() with for_each_mem_range()")
      
      some logic is useless, kill the mem_start/start/end and unneeded code.
      Reviewed-by: default avatarAtish Patra <atish.patra@wdc.com>
      Signed-off-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      dd2d082b
    • Anup Patel's avatar
      RISC-V: Enable CPU Hotplug in defconfigs · b122c7a3
      Anup Patel authored
      The CPU hotplug support has been tested on QEMU, Spike, and SiFive
      Unleashed so let's enable it by default in RV32 and RV64 defconfigs.
      Signed-off-by: default avatarAnup Patel <anup.patel@wdc.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      b122c7a3
    • Palmer Dabbelt's avatar
      RISC-V: Make NUMA depend on SMP · f01e631c
      Palmer Dabbelt authored
      In theory these are orthogonal, but in practice all NUMA systems are
      SMP.  NUMA && !SMP doesn't build, everyone else is coupling them, and I
      don't really see any value in supporting that configuration.
      
      Fixes: 4f0e8eef ("riscv: Add numa support for riscv64 platform")
      Suggested-by: default avatarAndrew Morton <akpm@linux-foundation.org>
      Suggested-by: default avatarAtish Patra <atishp@atishpatra.org>
      Reported-by: default avatarKefeng Wang <wangkefeng.wang@huawei.com>
      Tested-by: default avatar Kefeng Wang <wangkefeng.wang@huawei.com>
      Signed-off-by: default avatarPalmer Dabbelt <palmerdabbelt@google.com>
      f01e631c
  5. 26 Feb, 2021 7 commits
    • Matthew Wilcox (Oracle)'s avatar
      block: Add bio_max_segs · 5f7136db
      Matthew Wilcox (Oracle) authored
      It's often inconvenient to use BIO_MAX_PAGES due to min() requiring the
      sign to be the same.  Introduce bio_max_segs() and change BIO_MAX_PAGES to
      be unsigned to make it easier for the users.
      Reviewed-by: default avatarChaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
      Signed-off-by: default avatarMatthew Wilcox (Oracle) <willy@infradead.org>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      5f7136db
    • Linus Torvalds's avatar
      Merge tag 'docs-5.12-2' of git://git.lwn.net/linux · 3fb6d0e0
      Linus Torvalds authored
      Pull documentation fixes from Jonathan Corbet:
       "A handful of late-arriving documentation fixes, nothing all that
        notable"
      
      * tag 'docs-5.12-2' of git://git.lwn.net/linux:
        docs: proc.rst: fix indentation warning
        Documentation: cgroup-v2: fix path to example BPF program
        docs: powerpc: Fix tables in syscall64-abi.rst
        Documentation: features: refresh feature list
        Documentation: features: remove c6x references
        docs: ABI: testing: ima_policy: Fixed missing bracket
        Fix unaesthetic indentation
        scripts: kernel-doc: fix array element capture in pointer-to-func parsing
        doc: use KCFLAGS instead of EXTRA_CFLAGS to pass flags from command line
        Documentation: proc.rst: add more about the 6 fields in loadavg
      3fb6d0e0
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://github.com/openrisc/linux · a3905af5
      Linus Torvalds authored
      Pull OpenRISC updates from Stafford Horne:
      
       - Update for Litex SoC controller to support wider width registers as
         well as reset.
      
       - Refactor SMP code to use device tree to define possible cpus.
      
       - Update build including generating vmlinux.bin
      
      * tag 'for-linus' of git://github.com/openrisc/linux:
        openrisc: Use devicetree to determine present cpus
        drivers/soc/litex: Add restart handler
        openrisc: add arch/openrisc/Kbuild
        drivers/soc/litex: make 'litex_[set|get]_reg()' methods private
        drivers/soc/litex: support 32-bit subregisters, 64-bit CPUs
        drivers/soc/litex: s/LITEX_REG_SIZE/LITEX_SUBREG_ALIGN/g
        drivers/soc/litex: separate MMIO from subregister offset calculation
        drivers/soc/litex: move generic accessors to litex.h
        openrisc: restart: Call common handlers before hanging
        openrisc: Add vmlinux.bin target
      a3905af5
    • Linus Torvalds's avatar
      Merge tag 's390-5.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · e7270e47
      Linus Torvalds authored
      Pull more s390 updates from Vasily Gorbik:
      
       - Fix physical vs virtual confusion in some basic mm macros and
         routines. Caused by __pa == __va on s390 currently.
      
       - Get rid of on-stack cpu masks.
      
       - Add support for complete CPU counter set extraction.
      
       - Add arch_irq_work_raise implementation.
      
       - virtio-ccw revision and opcode fixes.
      
      * tag 's390-5.12-2' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/cpumf: Add support for complete counter set extraction
        virtio/s390: implement virtio-ccw revision 2 correctly
        s390/smp: implement arch_irq_work_raise()
        s390/topology: move cpumasks away from stack
        s390/smp: smp_emergency_stop() - move cpumask away from stack
        s390/smp: __smp_rescan_cpus() - move cpumask away from stack
        s390/smp: consolidate locking for smp_rescan()
        s390/mm: fix phys vs virt confusion in vmem_*() functions family
        s390/mm: fix phys vs virt confusion in pgtable allocation routines
        s390/mm: fix invalid __pa() usage in pfn_pXd() macros
        s390/mm: make pXd_deref() macros return a pointer
        s390/opcodes: rename selhhhr to selfhr
      e7270e47
    • Linus Torvalds's avatar
      Merge tag '5.12-smb3-part1' of git://git.samba.org/sfrench/cifs-2.6 · c19798af
      Linus Torvalds authored
      Pull cifs updates from Steve French:
      
       - improvements to mode bit conversion, chmod and chown when using
         cifsacl mount option
      
       - two new mount options for controlling attribute caching
      
       - improvements to crediting and reconnect, improved debugging
      
       - reconnect fix
      
       - add SMB3.1.1 dialect to default dialects for vers=3
      
      * tag '5.12-smb3-part1' of git://git.samba.org/sfrench/cifs-2.6: (27 commits)
        cifs: update internal version number
        cifs: use discard iterator to discard unneeded network data more efficiently
        cifs: introduce helper for finding referral server to improve DFS target resolution
        cifs: check all path components in resolved dfs target
        cifs: fix DFS failover
        cifs: fix nodfs mount option
        cifs: fix handling of escaped ',' in the password mount argument
        cifs: Add new parameter "acregmax" for distinct file and directory metadata timeout
        cifs: convert revalidate of directories to using directory metadata cache timeout
        cifs: Add new mount parameter "acdirmax" to allow caching directory metadata
        cifs: If a corrupted DACL is returned by the server, bail out.
        cifs: minor simplification to smb2_is_network_name_deleted
        TCON Reconnect during STATUS_NETWORK_NAME_DELETED
        cifs: cleanup a few le16 vs. le32 uses in cifsacl.c
        cifs: Change SIDs in ACEs while transferring file ownership.
        cifs: Retain old ACEs when converting between mode bits and ACL.
        cifs: Fix cifsacl ACE mask for group and others.
        cifs: clarify hostname vs ip address in /proc/fs/cifs/DebugData
        cifs: change confusing field serverName (to ip_addr)
        cifs: Fix inconsistent IS_ERR and PTR_ERR
        ...
      c19798af
    • Linus Torvalds's avatar
      Merge tag 'for-5.12/io_uring-2021-02-25' of git://git.kernel.dk/linux-block · efba6d3a
      Linus Torvalds authored
      Pull more io_uring updates from Jens Axboe:
       "A collection of later fixes that we should get into this release:
      
         - Series of submission cleanups (Pavel)
      
         - A few fixes for issues from earlier this merge window (Pavel, me)
      
         - IOPOLL resubmission fix
      
         - task_work locking fix (Hao)"
      
      * tag 'for-5.12/io_uring-2021-02-25' of git://git.kernel.dk/linux-block: (25 commits)
        Revert "io_uring: wait potential ->release() on resurrect"
        io_uring: fix locked_free_list caches_free()
        io_uring: don't attempt IO reissue from the ring exit path
        io_uring: clear request count when freeing caches
        io_uring: run task_work on io_uring_register()
        io_uring: fix leaving invalid req->flags
        io_uring: wait potential ->release() on resurrect
        io_uring: keep generic rsrc infra generic
        io_uring: zero ref_node after killing it
        io_uring: make the !CONFIG_NET helpers a bit more robust
        io_uring: don't hold uring_lock when calling io_run_task_work*
        io_uring: fail io-wq submission from a task_work
        io_uring: don't take uring_lock during iowq cancel
        io_uring: fail links more in io_submit_sqe()
        io_uring: don't do async setup for links' heads
        io_uring: do io_*_prep() early in io_submit_sqe()
        io_uring: split sqe-prep and async setup
        io_uring: don't submit link on error
        io_uring: move req link into submit_state
        io_uring: move io_init_req() into io_submit_sqe()
        ...
      efba6d3a
    • Linus Torvalds's avatar
      Merge branch 'stable/for-linus-5.12' of... · ef9856a7
      Linus Torvalds authored
      Merge branch 'stable/for-linus-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb
      
      Pull swiotlb updates from Konrad Rzeszutek Wilk:
       "Two memory encryption related patches (SWIOTLB is enabled by default
        for AMD-SEV):
      
         - Add support for alignment so that NVME can properly work
      
         - Keep track of requested DMA buffers length, as underlaying hardware
           devices can trip SWIOTLB to bounce too much and crash the kernel
      
        And a tiny fix to use proper APIs in drivers"
      
      * 'stable/for-linus-5.12' of git://git.kernel.org/pub/scm/linux/kernel/git/konrad/swiotlb:
        swiotlb: Validate bounce size in the sync/unmap path
        nvme-pci: set min_align_mask
        swiotlb: respect min_align_mask
        swiotlb: don't modify orig_addr in swiotlb_tbl_sync_single
        swiotlb: refactor swiotlb_tbl_map_single
        swiotlb: clean up swiotlb_tbl_unmap_single
        swiotlb: factor out a nr_slots helper
        swiotlb: factor out an io_tlb_offset helper
        swiotlb: add a IO_TLB_SIZE define
        driver core: add a min_align_mask field to struct device_dma_parameters
        sdhci: stop poking into swiotlb internals
      ef9856a7