1. 03 6月, 2021 1 次提交
  2. 01 6月, 2021 1 次提交
    • B
      x86/thermal: Fix LVT thermal setup for SMI delivery mode · 9a90ed06
      Borislav Petkov 提交于
      There are machines out there with added value crap^WBIOS which provide an
      SMI handler for the local APIC thermal sensor interrupt. Out of reset,
      the BSP on those machines has something like 0x200 in that APIC register
      (timestamps left in because this whole issue is timing sensitive):
      
        [    0.033858] read lvtthmr: 0x330, val: 0x200
      
      which means:
      
       - bit 16 - the interrupt mask bit is clear and thus that interrupt is enabled
       - bits [10:8] have 010b which means SMI delivery mode.
      
      Now, later during boot, when the kernel programs the local APIC, it
      soft-disables it temporarily through the spurious vector register:
      
        setup_local_APIC:
      
        	...
      
      	/*
      	 * If this comes from kexec/kcrash the APIC might be enabled in
      	 * SPIV. Soft disable it before doing further initialization.
      	 */
      	value = apic_read(APIC_SPIV);
      	value &= ~APIC_SPIV_APIC_ENABLED;
      	apic_write(APIC_SPIV, value);
      
      which means (from the SDM):
      
      "10.4.7.2 Local APIC State After It Has Been Software Disabled
      
      ...
      
      * The mask bits for all the LVT entries are set. Attempts to reset these
      bits will be ignored."
      
      And this happens too:
      
        [    0.124111] APIC: Switch to symmetric I/O mode setup
        [    0.124117] lvtthmr 0x200 before write 0xf to APIC 0xf0
        [    0.124118] lvtthmr 0x10200 after write 0xf to APIC 0xf0
      
      This results in CPU 0 soft lockups depending on the placement in time
      when the APIC soft-disable happens. Those soft lockups are not 100%
      reproducible and the reason for that can only be speculated as no one
      tells you what SMM does. Likely, it confuses the SMM code that the APIC
      is disabled and the thermal interrupt doesn't doesn't fire at all,
      leading to CPU 0 stuck in SMM forever...
      
      Now, before
      
        4f432e8b ("x86/mce: Get rid of mcheck_intel_therm_init()")
      
      due to how the APIC_LVTTHMR was read before APIC initialization in
      mcheck_intel_therm_init(), it would read the value with the mask bit 16
      clear and then intel_init_thermal() would replicate it onto the APs and
      all would be peachy - the thermal interrupt would remain enabled.
      
      But that commit moved that reading to a later moment in
      intel_init_thermal(), resulting in reading APIC_LVTTHMR on the BSP too
      late and with its interrupt mask bit set.
      
      Thus, revert back to the old behavior of reading the thermal LVT
      register before the APIC gets initialized.
      
      Fixes: 4f432e8b ("x86/mce: Get rid of mcheck_intel_therm_init()")
      Reported-by: NJames Feeney <james@nurealm.net>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: <stable@vger.kernel.org>
      Cc: Zhang Rui <rui.zhang@intel.com>
      Cc: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com>
      Link: https://lkml.kernel.org/r/YKIqDdFNaXYd39wz@zn.tnic
      9a90ed06
  3. 29 5月, 2021 1 次提交
    • T
      x86/apic: Mark _all_ legacy interrupts when IO/APIC is missing · 7d65f9e8
      Thomas Gleixner 提交于
      PIC interrupts do not support affinity setting and they can end up on
      any online CPU. Therefore, it's required to mark the associated vectors
      as system-wide reserved. Otherwise, the corresponding irq descriptors
      are copied to the secondary CPUs but the vectors are not marked as
      assigned or reserved. This works correctly for the IO/APIC case.
      
      When the IO/APIC is disabled via config, kernel command line or lack of
      enumeration then all legacy interrupts are routed through the PIC, but
      nothing marks them as system-wide reserved vectors.
      
      As a consequence, a subsequent allocation on a secondary CPU can result in
      allocating one of these vectors, which triggers the BUG() in
      apic_update_vector() because the interrupt descriptor slot is not empty.
      
      Imran tried to work around that by marking those interrupts as allocated
      when a CPU comes online. But that's wrong in case that the IO/APIC is
      available and one of the legacy interrupts, e.g. IRQ0, has been switched to
      PIC mode because then marking them as allocated will fail as they are
      already marked as system vectors.
      
      Stay consistent and update the legacy vectors after attempting IO/APIC
      initialization and mark them as system vectors in case that no IO/APIC is
      available.
      
      Fixes: 69cde000 ("x86/vector: Use matrix allocator for vector assignment")
      Reported-by: NImran Khan <imran.f.khan@oracle.com>
      Signed-off-by: NThomas Gleixner <tglx@linutronix.de>
      Signed-off-by: NBorislav Petkov <bp@suse.de>
      Cc: stable@vger.kernel.org
      Link: https://lkml.kernel.org/r/20210519233928.2157496-1-imran.f.khan@oracle.com
      7d65f9e8
  4. 24 5月, 2021 6 次提交
  5. 23 5月, 2021 15 次提交
  6. 22 5月, 2021 9 次提交
    • L
      Merge tag 'xfs-5.13-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · a3969ef4
      Linus Torvalds 提交于
      Pull xfs fixes from Darrick Wong:
      
       - Fix some math errors in the realtime allocator when extent size hints
         are applied.
      
       - Fix unnecessary short writes to realtime files when free space is
         fragmented.
      
       - Fix a crash when using scrub tracepoints.
      
       - Restore ioctl uapi definitions that were accidentally removed in
         5.13-rc1.
      
      * tag 'xfs-5.13-fixes-1' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: restore old ioctl definitions
        xfs: fix deadlock retry tracepoint arguments
        xfs: retry allocations when locality-based search fails
        xfs: adjust rt allocation minlen when extszhint > rtextsize
      a3969ef4
    • L
      Merge tag 'for-5.13-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux · 45af60e7
      Linus Torvalds 提交于
      Pull btrfs fixes from David Sterba:
       "A few more fixes:
      
         - fix unaligned compressed writes in zoned mode
      
         - fix false positive lockdep warning when cloning inline extent
      
         - remove wrong BUG_ON in tree-log error handling"
      
      * tag 'for-5.13-rc2-tag' of git://git.kernel.org/pub/scm/linux/kernel/git/kdave/linux:
        btrfs: zoned: fix parallel compressed writes
        btrfs: zoned: pass start block to btrfs_use_zone_append
        btrfs: do not BUG_ON in link_to_fixup_dir
        btrfs: release path before starting transaction when cloning inline extent
      45af60e7
    • L
      Merge tag '5.13-rc3-smb3' of git://git.samba.org/sfrench/cifs-2.6 · 8bb14ca1
      Linus Torvalds 提交于
      Pull cifs fixes from Steve French:
       "Seven smb3 fixes: one for stable, three others fix problems found in
        testing handle leases, and a compounded request fix"
      
      * tag '5.13-rc3-smb3' of git://git.samba.org/sfrench/cifs-2.6:
        Fix KASAN identified use-after-free issue.
        Defer close only when lease is enabled.
        Fix kernel oops when CONFIG_DEBUG_ATOMIC_SLEEP is enabled.
        cifs: Fix inconsistent indenting
        cifs: fix memory leak in smb2_copychunk_range
        SMB3: incorrect file id in requests compounded with open
        cifs: remove deadstore in cifs_close_all_deferred_files()
      8bb14ca1
    • L
      Merge tag 'gpio-fixes-for-v5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux · e8085a07
      Linus Torvalds 提交于
      Pull gpio fixes from Bartosz Golaszewski:
      
       - add missing MODULE_DEVICE_TABLE in gpio-cadence
      
       - fix a kernel doc validator error in gpio-xilinx
      
       - don't set parent IRQ affinity in gpio-tegra186
      
      * tag 'gpio-fixes-for-v5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/brgl/linux:
        gpio: tegra186: Don't set parent IRQ affinity
        gpio: xilinx: Correct kernel doc for xgpio_probe()
        gpio: cadence: Add missing MODULE_DEVICE_TABLE
      e8085a07
    • L
      Merge tag 'mmc-v5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc · 011ff616
      Linus Torvalds 提交于
      Pull MMC host fixes from Ulf Hansson:
      
       - Fix SD-card detection on Intel NUC10i3FNK4 (GL9755)
      
       - Replace WARN_ONCE with dev_warn_once for scatterlist offsets
      
       - Extend check of scatterlist size alignment with SD_IO_RW_EXTENDED
      
      * tag 'mmc-v5.13-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/ulfh/mmc:
        mmc: sdhci-pci-gli: increase 1.8V regulator wait
        mmc: meson-gx: also check SD_IO_RW_EXTENDED for scatterlist size alignment
        mmc: meson-gx: make replace WARN_ONCE with dev_warn_once about scatterlist offset alignment
      011ff616
    • L
      Merge tag 'devicetree-fixes-for-5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux · 5328bf8b
      Linus Torvalds 提交于
      Pull devicetree fixes from Rob Herring:
      
       - Another batch of removing unneeded type references in schemas
      
       - Fix some out of date filename references
      
       - Convert renesas,drif schema to use DT graph schema
      
      * tag 'devicetree-fixes-for-5.13-2' of git://git.kernel.org/pub/scm/linux/kernel/git/robh/linux:
        dt-bindings: More removals of type references on common properties
        dt-bindings: media: renesas,drif: Use graph schema
        leds: Fix reference file name of documentation
        dt-bindings: phy: cadence-torrent: update reference file of docs
      5328bf8b
    • L
      Merge branch 'for-v5.13-rc3' of... · a0e31f3a
      Linus Torvalds 提交于
      Merge branch 'for-v5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
      
      Pull siginfo fix from Eric Biederman:
       "During the merge window an issue with si_perf and the siginfo ABI came
        up. The alpha and sparc siginfo structure layout had changed with the
        addition of SIGTRAP TRAP_PERF and the new field si_perf.
      
        The reason only alpha and sparc were affected is that they are the
        only architectures that use si_trapno.
      
        Looking deeper it was discovered that si_trapno is used for only a few
        select signals on alpha and sparc, and that none of the other
        _sigfault fields past si_addr are used at all. Which means technically
        no regression on alpha and sparc.
      
        While the alignment concerns might be dismissed the abuse of si_errno
        by SIGTRAP TRAP_PERF does have the potential to cause regressions in
        existing userspace.
      
        While we still have time before userspace starts using and depending
        on the new definition siginfo for SIGTRAP TRAP_PERF this set of
        changes cleans up siginfo_t.
      
         - The si_trapno field is demoted from magic alpha and sparc status
           and made an ordinary union member of the _sigfault member of
           siginfo_t. Without moving it of course.
      
         - si_perf is replaced with si_perf_data and si_perf_type ending the
           abuse of si_errno.
      
         - Unnecessary additions to signalfd_siginfo are removed"
      
      * 'for-v5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        signalfd: Remove SIL_PERF_EVENT fields from signalfd_siginfo
        signal: Deliver all of the siginfo perf data in _perf
        signal: Factor force_sig_perf out of perf_sigtrap
        signal: Implement SIL_FAULT_TRAPNO
        siginfo: Move si_trapno inside the union inside _si_fault
      a0e31f3a
    • L
      Merge tag 'modules-for-v5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux · c1f47ebc
      Linus Torvalds 提交于
      Pull module fix from Jessica Yu:
       "When CONFIG_MODULE_UNLOAD=n, module exit sections get sorted into the
        init region of the module in order to satisfy the requirements of
        jump_labels and static_calls.
      
        Previously, the exit section check was done in module_init_section(),
        but the solution there is not completely arch-indepedent as ARM is a
        special case and supplies its own module_init_section() function.
      
        Instead of pushing this logic further to the arch-specific code,
        switch to an arch-independent solution to check for module exit
        sections in the core module loader code in layout_sections() instead"
      
      * tag 'modules-for-v5.13-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/jeyu/linux:
        module: check for exit sections in layout_sections() instead of module_init_section()
      c1f47ebc
    • L
      Merge tag 'for-linus' of git://github.com/openrisc/linux · 93bb533a
      Linus Torvalds 提交于
      Pull OpenRISC fixes from Stafford Horne:
       "A few fixes that came in around the time of the merge window"
      
      * tag 'for-linus' of git://github.com/openrisc/linux:
        openrisc: Define memory barrier mb
        openrisc: mm/init.c: remove unused variable 'end' in paging_init()
        openrisc: mm/init.c: remove unused memblock_region variable in map_ram()
        openrisc: Fix a memory leak
      93bb533a
  7. 21 5月, 2021 7 次提交