1. 23 Nov, 2020 2 commits
    • Stephen Rothwell's avatar
      powerpc/64s: Fix allnoconfig build since uaccess flush · b6b79dd5
      Stephen Rothwell authored
      Using DECLARE_STATIC_KEY_FALSE needs linux/jump_table.h.
      
      Otherwise the build fails with eg:
      
        arch/powerpc/include/asm/book3s/64/kup-radix.h:66:1: warning: data definition has no type or storage class
           66 | DECLARE_STATIC_KEY_FALSE(uaccess_flush_key);
      
      Fixes: 9a32a7e7 ("powerpc/64s: flush L1D after user accesses")
      Signed-off-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      [mpe: Massage change log]
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20201123184016.693fe464@canb.auug.org.au
      b6b79dd5
    • Michael Ellerman's avatar
      Merge tag 'powerpc-cve-2020-4788' into fixes · 962f8e64
      Michael Ellerman authored
      From Daniel's cover letter:
      
      IBM Power9 processors can speculatively operate on data in the L1 cache
      before it has been completely validated, via a way-prediction mechanism. It
      is not possible for an attacker to determine the contents of impermissible
      memory using this method, since these systems implement a combination of
      hardware and software security measures to prevent scenarios where
      protected data could be leaked.
      
      However these measures don't address the scenario where an attacker induces
      the operating system to speculatively execute instructions using data that
      the attacker controls. This can be used for example to speculatively bypass
      "kernel user access prevention" techniques, as discovered by Anthony
      Steinhauser of Google's Safeside Project. This is not an attack by itself,
      but there is a possibility it could be used in conjunction with
      side-channels or other weaknesses in the privileged code to construct an
      attack.
      
      This issue can be mitigated by flushing the L1 cache between privilege
      boundaries of concern.
      
      This patch series flushes the L1 cache on kernel entry (patch 2) and after the
      kernel performs any user accesses (patch 3). It also adds a self-test and
      performs some related cleanups.
      962f8e64
  2. 19 Nov, 2020 7 commits
    • Daniel Axtens's avatar
      powerpc/64s: rename pnv|pseries_setup_rfi_flush to _setup_security_mitigations · da631f7f
      Daniel Axtens authored
      pseries|pnv_setup_rfi_flush already does the count cache flush setup, and
      we just added entry and uaccess flushes. So the name is not very accurate
      any more. In both platforms we then also immediately setup the STF flush.
      
      Rename them to _setup_security_mitigations and fold the STF flush in.
      Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      da631f7f
    • Daniel Axtens's avatar
      selftests/powerpc: refactor entry and rfi_flush tests · 0d239f3b
      Daniel Axtens authored
      For simplicity in backporting, the original entry_flush test contained
      a lot of duplicated code from the rfi_flush test. De-duplicate that code.
      Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      0d239f3b
    • Daniel Axtens's avatar
      selftests/powerpc: entry flush test · 89a83a0c
      Daniel Axtens authored
      Add a test modelled on the RFI flush test which counts the number
      of L1D misses doing a simple syscall with the entry flush on and off.
      
      For simplicity of backporting, this test duplicates a lot of code from
      rfi_flush. We clean that up in the next patch.
      Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      89a83a0c
    • Michael Ellerman's avatar
      powerpc: Only include kup-radix.h for 64-bit Book3S · 178d52c6
      Michael Ellerman authored
      In kup.h we currently include kup-radix.h for all 64-bit builds, which
      includes Book3S and Book3E. The latter doesn't make sense, Book3E
      never uses the Radix MMU.
      
      This has worked up until now, but almost by accident, and the recent
      uaccess flush changes introduced a build breakage on Book3E because of
      the bad structure of the code.
      
      So disentangle things so that we only use kup-radix.h for Book3S. This
      requires some more stubs in kup.h and fixing an include in
      syscall_64.c.
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      178d52c6
    • Nicholas Piggin's avatar
      powerpc/64s: flush L1D after user accesses · 9a32a7e7
      Nicholas Piggin authored
      IBM Power9 processors can speculatively operate on data in the L1 cache
      before it has been completely validated, via a way-prediction mechanism. It
      is not possible for an attacker to determine the contents of impermissible
      memory using this method, since these systems implement a combination of
      hardware and software security measures to prevent scenarios where
      protected data could be leaked.
      
      However these measures don't address the scenario where an attacker induces
      the operating system to speculatively execute instructions using data that
      the attacker controls. This can be used for example to speculatively bypass
      "kernel user access prevention" techniques, as discovered by Anthony
      Steinhauser of Google's Safeside Project. This is not an attack by itself,
      but there is a possibility it could be used in conjunction with
      side-channels or other weaknesses in the privileged code to construct an
      attack.
      
      This issue can be mitigated by flushing the L1 cache between privilege
      boundaries of concern. This patch flushes the L1 cache after user accesses.
      
      This is part of the fix for CVE-2020-4788.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      9a32a7e7
    • Nicholas Piggin's avatar
      powerpc/64s: flush L1D on kernel entry · f7964378
      Nicholas Piggin authored
      IBM Power9 processors can speculatively operate on data in the L1 cache
      before it has been completely validated, via a way-prediction mechanism. It
      is not possible for an attacker to determine the contents of impermissible
      memory using this method, since these systems implement a combination of
      hardware and software security measures to prevent scenarios where
      protected data could be leaked.
      
      However these measures don't address the scenario where an attacker induces
      the operating system to speculatively execute instructions using data that
      the attacker controls. This can be used for example to speculatively bypass
      "kernel user access prevention" techniques, as discovered by Anthony
      Steinhauser of Google's Safeside Project. This is not an attack by itself,
      but there is a possibility it could be used in conjunction with
      side-channels or other weaknesses in the privileged code to construct an
      attack.
      
      This issue can be mitigated by flushing the L1 cache between privilege
      boundaries of concern. This patch flushes the L1 cache on kernel entry.
      
      This is part of the fix for CVE-2020-4788.
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      f7964378
    • Russell Currey's avatar
      selftests/powerpc: rfi_flush: disable entry flush if present · fcb48454
      Russell Currey authored
      We are about to add an entry flush. The rfi (exit) flush test measures
      the number of L1D flushes over a syscall with the RFI flush enabled and
      disabled. But if the entry flush is also enabled, the effect of enabling
      and disabling the RFI flush is masked.
      
      If there is a debugfs entry for the entry flush, disable it during the RFI
      flush and restore it later.
      Reported-by: default avatarSpoorthy S <spoorts2@in.ibm.com>
      Signed-off-by: default avatarRussell Currey <ruscur@russell.cc>
      Signed-off-by: default avatarDaniel Axtens <dja@axtens.net>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      fcb48454
  3. 18 Nov, 2020 1 commit
  4. 17 Nov, 2020 1 commit
  5. 16 Nov, 2020 2 commits
    • Cédric Le Goater's avatar
      KVM: PPC: Book3S HV: XIVE: Fix possible oops when accessing ESB page · 75b49620
      Cédric Le Goater authored
      When accessing the ESB page of a source interrupt, the fault handler
      will retrieve the page address from the XIVE interrupt 'xive_irq_data'
      structure. If the associated KVM XIVE interrupt is not valid, that is
      not allocated at the HW level for some reason, the fault handler will
      dereference a NULL pointer leading to the oops below :
      
        WARNING: CPU: 40 PID: 59101 at arch/powerpc/kvm/book3s_xive_native.c:259 xive_native_esb_fault+0xe4/0x240 [kvm]
        CPU: 40 PID: 59101 Comm: qemu-system-ppc Kdump: loaded Tainted: G        W        --------- -  - 4.18.0-240.el8.ppc64le #1
        NIP:  c00800000e949fac LR: c00000000044b164 CTR: c00800000e949ec8
        REGS: c000001f69617840 TRAP: 0700   Tainted: G        W        --------- -  -  (4.18.0-240.el8.ppc64le)
        MSR:  9000000000029033 <SF,HV,EE,ME,IR,DR,RI,LE>  CR: 44044282  XER: 00000000
        CFAR: c00000000044b160 IRQMASK: 0
        GPR00: c00000000044b164 c000001f69617ac0 c00800000e96e000 c000001f69617c10
        GPR04: 05faa2b21e000080 0000000000000000 0000000000000005 ffffffffffffffff
        GPR08: 0000000000000000 0000000000000001 0000000000000000 0000000000000001
        GPR12: c00800000e949ec8 c000001ffffd3400 0000000000000000 0000000000000000
        GPR16: 0000000000000000 0000000000000000 0000000000000000 0000000000000000
        GPR20: 0000000000000000 0000000000000000 c000001f5c065160 c000000001c76f90
        GPR24: c000001f06f20000 c000001f5c065100 0000000000000008 c000001f0eb98c78
        GPR28: c000001dcab40000 c000001dcab403d8 c000001f69617c10 0000000000000011
        NIP [c00800000e949fac] xive_native_esb_fault+0xe4/0x240 [kvm]
        LR [c00000000044b164] __do_fault+0x64/0x220
        Call Trace:
        [c000001f69617ac0] [0000000137a5dc20] 0x137a5dc20 (unreliable)
        [c000001f69617b50] [c00000000044b164] __do_fault+0x64/0x220
        [c000001f69617b90] [c000000000453838] do_fault+0x218/0x930
        [c000001f69617bf0] [c000000000456f50] __handle_mm_fault+0x350/0xdf0
        [c000001f69617cd0] [c000000000457b1c] handle_mm_fault+0x12c/0x310
        [c000001f69617d10] [c00000000007ef44] __do_page_fault+0x264/0xbb0
        [c000001f69617df0] [c00000000007f8c8] do_page_fault+0x38/0xd0
        [c000001f69617e30] [c00000000000a714] handle_page_fault+0x18/0x38
        Instruction dump:
        40c2fff0 7c2004ac 2fa90000 409e0118 73e90001 41820080 e8bd0008 7c2004ac
        7ca90074 39400000 915c0000 7929d182 <0b090000> 2fa50000 419e0080 e89e0018
        ---[ end trace 66c6ff034c53f64f ]---
        xive-kvm: xive_native_esb_fault: accessing invalid ESB page for source 8 !
      
      Fix that by checking the validity of the KVM XIVE interrupt structure.
      
      Fixes: 6520ca64 ("KVM: PPC: Book3S HV: XIVE: Add a mapping for the source ESB pages")
      Cc: stable@vger.kernel.org # v5.2+
      Reported-by: default avatarGreg Kurz <groug@kaod.org>
      Signed-off-by: default avatarCédric Le Goater <clg@kaod.org>
      Tested-by: default avatarGreg Kurz <groug@kaod.org>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20201105134713.656160-1-clg@kaod.org
      75b49620
    • Nicholas Piggin's avatar
      powerpc/64s: Fix KVM system reset handling when CONFIG_PPC_PSERIES=y · 575cba20
      Nicholas Piggin authored
      pseries guest kernels have a FWNMI handler for SRESET and MCE NMIs,
      which is basically the same as the regular handlers for those
      interrupts.
      
      The system reset FWNMI handler did not have a KVM guest test in it,
      although it probably should have because the guest can itself run
      guests.
      
      Commit 4f50541f ("powerpc/64s/exception: Move all interrupt
      handlers to new style code gen macros") convert the handler faithfully
      to avoid a KVM test with a "clever" trick to modify the IKVM_REAL
      setting to 0 when the fwnmi handler is to be generated (PPC_PSERIES=y).
      This worked when the KVM test was generated in the interrupt entry
      handlers, but a later patch moved the KVM test to the common handler,
      and the common handler macro is expanded below the fwnmi entry. This
      prevents the KVM test from being generated even for the 0x100 entry
      point as well.
      
      The result is NMI IPIs in the host kernel when a guest is running will
      use gest registers. This goes particularly badly when an HPT guest is
      running and the MMU is set to guest mode.
      
      Remove this trickery and just generate the test always.
      
      Fixes: 9600f261 ("powerpc/64s/exception: Move KVM test to common code")
      Cc: stable@vger.kernel.org # v5.7+
      Signed-off-by: default avatarNicholas Piggin <npiggin@gmail.com>
      Signed-off-by: default avatarMichael Ellerman <mpe@ellerman.id.au>
      Link: https://lore.kernel.org/r/20201114114743.3306283-1-npiggin@gmail.com
      575cba20
  6. 08 Nov, 2020 1 commit
  7. 06 Nov, 2020 1 commit
  8. 05 Nov, 2020 4 commits
  9. 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
  10. 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
  11. 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
  12. 31 Oct, 2020 7 commits
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · c2dc4c07
      Linus Torvalds authored
      Pull vhost fixes from Michael Tsirkin:
       "Fixes all over the place.
      
        A new UAPI is borderline: can also be considered a new feature but
        also seems to be the only way we could come up with to fix addressing
        for userspace - and it seems important to switch to it now before
        userspace making assumptions about addressing ability of devices is
        set in stone"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        vdpasim: allow to assign a MAC address
        vdpasim: fix MAC address configuration
        vdpa: handle irq bypass register failure case
        vdpa_sim: Fix DMA mask
        Revert "vhost-vdpa: fix page pinning leakage in error path"
        vdpa/mlx5: Fix error return in map_direct_mr()
        vhost_vdpa: Return -EFAULT if copy_from_user() fails
        vdpa_sim: implement get_iova_range()
        vhost: vdpa: report iova range
        vdpa: introduce config op to get valid iova range
      c2dc4c07
    • Linus Torvalds's avatar
      Merge tag 'flexible-array-conversions-5.10-rc2' of... · 53760f9b
      Linus Torvalds authored
      Merge tag 'flexible-array-conversions-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux
      
      Pull more flexible-array member conversions from Gustavo A. R. Silva:
       "Replace zero-length arrays with flexible-array members"
      
      * tag 'flexible-array-conversions-5.10-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/gustavoars/linux:
        printk: ringbuffer: Replace zero-length array with flexible-array member
        net/smc: Replace zero-length array with flexible-array member
        net/mlx5: Replace zero-length array with flexible-array member
        mei: hw: Replace zero-length array with flexible-array member
        gve: Replace zero-length array with flexible-array member
        Bluetooth: btintel: Replace zero-length array with flexible-array member
        scsi: target: tcmu: Replace zero-length array with flexible-array member
        ima: Replace zero-length array with flexible-array member
        enetc: Replace zero-length array with flexible-array member
        fs: Replace zero-length array with flexible-array member
        Bluetooth: Replace zero-length array with flexible-array member
        params: Replace zero-length array with flexible-array member
        tracepoint: Replace zero-length array with flexible-array member
        platform/chrome: cros_ec_proto: Replace zero-length array with flexible-array member
        platform/chrome: cros_ec_commands: Replace zero-length array with flexible-array member
        mailbox: zynqmp-ipi-message: Replace zero-length array with flexible-array member
        dmaengine: ti-cppi5: Replace zero-length array with flexible-array member
      53760f9b
    • Linus Torvalds's avatar
      Merge tag 'dma-mapping-5.10-2' of git://git.infradead.org/users/hch/dma-mapping · bb3540be
      Linus Torvalds authored
      Pull dma-mapping fix from Christoph Hellwig:
       "Fix an integer overflow on 32-bit platforms in the new DMA range code
        (Geert Uytterhoeven)"
      
      * tag 'dma-mapping-5.10-2' of git://git.infradead.org/users/hch/dma-mapping:
        dma-mapping: fix 32-bit overflow with CONFIG_ARM_LPAE=n
      bb3540be
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 67ff377b
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Four driver fixes and one core fix.
      
        The core fix closes a race window where we could kick off a second
        asynchronous scan because the test and set of the variable preventing
        it isn't atomic"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: hisi_sas: Stop using queue #0 always for v2 hw
        scsi: ibmvscsi: Fix potential race after loss of transport
        scsi: mptfusion: Fix null pointer dereferences in mptscsih_remove()
        scsi: qla2xxx: Return EBUSY on fcport deletion
        scsi: core: Don't start concurrent async scan on same host
      67ff377b
    • Paolo Bonzini's avatar
      KVM: vmx: remove unused variable · 9478dec3
      Paolo Bonzini authored
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9478dec3
    • Andrew Jones's avatar
      KVM: selftests: Don't require THP to run tests · 0f55b67e
      Andrew Jones authored
      Unless we want to test with THP, then we shouldn't require it to be
      configured by the host kernel. Unfortunately, even advising with
      MADV_NOHUGEPAGE does require it, so check for THP first in order
      to avoid madvise failing with EINVAL.
      Signed-off-by: default avatarAndrew Jones <drjones@redhat.com>
      Message-Id: <20201029201703.102716-2-drjones@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      0f55b67e
    • Vitaly Kuznetsov's avatar
      KVM: VMX: eVMCS: make evmcs_sanitize_exec_ctrls() work again · 064eedf2
      Vitaly Kuznetsov authored
      It was noticed that evmcs_sanitize_exec_ctrls() is not being executed
      nowadays despite the code checking 'enable_evmcs' static key looking
      correct. Turns out, static key magic doesn't work in '__init' section
      (and it is unclear when things changed) but setup_vmcs_config() is called
      only once per CPU so we don't really need it to. Switch to checking
      'enlightened_vmcs' instead, it is supposed to be in sync with
      'enable_evmcs'.
      
      Opportunistically make evmcs_sanitize_exec_ctrls '__init' and drop unneeded
      extra newline from it.
      Reported-by: default avatarYang Weijiang <weijiang.yang@intel.com>
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20201014143346.2430936-1-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      064eedf2