1. 08 Sep, 2022 1 commit
  2. 02 Sep, 2022 2 commits
    • Nathan Chancellor's avatar
      powerpc/papr_scm: Ensure rc is always initialized in papr_scm_pmu_register() · 6cf07810
      Nathan Chancellor authored
      Clang warns:
      
        arch/powerpc/platforms/pseries/papr_scm.c:492:6: warning: variable 'rc' is used uninitialized whenever 'if' condition is true [-Wsometimes-uninitialized]
                if (!p->stat_buffer_len)
                    ^~~~~~~~~~~~~~~~~~~
        arch/powerpc/platforms/pseries/papr_scm.c:523:64: note: uninitialized use occurs here
                dev_info(&p->pdev->dev, "nvdimm pmu didn't register rc=%d\n", rc);
                                                                              ^~
        include/linux/dev_printk.h:150:67: note: expanded from macro 'dev_info'
                dev_printk_index_wrap(_dev_info, KERN_INFO, dev, dev_fmt(fmt), ##__VA_ARGS__)
                                                                                ^~~~~~~~~~~
        include/linux/dev_printk.h:110:23: note: expanded from macro 'dev_printk_index_wrap'
                        _p_func(dev, fmt, ##__VA_ARGS__);                       \
                                            ^~~~~~~~~~~
        arch/powerpc/platforms/pseries/papr_scm.c:492:2: note: remove the 'if' if its condition is always false
                if (!p->stat_buffer_len)
                ^~~~~~~~~~~~~~~~~~~~~~~~
        arch/powerpc/platforms/pseries/papr_scm.c:484:8: note: initialize the variable 'rc' to silence this warning
                int rc, nodeid;
                      ^
                      = 0
        1 warning generated.
      
      The call to papr_scm_pmu_check_events() was eliminated but a return code
      was not added to the if statement. Add the same return code from
      papr_scm_pmu_check_events() for this condition so there is no more
      warning.
      
      Fixes: 9b1ac046 ("powerpc/papr_scm: Fix nvdimm event mappings")
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://github.com/ClangBuiltLinux/linux/issues/1701
      Link: https://lore.kernel.org/r/20220830151256.1473169-1-nathan@kernel.org
      6cf07810
    • Michael Ellerman's avatar
      Revert "powerpc/irq: Don't open code irq_soft_mask helpers" · 684c68d9
      Michael Ellerman authored
      This reverts commit ef5b570d.
      
      Zhouyi reported that commit is causing crashes when running rcutorture
      with KASAN enabled:
      
        BUG: using smp_processor_id() in preemptible [00000000] code: rcu_torture_rea/100
        caller is rcu_preempt_deferred_qs_irqrestore+0x74/0xed0
        CPU: 4 PID: 100 Comm: rcu_torture_rea Tainted: G        W          5.19.0-rc5-next-20220708-dirty #253
        Call Trace:
          dump_stack_lvl+0xbc/0x108 (unreliable)
          check_preemption_disabled+0x154/0x160
          rcu_preempt_deferred_qs_irqrestore+0x74/0xed0
          __rcu_read_unlock+0x290/0x3b0
          rcu_torture_read_unlock+0x30/0xb0
          rcutorture_one_extend+0x198/0x810
          rcu_torture_one_read+0x58c/0xc90
          rcu_torture_reader+0x12c/0x360
          kthread+0x1e8/0x220
          ret_from_kernel_thread+0x5c/0x64
      
      KASAN will generate instrumentation instructions around the
      WRITE_ONCE(local_paca->irq_soft_mask, mask):
      
         0xc000000000295cb0 <+0>:	addis   r2,r12,774
         0xc000000000295cb4 <+4>:	addi    r2,r2,16464
         0xc000000000295cb8 <+8>:	mflr    r0
         0xc000000000295cbc <+12>:	bl      0xc00000000008bb4c <mcount>
         0xc000000000295cc0 <+16>:	mflr    r0
         0xc000000000295cc4 <+20>:	std     r31,-8(r1)
         0xc000000000295cc8 <+24>:	addi    r3,r13,2354
         0xc000000000295ccc <+28>:	mr      r31,r13
         0xc000000000295cd0 <+32>:	std     r0,16(r1)
         0xc000000000295cd4 <+36>:	stdu    r1,-48(r1)
         0xc000000000295cd8 <+40>:	bl      0xc000000000609b98 <__asan_store1+8>
         0xc000000000295cdc <+44>:	nop
         0xc000000000295ce0 <+48>:	li      r9,1
         0xc000000000295ce4 <+52>:	stb     r9,2354(r31)
         0xc000000000295ce8 <+56>:	addi    r1,r1,48
         0xc000000000295cec <+60>:	ld      r0,16(r1)
         0xc000000000295cf0 <+64>:	ld      r31,-8(r1)
         0xc000000000295cf4 <+68>:	mtlr    r0
      
      If there is a context switch before "stb     r9,2354(r31)", r31 may
      not equal to r13, in such case, irq soft mask will not work.
      
      The usual solution of marking the code ineligible for instrumentation
      forces the code out-of-line, which we would prefer to avoid. Christophe
      proposed a partial revert, but Nick raised some concerns with that. So
      for now do a full revert.
      Reported-by: default avatarZhouyi Zhou <zhouzhouyi@gmail.com>
      [mpe: Construct change log based on Zhouyi's original report]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220831131052.42250-1-mpe@ellerman.id.au
      684c68d9
  3. 31 Aug, 2022 1 commit
  4. 25 Aug, 2022 4 commits
    • Michael Ellerman's avatar
      powerpc/rtas: Fix RTAS MSR[HV] handling for Cell · 91926d8b
      Michael Ellerman authored
      The semi-recent changes to MSR handling when entering RTAS (firmware)
      cause crashes on IBM Cell machines. An example trace:
      
        kernel tried to execute user page (2fff01a8) - exploit attempt? (uid: 0)
        BUG: Unable to handle kernel instruction fetch
        Faulting instruction address: 0x2fff01a8
        Oops: Kernel access of bad area, sig: 11 [#1]
        BE PAGE_SIZE=64K MMU=Hash SMP NR_CPUS=4 NUMA Cell
        Modules linked in:
        CPU: 0 PID: 0 Comm: swapper/0 Tainted: G        W          6.0.0-rc2-00433-gede0a8d3307a #207
        NIP:  000000002fff01a8 LR: 0000000000032608 CTR: 0000000000000000
        REGS: c0000000015236b0 TRAP: 0400   Tainted: G        W           (6.0.0-rc2-00433-gede0a8d3307a)
        MSR:  0000000008001002 <ME,RI>  CR: 00000000  XER: 20000000
        ...
        NIP 0x2fff01a8
        LR  0x32608
        Call Trace:
          0xc00000000143c5f8 (unreliable)
          .rtas_call+0x224/0x320
          .rtas_get_boot_time+0x70/0x150
          .read_persistent_clock64+0x114/0x140
          .read_persistent_wall_and_boot_offset+0x24/0x80
          .timekeeping_init+0x40/0x29c
          .start_kernel+0x674/0x8f0
          start_here_common+0x1c/0x50
      
      Unlike PAPR platforms where RTAS is only used in guests, on the IBM Cell
      machines Linux runs with MSR[HV] set but also uses RTAS, provided by
      SLOF.
      
      Fix it by copying the MSR[HV] bit from the MSR value we've just read
      using mfmsr into the value used for RTAS.
      
      It seems like we could also fix it using an #ifdef CELL to set MSR[HV],
      but that doesn't work because it's possible to build a single kernel
      image that runs on both Cell native and pseries.
      
      Fixes: b6b1c3ce ("powerpc/rtas: Keep MSR[RI] set when calling RTAS")
      Cc: stable@vger.kernel.org # v5.19+
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Reviewed-by: default avatarJordan Niethe <jniethe5@gmail.com>
      Link: https://lore.kernel.org/r/20220823115952.1203106-2-mpe@ellerman.id.au
      91926d8b
    • Michael Ellerman's avatar
      Revert "powerpc: Remove unused FW_FEATURE_NATIVE references" · 310d1344
      Michael Ellerman authored
      This reverts commit 79b74a68.
      
      It broke booting on IBM Cell machines when the kernel is also built with
      CONFIG_PPC_PS3=y.
      
      That's because FW_FEATURE_NATIVE_ALWAYS = 0 does have an important
      effect, which is to clear the PS3 ALWAYS features from
      FW_FEATURE_ALWAYS.
      
      Note that CONFIG_PPC_NATIVE has since been renamed
      CONFIG_PPC_HASH_MMU_NATIVE.
      
      Fixes: 79b74a68 ("powerpc: Remove unused FW_FEATURE_NATIVE references")
      Cc: stable@vger.kernel.org # v5.17+
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220823115952.1203106-1-mpe@ellerman.id.au
      310d1344
    • Masahiro Yamada's avatar
      powerpc: align syscall table for ppc32 · c7acee3d
      Masahiro Yamada authored
      Christophe Leroy reported that commit 7b453719 ("kbuild: link
      symbol CRCs at final link,  removing CONFIG_MODULE_REL_CRCS") broke
      mpc85xx_defconfig + CONFIG_RELOCATABLE=y.
      
          LD      vmlinux
          SYSMAP  System.map
          SORTTAB vmlinux
          CHKREL  vmlinux
        WARNING: 451 bad relocations
        c0b312a9 R_PPC_UADDR32     .head.text-0x3ff9ed54
        c0b312ad R_PPC_UADDR32     .head.text-0x3ffac224
        c0b312b1 R_PPC_UADDR32     .head.text-0x3ffb09f4
        c0b312b5 R_PPC_UADDR32     .head.text-0x3fe184dc
        c0b312b9 R_PPC_UADDR32     .head.text-0x3fe183a8
            ...
      
      The compiler emits a bunch of R_PPC_UADDR32, which is not supported by
      arch/powerpc/kernel/reloc_32.S.
      
      The reason is there exists an unaligned symbol.
      
        $ powerpc-linux-gnu-nm -n vmlinux
          ...
        c0b31258 d spe_aligninfo
        c0b31298 d __func__.0
        c0b312a9 D sys_call_table
        c0b319b8 d __func__.0
      
      Commit 7b453719 is not the root cause. Even before that, I can
      reproduce the same issue for mpc85xx_defconfig + CONFIG_RELOCATABLE=y
      + CONFIG_MODVERSIONS=n.
      
      It is just that nobody noticed because when CONFIG_MODVERSIONS is
      enabled, a __crc_* symbol inserted before sys_call_table was hiding the
      unalignment issue.
      
      Adding alignment to the syscall table for ppc32 fixes the issue.
      
      Cc: stable@vger.kernel.org
      Reported-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      [mpe: Trim change log discussion, add Cc stable]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/lkml/38605f6a-a568-f884-f06f-ea4da5b214f0@csgroup.eu/
      Link: https://lore.kernel.org/r/20220820165129.1147589-1-masahiroy@kernel.org
      c7acee3d
    • Pali Rohár's avatar
      powerpc/pci: Enable PCI domains in /proc when PCI bus numbers are not unique · 0382a35b
      Pali Rohár authored
      On 32-bit powerpc systems with more PCIe controllers and more PCI
      domains, where on more PCI domains are same PCI numbers, when kernel is
      compiled with CONFIG_PROC_FS=y and
      CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT=y options, kernel prints
      "proc_dir_entry 'pci/01' already registered" error message.
      
        proc_dir_entry 'pci/01' already registered
        WARNING: CPU: 0 PID: 1 at fs/proc/generic.c:377 proc_register+0x1a8/0x1ac
        ...
        NIP proc_register+0x1a8/0x1ac
        LR  proc_register+0x1a8/0x1ac
        Call Trace:
          proc_register+0x1a8/0x1ac (unreliable)
          _proc_mkdir+0x78/0xa4
          pci_proc_attach_device+0x11c/0x168
          pci_proc_init+0x80/0x98
          do_one_initcall+0x80/0x284
          kernel_init_freeable+0x1f4/0x2a0
          kernel_init+0x24/0x150
          ret_from_kernel_thread+0x5c/0x64
      
      This regression started appearing after commit
      56635681 ("powerpc/pci: Add config option for using all 256 PCI
      buses") in case in each mPCIe slot is connected PCIe card and therefore
      PCI bus 1 is populated in for every PCIe controller / PCI domain.
      
      The reason is that PCI procfs code expects that when PCI bus numbers are
      not unique across all PCI domains, function pci_proc_domain() returns
      true for domain dependent buses.
      
      Fix this issue by setting PCI_ENABLE_PROC_DOMAINS and
      PCI_COMPAT_DOMAIN_0 flags for 32-bit powerpc code when
      CONFIG_PPC_PCI_BUS_NUM_DOMAIN_DEPENDENT is enabled. Same approach is
      already implemented for 64-bit powerpc code (where PCI bus numbers are
      always domain dependent).
      
      Fixes: 56635681 ("powerpc/pci: Add config option for using all 256 PCI buses")
      Signed-off-by: default avatarPali Rohár <pali@kernel.org>
      [mpe: Trim change log oops message]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220820115113.30581-1-pali@kernel.org
      0382a35b
  5. 23 Aug, 2022 1 commit
    • Kajol Jain's avatar
      powerpc/papr_scm: Fix nvdimm event mappings · 9b1ac046
      Kajol Jain authored
      Commit 4c08d4bb ("powerpc/papr_scm: Add perf interface support")
      added performance monitoring support for papr-scm nvdimm devices via
      perf interface. Commit also added an array in papr_scm_priv
      structure called "nvdimm_events_map", which got filled based on the
      result of H_SCM_PERFORMANCE_STATS hcall.
      
      Currently there is an assumption that the order of events in the
      stats buffer, returned by the hypervisor is same. And order also
      happens to matches with the events specified in nvdimm driver code.
      But this assumption is not documented in Power Architecture
      Platform Requirements (PAPR) document. Although the order
      of events happens to be same on current generation od system, but
      it might not be true in future generation systems. Fix the issue, by
      adding a static mapping for nvdimm events to corresponding stat-id,
      and removing the dynamic map from papr_scm_priv structure. Also
      remove the function papr_scm_pmu_check_events from papr_scm.c file,
      as we no longer need to copy stat-ids dynamically.
      
      Fixes: 4c08d4bb ("powerpc/papr_scm: Add perf interface support")
      Reported-by: default avatarAneesh Kumar K.V <aneesh.kumar@linux.ibm.com>
      Signed-off-by: default avatarKajol Jain <kjain@linux.ibm.com>
      Reviewed-by: default avatarVaibhav Jain <vaibhav@linux.ibm.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20220804074852.55157-1-kjain@linux.ibm.com
      9b1ac046
  6. 22 Aug, 2022 1 commit
  7. 21 Aug, 2022 17 commits
  8. 20 Aug, 2022 13 commits
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v6.0' of... · 15b3f48a
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Fix module versioning broken on some architectures
      
       - Make dummy-tools enable CONFIG_PPC_LONG_DOUBLE_128
      
       - Remove -Wformat-zero-length, which has no warning instance
      
       - Fix the order between drivers and libs in modules.order
      
       - Fix false-positive warnings in clang-analyzer
      
      * tag 'kbuild-fixes-v6.0' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        scripts/clang-tools: Remove DeprecatedOrUnsafeBufferHandling check
        kbuild: fix the modules order between drivers and libs
        scripts/Makefile.extrawarn: Do not disable clang's -Wformat-zero-length
        kbuild: dummy-tools: pretend we understand __LONG_DOUBLE_128__
        modpost: fix module versioning when a symbol lacks valid CRC
      15b3f48a
    • Linus Torvalds's avatar
      Merge tag 'perf-tools-fixes-for-v6.0-2022-08-19' of... · 16b3d851
      Linus Torvalds authored
      Merge tag 'perf-tools-fixes-for-v6.0-2022-08-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux
      
      Pull perf tools fixes from Arnaldo Carvalho de Melo:
      
       - Fix alignment for cpu map masks in event encoding.
      
       - Support reading PERF_FORMAT_LOST, perf tool counterpart for a feature
         that was added in this merge window.
      
       - Sync perf tools copies of kernel headers: socket, msr-index, fscrypt,
         cpufeatures, i915_drm, kvm, vhost, perf_event.
      
      * tag 'perf-tools-fixes-for-v6.0-2022-08-19' of git://git.kernel.org/pub/scm/linux/kernel/git/acme/linux:
        perf tools: Support reading PERF_FORMAT_LOST
        libperf: Add a test case for read formats
        libperf: Handle read format in perf_evsel__read()
        tools headers UAPI: Sync linux/perf_event.h with the kernel sources
        tools headers UAPI: Sync x86's asm/kvm.h with the kernel sources
        tools headers UAPI: Sync KVM's vmx.h header with the kernel sources
        tools include UAPI: Sync linux/vhost.h with the kernel sources
        tools headers kvm s390: Sync headers with the kernel sources
        tools headers UAPI: Sync linux/kvm.h with the kernel sources
        tools headers UAPI: Sync drm/i915_drm.h with the kernel sources
        tools headers cpufeatures: Sync with the kernel sources
        tools headers UAPI: Sync linux/fscrypt.h with the kernel sources
        tools arch x86: Sync the msr-index.h copy with the kernel sources
        perf beauty: Update copy of linux/socket.h with the kernel sources
        perf cpumap: Fix alignment for masks in event encoding
        perf cpumap: Compute mask size in constant time
        perf cpumap: Synthetic events and const/static
        perf cpumap: Const map for max()
      16b3d851
    • Linus Torvalds's avatar
      Merge tag 's390-6.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · cc1807b9
      Linus Torvalds authored
      Pull s390 updates from Alexander Gordeev:
      
       - Fix a KVM crash on z12 and older machines caused by a wrong
         assumption that Query AP Configuration Information is always
         available.
      
       - Lower severity of excessive Hypervisor filesystem error messages
         when booting under KVM.
      
      * tag 's390-6.0-1' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/ap: fix crash on older machines based on QCI info missing
        s390/hypfs: avoid error message under KVM
      cc1807b9
    • Linus Torvalds's avatar
      Merge tag 'powerpc-6.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · 32dd68f1
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - Fix atomic sleep warnings at boot due to get_phb_number() taking a
         mutex with a spinlock held on some machines.
      
       - Add missing PMU selftests to .gitignores.
      
      Thanks to Guenter Roeck and Russell Currey.
      
      * tag 'powerpc-6.0-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        selftests/powerpc: Add missing PMU selftests to .gitignores
        powerpc/pci: Fix get_phb_number() locking
      32dd68f1
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma · f31c32ef
      Linus Torvalds authored
      Pull rdma fixes from Jason Gunthorpe:
       "A few minor fixes:
      
         - Fix buffer management in SRP to correct a regression with the login
           authentication feature from v5.17
      
         - Don't iterate over non-present ports in mlx5
      
         - Fix an error introduced by the foritify work in cxgb4
      
         - Two bug fixes for the recently merged ERDMA driver
      
         - Unbreak RDMA dmabuf support, a regresion from v5.19"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/rdma/rdma:
        RDMA: Handle the return code from dma_resv_wait_timeout() properly
        RDMA/erdma: Correct the max_qp and max_cq capacities of the device
        RDMA/erdma: Using the key in FMR WR instead of MR structure
        RDMA/cxgb4: fix accept failure due to increased cpl_t5_pass_accept_rpl size
        RDMA/mlx5: Use the proper number of ports
        IB/iser: Fix login with authentication
      f31c32ef
    • Guru Das Srinagesh's avatar
      scripts/clang-tools: Remove DeprecatedOrUnsafeBufferHandling check · 4be72c1b
      Guru Das Srinagesh authored
      This `clang-analyzer` check flags the use of memset(), suggesting a more
      secure version of the API, such as memset_s(), which does not exist in
      the kernel:
      
        warning: Call to function 'memset' is insecure as it does not provide
        security checks introduced in the C11 standard. Replace with analogous
        functions that support length arguments or provides boundary checks such
        as 'memset_s' in case of C11
        [clang-analyzer-security.insecureAPI.DeprecatedOrUnsafeBufferHandling]
      Signed-off-by: default avatarGuru Das Srinagesh <quic_gurus@quicinc.com>
      Reviewed-by: default avatarNick Desaulniers <ndesaulniers@google.com>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      4be72c1b
    • Masahiro Yamada's avatar
      kbuild: fix the modules order between drivers and libs · 11314751
      Masahiro Yamada authored
      Commit b2c88554 ("kbuild: update modules.order only when contained
      modules are updated") accidentally changed the modules order.
      
      Prior to that commit, the modules order was determined based on
      vmlinux-dirs, which lists core-y/m, drivers-y/m, libs-y/m, in this order.
      
      Now, subdir-modorder lists them in a different order: core-y/m, libs-y/m,
      drivers-y/m.
      
      Presumably, there was no practical issue because the modules in drivers
      and libs are orthogonal, but there is no reason to have this distortion.
      
      Get back to the original order.
      
      Fixes: b2c88554 ("kbuild: update modules.order only when contained modules are updated")
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      11314751
    • Nathan Chancellor's avatar
      scripts/Makefile.extrawarn: Do not disable clang's -Wformat-zero-length · 370655bc
      Nathan Chancellor authored
      There are no instances of this warning in the tree across several
      difference architectures and configurations. This was added by
      commit 26ea6bb1 ("kbuild, LLVMLinux: Supress warnings unless W=1-3")
      back in 2014, where it might have been necessary, but there are no
      instances of it now so stop disabling it to increase warning coverage
      for clang.
      Signed-off-by: default avatarNathan Chancellor <nathan@kernel.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      370655bc
    • Jiri Slaby's avatar
      kbuild: dummy-tools: pretend we understand __LONG_DOUBLE_128__ · 0df499ea
      Jiri Slaby authored
      There is a test in powerpc's Kconfig which checks __LONG_DOUBLE_128__
      and sets CONFIG_PPC_LONG_DOUBLE_128 if it is understood by the compiler.
      
      We currently don't handle it, so this results in PPC_LONG_DOUBLE_128 not
      being in super-config generated by dummy-tools. So take this into
      account in the gcc script and preprocess __LONG_DOUBLE_128__ as "1".
      Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      0df499ea
    • Masahiro Yamada's avatar
      modpost: fix module versioning when a symbol lacks valid CRC · 5b8a9a8f
      Masahiro Yamada authored
      Since commit 7b453719 ("kbuild: link symbol CRCs at final link,
      removing CONFIG_MODULE_REL_CRCS"), module versioning is broken on
      some architectures. Loading a module fails with "disagrees about
      version of symbol module_layout".
      
      On such architectures (e.g. ARCH=sparc build with sparc64_defconfig),
      modpost shows a warning, like follows:
      
        WARNING: modpost: EXPORT symbol "_mcount" [vmlinux] version generation failed, symbol will not be versioned.
        Is "_mcount" prototyped in <asm/asm-prototypes.h>?
      
      Previously, it was a harmless warning (CRC check was just skipped),
      but now wrong CRCs are used for comparison because invalid CRCs are
      just skipped.
      
        $ sparc64-linux-gnu-nm -n vmlinux
          [snip]
        0000000000c2cea0 r __ksymtab__kstrtol
        0000000000c2ceb8 r __ksymtab__kstrtoul
        0000000000c2ced0 r __ksymtab__local_bh_enable
        0000000000c2cee8 r __ksymtab__mcount
        0000000000c2cf00 r __ksymtab__printk
        0000000000c2cf18 r __ksymtab__raw_read_lock
        0000000000c2cf30 r __ksymtab__raw_read_lock_bh
          [snip]
        0000000000c53b34 D __crc__kstrtol
        0000000000c53b38 D __crc__kstrtoul
        0000000000c53b3c D __crc__local_bh_enable
        0000000000c53b40 D __crc__printk
        0000000000c53b44 D __crc__raw_read_lock
        0000000000c53b48 D __crc__raw_read_lock_bh
      
      Please notice __crc__mcount is missing here.
      
      When the module subsystem looks up a CRC that comes after, it results
      in reading out a wrong address. For example, when __crc__printk is
      needed, the module subsystem reads 0xc53b44 instead of 0xc53b40.
      
      All CRC entries must be output for correct index accessing. Invalid
      CRCs will be unused, but are needed to keep the one-to-one mapping
      between __ksymtab_* and __crc_*.
      
      The best is to fix all modpost warnings, but several warnings are still
      remaining on less popular architectures.
      
      Fixes: 7b453719 ("kbuild: link symbol CRCs at final link, removing CONFIG_MODULE_REL_CRCS")
      Reported-by: default avatarmatoro <matoro_mailinglist_kernel@matoro.tk>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      Tested-by: default avatarmatoro <matoro_mailinglist_kernel@matoro.tk>
      5b8a9a8f
    • Linus Torvalds's avatar
      Merge tag 'block-6.0-2022-08-19' of git://git.kernel.dk/linux-block · b9bce6e5
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
       "A few fixes that should go into this release:
      
         - Small series of patches for ublk (ZiyangZhang)
      
         - Remove dead function (Yu)
      
         - Fix for running a block queue in case of resource starvation
           (Yufen)"
      
      * tag 'block-6.0-2022-08-19' of git://git.kernel.dk/linux-block:
        blk-mq: run queue no matter whether the request is the last request
        blk-mq: remove unused function blk_mq_queue_stopped()
        ublk_drv: do not add a re-issued request aborted previously to ioucmd's task_work
        ublk_drv: update comment for __ublk_fail_req()
        ublk_drv: check ubq_daemon_is_dying() in __ublk_rq_task_work()
        ublk_drv: update iod->addr for UBLK_IO_NEED_GET_DATA
      b9bce6e5
    • Linus Torvalds's avatar
      Merge tag 'io_uring-6.0-2022-08-19' of git://git.kernel.dk/linux-block · beaf1397
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A few fixes for regressions in this cycle:
      
         - Two instances of using the wrong "has async data" helper (Pavel)
      
         - Fixup zero-copy address import (Pavel)
      
         - Bump zero-copy notification slot limit (Pavel)"
      
      * tag 'io_uring-6.0-2022-08-19' of git://git.kernel.dk/linux-block:
        io_uring/net: use right helpers for async_data
        io_uring/notif: raise limit on notification slots
        io_uring/net: improve zc addr import error handling
        io_uring/net: use right helpers for async recycle
      beaf1397
    • Linus Torvalds's avatar
      Merge tag 'ata-6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata · 044610f8
      Linus Torvalds authored
      Pull ATA fixes from Damien Le Moal:
      
       - Add a missing command name definition for ata_get_cmd_name(), from
         me.
      
       - A fix to address a performance regression due to the default
         max_sectors queue limit for ATA devices connected to AHCI adapters
         being too small, from John.
      
      * tag 'ata-6.0-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
        ata: libata: Set __ATA_BASE_SHT max_sectors
        ata: libata-eh: Add missing command name
      044610f8