1. 05 Nov, 2020 2 commits
  2. 04 Nov, 2020 1 commit
    • Michael Ellerman's avatar
      powerpc: Use asm_goto_volatile for put_user() · 1344a232
      Michael Ellerman authored
      Andreas reported that commit ee0a49a6 ("powerpc/uaccess: Switch
      __put_user_size_allowed() to __put_user_asm_goto()") broke
      CLONE_CHILD_SETTID.
      
      Further inspection showed that the put_user() in schedule_tail() was
      missing entirely, the store not emitted by the compiler.
      
        <.schedule_tail>:
          mflr    r0
          std     r0,16(r1)
          stdu    r1,-112(r1)
          bl      <.finish_task_switch>
          ld      r9,2496(r3)
          cmpdi   cr7,r9,0
          bne     cr7,<.schedule_tail+0x60>
          ld      r3,392(r13)
          ld      r9,1392(r3)
          cmpdi   cr7,r9,0
          beq     cr7,<.schedule_tail+0x3c>
          li      r4,0
          li      r5,0
          bl      <.__task_pid_nr_ns>
          nop
          bl      <.calculate_sigpending>
          nop
          addi    r1,r1,112
          ld      r0,16(r1)
          mtlr    r0
          blr
          nop
          nop
          nop
          bl      <.__balance_callback>
          b       <.schedule_tail+0x1c>
      
      Notice there are no stores other than to the stack. There should be a
      stw in there for the store to current->set_child_tid.
      
      This is only seen with GCC 4.9 era compilers (tested with 4.9.3 and
      4.9.4), and only when CONFIG_PPC_KUAP is disabled.
      
      When CONFIG_PPC_KUAP=y, the inline asm that's part of the isync()
      and mtspr() inlined via allow_user_access() seems to be enough to
      avoid the bug.
      
      We already have a macro to work around this (or a similar bug), called
      asm_volatile_goto which includes an empty asm block to tickle the
      compiler into generating the right code. So use that.
      
      With this applied the code generation looks more like it will work:
      
        <.schedule_tail>:
          mflr    r0
          std     r31,-8(r1)
          std     r0,16(r1)
          stdu    r1,-144(r1)
          std     r3,112(r1)
          bl      <._mcount>
          nop
          ld      r3,112(r1)
          bl      <.finish_task_switch>
          ld      r9,2624(r3)
          cmpdi   cr7,r9,0
          bne     cr7,<.schedule_tail+0xa0>
          ld      r3,2408(r13)
          ld      r31,1856(r3)
          cmpdi   cr7,r31,0
          beq     cr7,<.schedule_tail+0x80>
          li      r4,0
          li      r5,0
          bl      <.__task_pid_nr_ns>
          nop
          li      r9,-1
          clrldi  r9,r9,12
          cmpld   cr7,r31,r9
          bgt     cr7,<.schedule_tail+0x80>
          lis     r9,16
          rldicr  r9,r9,32,31
          subf    r9,r31,r9
          cmpldi  cr7,r9,3
          ble     cr7,<.schedule_tail+0x80>
          li      r9,0
          stw     r3,0(r31)				<-- stw
          nop
          bl      <.calculate_sigpending>
          nop
          addi    r1,r1,144
          ld      r0,16(r1)
          ld      r31,-8(r1)
          mtlr    r0
          blr
          nop
          bl      <.__balance_callback>
          b       <.schedule_tail+0x30>
      
      Fixes: ee0a49a6 ("powerpc/uaccess: Switch __put_user_size_allowed() to __put_user_asm_goto()")
      Reported-by: default avatarAndreas Schwab <schwab@linux-m68k.org>
      Tested-by: default avatarAndreas Schwab <schwab@linux-m68k.org>
      Suggested-by: default avatarChristophe Leroy <christophe.leroy@csgroup.eu>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20201104111742.672142-1-mpe@ellerman.id.au
      1344a232
  3. 02 Nov, 2020 2 commits
    • Qian Cai's avatar
      powerpc/smp: Call rcu_cpu_starting() earlier · 99f070b6
      Qian Cai authored
      The call to rcu_cpu_starting() in start_secondary() is not early
      enough in the CPU-hotplug onlining process, which results in lockdep
      splats as follows (with CONFIG_PROVE_RCU_LIST=y):
      
        WARNING: suspicious RCU usage
        -----------------------------
        kernel/locking/lockdep.c:3497 RCU-list traversed in non-reader section!!
      
        other info that might help us debug this:
      
        RCU used illegally from offline CPU!
        rcu_scheduler_active = 1, debug_locks = 1
        no locks held by swapper/1/0.
      
        Call Trace:
        dump_stack+0xec/0x144 (unreliable)
        lockdep_rcu_suspicious+0x128/0x14c
        __lock_acquire+0x1060/0x1c60
        lock_acquire+0x140/0x5f0
        _raw_spin_lock_irqsave+0x64/0xb0
        clockevents_register_device+0x74/0x270
        register_decrementer_clockevent+0x94/0x110
        start_secondary+0x134/0x800
        start_secondary_prolog+0x10/0x14
      
      This is avoided by adding a call to rcu_cpu_starting() near the
      beginning of the start_secondary() function. Note that the
      raw_smp_processor_id() is required in order to avoid calling into
      lockdep before RCU has declared the CPU to be watched for readers.
      
      It's safe to call rcu_cpu_starting() in the arch code as well as later
      in generic code, as explained by Paul:
      
        It uses a per-CPU variable so that RCU pays attention only to the
        first call to rcu_cpu_starting() if there is more than one of them.
        This is even intentional, due to there being a generic
        arch-independent call to rcu_cpu_starting() in
        notify_cpu_starting().
      
        So multiple calls to rcu_cpu_starting() are fine by design.
      
      Fixes: 4d004099 ("lockdep: Fix lockdep recursion")
      Signed-off-by: default avatarQian Cai <cai@redhat.com>
      Acked-by: default avatarPaul E. McKenney <paulmck@kernel.org>
      [mpe: Add Fixes tag, reword slightly & expand change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20201028182334.13466-1-cai@redhat.com
      99f070b6
    • Qian Cai's avatar
      powerpc/eeh_cache: Fix a possible debugfs deadlock · fd552e05
      Qian Cai authored
      Lockdep complains that a possible deadlock below in
      eeh_addr_cache_show() because it is acquiring a lock with IRQ enabled,
      but eeh_addr_cache_insert_dev() needs to acquire the same lock with IRQ
      disabled. Let's just make eeh_addr_cache_show() acquire the lock with
      IRQ disabled as well.
      
              CPU0                    CPU1
              ----                    ----
         lock(&pci_io_addr_cache_root.piar_lock);
                                      local_irq_disable();
                                      lock(&tp->lock);
                                      lock(&pci_io_addr_cache_root.piar_lock);
         <Interrupt>
           lock(&tp->lock);
      
        *** DEADLOCK ***
      
        lock_acquire+0x140/0x5f0
        _raw_spin_lock_irqsave+0x64/0xb0
        eeh_addr_cache_insert_dev+0x48/0x390
        eeh_probe_device+0xb8/0x1a0
        pnv_pcibios_bus_add_device+0x3c/0x80
        pcibios_bus_add_device+0x118/0x290
        pci_bus_add_device+0x28/0xe0
        pci_bus_add_devices+0x54/0xb0
        pcibios_init+0xc4/0x124
        do_one_initcall+0xac/0x528
        kernel_init_freeable+0x35c/0x3fc
        kernel_init+0x24/0x148
        ret_from_kernel_thread+0x5c/0x80
      
        lock_acquire+0x140/0x5f0
        _raw_spin_lock+0x4c/0x70
        eeh_addr_cache_show+0x38/0x110
        seq_read+0x1a0/0x660
        vfs_read+0xc8/0x1f0
        ksys_read+0x74/0x130
        system_call_exception+0xf8/0x1d0
        system_call_common+0xe8/0x218
      
      Fixes: 5ca85ae6 ("powerpc/eeh_cache: Add a way to dump the EEH address cache")
      Signed-off-by: default avatarQian Cai <cai@redhat.com>
      Reviewed-by: default avatarOliver O'Halloran <oohall@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20201028152717.8967-1-cai@redhat.com
      fd552e05
  4. 01 Nov, 2020 11 commits
    • Linus Torvalds's avatar
      Linux 5.10-rc2 · 3cea11cd
      Linus Torvalds authored
      3cea11cd
    • Linus Torvalds's avatar
      Merge tag 'x86-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7b56fbd8
      Linus Torvalds authored
      Pull x86 fixes from Thomas Gleixner:
       "Three fixes all related to #DB:
      
         - Handle the BTF bit correctly so it doesn't get lost due to a kernel
           #DB
      
         - Only clear and set the virtual DR6 value used by ptrace on user
           space triggered #DB. A kernel #DB must leave it alone to ensure
           data consistency for ptrace.
      
         - Make the bitmasking of the virtual DR6 storage correct so it does
           not lose DR_STEP"
      
      * tag 'x86-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/debug: Fix DR_STEP vs ptrace_get_debugreg(6)
        x86/debug: Only clear/set ->virtual_dr6 for userspace #DB
        x86/debug: Fix BTF handling
      7b56fbd8
    • Linus Torvalds's avatar
      Merge tag 'timers-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 4312e0e8
      Linus Torvalds authored
      Pull timer fixes from Thomas Gleixner:
       "A few fixes for timers/timekeeping:
      
         - Prevent undefined behaviour in the timespec64_to_ns() conversion
           which is used for converting user supplied time input to
           nanoseconds. It lacked overflow protection.
      
         - Mark sched_clock_read_begin/retry() to prevent recursion in the
           tracer
      
         - Remove unused debug functions in the hrtimer and timerlist code"
      
      * tag 'timers-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        time: Prevent undefined behaviour in timespec64_to_ns()
        timers: Remove unused inline funtion debug_timer_free()
        hrtimer: Remove unused inline function debug_hrtimer_free()
        time/sched_clock: Mark sched_clock_read_begin/retry() as notrace
      4312e0e8
    • Linus Torvalds's avatar
      Merge tag 'smp-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 82423b46
      Linus Torvalds authored
      Pull smp fix from Thomas Gleixner:
       "A single fix for stop machine.
      
        Mark functions no trace to prevent a crash caused by recursion when
        enabling or disabling a tracer on RISC-V (probably all architectures
        which patch through stop machine)"
      
      * tag 'smp-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        stop_machine, rcu: Mark functions as notrace
      82423b46
    • Linus Torvalds's avatar
      Merge tag 'locking-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 8d99084e
      Linus Torvalds authored
      Pull locking fixes from Thomas Gleixner:
       "A couple of locking fixes:
      
         - Fix incorrect failure injection handling in the fuxtex code
      
         - Prevent a preemption warning in lockdep when tracking
           local_irq_enable() and interrupts are already enabled
      
         - Remove more raw_cpu_read() usage from lockdep which causes state
           corruption on !X86 architectures.
      
         - Make the nr_unused_locks accounting in lockdep correct again"
      
      * tag 'locking-urgent-2020-11-01' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        lockdep: Fix nr_unused_locks accounting
        locking/lockdep: Remove more raw_cpu_read() usage
        futex: Fix incorrect should_fail_futex() handling
        lockdep: Fix preemption WARN for spurious IRQ-enable
      8d99084e
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · 31f02006
      Linus Torvalds authored
      Pull char/misc fixes/removals from Greg KH:
       "Here's some small fixes for 5.10-rc2 and a big driver removal.
      
        The fixes are for some reported issues in the interconnect and
        coresight drivers, nothing major.
      
        The "big" driver removal is the MIC drivers have been asked to be
        removed as the hardware never shipped and Intel no longer wants to
        maintain something that no one can use. This is welcomed by many as
        the DMA usage of these drivers was "interesting" and the security
        people were starting to question some issues that were starting to be
        found in the codebase.
      
        Note, one of the subsystems for this driver, the "VOP" code, will
        probably come back in future kernel versions as it was looking to
        potentially solve some PCIe virtualization issues that a number of
        other vendors were wanting to solve. But as-is, this codebase didn't
        work for anyone else so no actual functionality is being removed.
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'char-misc-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc:
        coresight: cti: Initialize dynamic sysfs attributes
        coresight: Fix uninitialised pointer bug in etm_setup_aux()
        coresight: add module license
        misc: mic: remove the MIC drivers
        interconnect: qcom: use icc_sync state for sm8[12]50
        interconnect: qcom: Ensure that the floor bandwidth value is enforced
        interconnect: qcom: sc7180: Init BCMs before creating the nodes
        interconnect: qcom: sdm845: Init BCMs before creating the nodes
        interconnect: Aggregate before setting initial bandwidth
        interconnect: qcom: sdm845: Enable keepalive for the MM1 BCM
      31f02006
    • Linus Torvalds's avatar
      Merge tag 'driver-core-5.10-rc2' of... · 9c75b68b
      Linus Torvalds authored
      Merge tag 'driver-core-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core
      
      Pull driver core and documentation fixes from Greg KH:
       "Here is one tiny debugfs change to fix up an API where the last user
        was successfully fixed up in 5.10-rc1 (so it couldn't be merged
        earlier), and a much larger Documentation/ABI/ update to the files so
        they can be automatically parsed by our tools.
      
        The Documentation/ABI/ updates are just formatting issues, small ones
        to bring the files into parsable format, and have been acked by
        numerous subsystem maintainers and the documentation maintainer. I
        figured it was good to get this into 5.10-rc2 to help wih the merge
        issues that would arise if these were to stick in linux-next until
        5.11-rc1.
      
        The debugfs change has been in linux-next for a long time, and the
        Documentation updates only for the last linux-next release"
      
      * tag 'driver-core-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/driver-core: (40 commits)
        scripts: get_abi.pl: assume ReST format by default
        docs: ABI: sysfs-class-led-trigger-pattern: remove hw_pattern duplication
        docs: ABI: sysfs-class-backlight: unify ABI documentation
        docs: ABI: sysfs-c2port: remove a duplicated entry
        docs: ABI: sysfs-class-power: unify duplicated properties
        docs: ABI: unify /sys/class/leds/<led>/brightness documentation
        docs: ABI: stable: remove a duplicated documentation
        docs: ABI: change read/write attributes
        docs: ABI: cleanup several ABI documents
        docs: ABI: sysfs-bus-nvdimm: use the right format for ABI
        docs: ABI: vdso: use the right format for ABI
        docs: ABI: fix syntax to be parsed using ReST notation
        docs: ABI: convert testing/configfs-acpi to ReST
        docs: Kconfig/Makefile: add a check for broken ABI files
        docs: abi-testing.rst: enable --rst-sources when building docs
        docs: ABI: don't escape ReST-incompatible chars from obsolete and removed
        docs: ABI: create a 2-depth index for ABI
        docs: ABI: make it parse ABI/stable as ReST-compatible files
        docs: ABI: sysfs-uevent: make it compatible with ReST output
        docs: ABI: testing: make the files compatible with ReST output
        ...
      9c75b68b
    • Linus Torvalds's avatar
      Merge tag 'staging-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 2376cca0
      Linus Torvalds authored
      Pull staging driver fixes from Greg KH:
       "Here are some small staging driver fixes for issues that have been
        reported in 5.10-rc1:
      
         - octeon driver fixes
      
         - wfx driver fixes
      
         - memory leak fix in vchiq driver
      
         - fieldbus driver bugfix
      
         - comedi driver bugfix
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'staging-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: fieldbus: anybuss: jump to correct label in an error path
        staging: wfx: fix test on return value of gpiod_get_value()
        staging: wfx: fix use of uninitialized pointer
        staging: mmal-vchiq: Fix memory leak for vchiq_instance
        staging: comedi: cb_pcidas: Allow 2-channel commands for AO subdevice
        staging: octeon: Drop on uncorrectable alignment or FCS error
        staging: octeon: repair "fixed-link" support
      2376cca0
    • Linus Torvalds's avatar
      Merge tag 'tty-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 2754a42e
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here are some small TTY and Serial driver fixes for reported issues
        for 5.10-rc2. They include:
      
         - vt ioctl bugfix for reported problems
      
         - fsl_lpuart serial driver fix
      
         - 21285 serial driver bugfix
      
        All have been in linux-next with no reported issues"
      
      * tag 'tty-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        vt_ioctl: fix GIO_UNIMAP regression
        vt: keyboard, extend func_buf_lock to readers
        vt: keyboard, simplify vt_kdgkbsent
        tty: serial: fsl_lpuart: LS1021A has a FIFO size of 16 words, like LS1028A
        tty: serial: 21285: fix lockup on open
      2754a42e
    • Linus Torvalds's avatar
      Merge tag 'usb-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 9b5ff3c9
      Linus Torvalds authored
      Pull USB driver fixes from Greg KH:
       "Here are a number of small bugfixes for reported issues in some USB
        drivers. They include:
      
         - typec bugfixes
      
         - xhci bugfixes and lockdep warning fixes
      
         - cdc-acm driver regression fix
      
         - kernel doc fixes
      
         - cdns3 driver bugfixes for a bunch of reported issues
      
         - other tiny USB driver fixes
      
        All have been in linux-next with no reported issues"
      
      * tag 'usb-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: cdns3: gadget: own the lock wrongly at the suspend routine
        usb: cdns3: Fix on-chip memory overflow issue
        usb: cdns3: gadget: suspicious implicit sign extension
        xhci: Don't create stream debugfs files with spinlock held.
        usb: xhci: Workaround for S3 issue on AMD SNPS 3.0 xHC
        xhci: Fix sizeof() mismatch
        usb: typec: stusb160x: fix signedness comparison issue with enum variables
        usb: typec: add missing MODULE_DEVICE_TABLE() to stusb160x
        USB: apple-mfi-fastcharge: don't probe unhandled devices
        usbcore: Check both id_table and match() when both available
        usb: host: ehci-tegra: Fix error handling in tegra_ehci_probe()
        usb: typec: stusb160x: fix an IS_ERR() vs NULL check in probe
        usb: typec: tcpm: reset hard_reset_count for any disconnect
        usb: cdc-acm: fix cooldown mechanism
        usb: host: fsl-mph-dr-of: check return of dma_set_mask()
        usb: fix kernel-doc markups
        usb: typec: stusb160x: fix some signedness bugs
        usb: cdns3: Variable 'length' set but not used
      9b5ff3c9
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 2d38c80d
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "ARM:
         - selftest fix
         - force PTE mapping on device pages provided via VFIO
         - fix detection of cacheable mapping at S2
         - fallback to PMD/PTE mappings for composite huge pages
         - fix accounting of Stage-2 PGD allocation
         - fix AArch32 handling of some of the debug registers
         - simplify host HYP entry
         - fix stray pointer conversion on nVHE TLB invalidation
         - fix initialization of the nVHE code
         - simplify handling of capabilities exposed to HYP
         - nuke VCPUs caught using a forbidden AArch32 EL0
      
        x86:
         - new nested virtualization selftest
         - miscellaneous fixes
         - make W=1 fixes
         - reserve new CPUID bit in the KVM leaves"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: vmx: remove unused variable
        KVM: selftests: Don't require THP to run tests
        KVM: VMX: eVMCS: make evmcs_sanitize_exec_ctrls() work again
        KVM: selftests: test behavior of unmapped L2 APIC-access address
        KVM: x86: Fix NULL dereference at kvm_msr_ignored_check()
        KVM: x86: replace static const variables with macros
        KVM: arm64: Handle Asymmetric AArch32 systems
        arm64: cpufeature: upgrade hyp caps to final
        arm64: cpufeature: reorder cpus_have_{const, final}_cap()
        KVM: arm64: Factor out is_{vhe,nvhe}_hyp_code()
        KVM: arm64: Force PTE mapping on fault resulting in a device mapping
        KVM: arm64: Use fallback mapping sizes for contiguous huge page sizes
        KVM: arm64: Fix masks in stage2_pte_cacheable()
        KVM: arm64: Fix AArch32 handling of DBGD{CCINT,SCRext} and DBGVCR
        KVM: arm64: Allocate stage-2 pgd pages with GFP_KERNEL_ACCOUNT
        KVM: arm64: Drop useless PAN setting on host EL1 to EL2 transition
        KVM: arm64: Remove leftover kern_hyp_va() in nVHE TLB invalidation
        KVM: arm64: Don't corrupt tpidr_el2 on failed HVC call
        x86/kvm: Reserve KVM_FEATURE_MSI_EXT_DEST_ID
      2d38c80d
  5. 31 Oct, 2020 8 commits
  6. 30 Oct, 2020 16 commits