Skip to content
  1. Dec 07, 2021
    • Steven Rostedt (VMware)'s avatar
      tracing: Disable preemption when using the filter buffer · 6c536d76
      Steven Rostedt (VMware) authored
      
      
      In case trace_event_buffer_lock_reserve() is called with preemption
      enabled, the algorithm that defines the usage of the per cpu filter buffer
      may fail if the task schedules to another CPU after determining which
      buffer it will use.
      
      Disable preemption when using the filter buffer. And because that same
      buffer must be used throughout the call, keep preemption disabled until
      the filter buffer is released.
      
      This will also keep the semantics between the use case of when the filter
      buffer is used, and when the ring buffer itself is used, as that case also
      disables preemption until the ring buffer is released.
      
      Link: https://lkml.kernel.org/r/20211130024318.880190623@goodmis.org
      
      [ Fixed warning of assignment in if statement
        Reported-by: kernel test robot <lkp@intel.com> ]
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      6c536d76
    • Steven Rostedt (VMware)'s avatar
      tracing: Use __this_cpu_read() in trace_event_buffer_lock_reserver() · e07a1d57
      Steven Rostedt (VMware) authored
      
      
      The value read by this_cpu_read() is used later and its use is expected to
      stay on the same CPU as being read. But this_cpu_read() does not warn if
      it is called without preemption disabled, where as __this_cpu_read() will
      check if preemption is disabled on CONFIG_DEBUG_PREEMPT
      
      Currently all callers have preemption disabled, but there may be new
      callers in the future that may not.
      
      Link: https://lkml.kernel.org/r/20211130024318.698165354@goodmis.org
      
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      e07a1d57
    • Masami Hiramatsu's avatar
      tools/perf: Add '__rel_loc' event field parsing support · 7c689c83
      Masami Hiramatsu authored
      
      
      Add new '__rel_loc' dynamic data location attribute support.
      This type attribute is similar to the '__data_loc' but records the
      offset from the field itself.
      The libtraceevent adds TEP_FIELD_IS_RELATIVE to the
      'tep_format_field::flags' with TEP_FIELD_IS_DYNAMIC for'__rel_loc'.
      
      Link: https://lkml.kernel.org/r/163757344810.510314.12449413842136229871.stgit@devnote2
      
      Cc: Beau Belgrave <beaub@linux.microsoft.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      7c689c83
    • Masami Hiramatsu's avatar
      libtraceevent: Add __rel_loc relative location attribute support · cd772904
      Masami Hiramatsu authored
      
      
      Add '__rel_loc' new dynamic data location attribute which encodes
      the data location from the next to the field itself. This is similar
      to the '__data_loc' but the location offset is not from the event
      entry but from the next of the field.
      
      This patch adds '__rel_loc' decoding support in the libtraceevent.
      
      Link: https://lkml.kernel.org/r/163757343994.510314.13241077597729303802.stgit@devnote2
      
      Cc: Beau Belgrave <beaub@linux.microsoft.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      cd772904
    • Masami Hiramatsu's avatar
      samples/trace_event: Add '__rel_loc' using sample event · b466b133
      Masami Hiramatsu authored
      
      
      Add '__rel_loc' using sample event for testing.
      User can use this for testing purpose. There is
      no reason to use this macro from the kernel.
      
      Link: https://lkml.kernel.org/r/163757343050.510314.2876529802471645178.stgit@devnote2
      
      Cc: Beau Belgrave <beaub@linux.microsoft.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      b466b133
    • Masami Hiramatsu's avatar
      tracing: Add '__rel_loc' using trace event macros · 55de2c0b
      Masami Hiramatsu authored
      
      
      Add '__rel_loc' using trace event macros. These macros are usually
      not used in the kernel, except for testing purpose.
      This also add "rel_" variant of macros for dynamic_array string,
      and bitmask.
      
      Link: https://lkml.kernel.org/r/163757342119.510314.816029622439099016.stgit@devnote2
      
      Cc: Beau Belgrave <beaub@linux.microsoft.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      55de2c0b
    • Masami Hiramatsu's avatar
      tracing: Support __rel_loc relative dynamic data location attribute · 05770dd0
      Masami Hiramatsu authored
      
      
      Add '__rel_loc' new dynamic data location attribute which encodes
      the data location from the next to the field itself.
      
      The '__data_loc' is used for encoding the dynamic data location on
      the trace event record. But '__data_loc' is not useful if the writer
      doesn't know the event header (e.g. user event), because it records
      the dynamic data offset from the entry of the record, not the field
      itself.
      
      This new '__rel_loc' attribute encodes the data location relatively
      from the next of the field. For example, when there is a record like
      below (the number in the parentheses is the size of fields)
      
       |header(N)|common(M)|fields(K)|__data_loc(4)|fields(L)|data(G)|
      
      In this case, '__data_loc' field will be
      
       __data_loc = (G << 16) | (N+M+K+4+L)
      
      If '__rel_loc' is used, this will be
      
       |header(N)|common(M)|fields(K)|__rel_loc(4)|fields(L)|data(G)|
      
      where
      
       __rel_loc = (G << 16) | (L)
      
      This case shows L bytes after the '__rel_loc' attribute  field,
      if there is no fields after the __rel_loc field, L must be 0.
      
      This is relatively easy (and no need to consider the kernel header
      change) when the event data fields are composed by user who doesn't
      know header and common fields.
      
      Link: https://lkml.kernel.org/r/163757341258.510314.4214431827833229956.stgit@devnote2
      
      Cc: Beau Belgrave <beaub@linux.microsoft.com>
      Cc: Namhyung Kim <namhyung@kernel.org>
      Cc: Tom Zanussi <zanussi@kernel.org>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      05770dd0
    • Colin Ian King's avatar
      tracing: Fix spelling mistake "aritmethic" -> "arithmetic" · f2b20c66
      Colin Ian King authored
      
      
      There is a spelling mistake in the tracing mini-HOWTO text. Fix it.
      
      Link: https://lkml.kernel.org/r/20211108201513.42876-1-colin.i.king@gmail.com
      
      Signed-off-by: default avatarColin Ian King <colin.i.king@gmail.com>
      Signed-off-by: default avatarSteven Rostedt (VMware) <rostedt@goodmis.org>
      f2b20c66
  2. Dec 06, 2021
    • Linus Torvalds's avatar
      Linux 5.16-rc4 · 0fcfb00b
      Linus Torvalds authored
      0fcfb00b
    • Linus Torvalds's avatar
      Merge tag 'for-5.16/parisc-6' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux · 268ba095
      Linus Torvalds authored
      Pull parisc fixes from Helge Deller:
       "Some bug and warning fixes:
      
         - Fix "make install" to use debians "installkernel" script which is
           now in /usr/sbin
      
         - Fix the bindeb-pkg make target by giving the correct KBUILD_IMAGE
           file name
      
         - Fix compiler warnings by annotating parisc agp init functions with
           __init
      
         - Fix timekeeping on SMP machines with dual-core CPUs
      
         - Enable some more config options in the 64-bit defconfig"
      
      * tag 'for-5.16/parisc-6' of git://git.kernel.org/pub/scm/linux/kernel/git/deller/parisc-linux:
        parisc: Mark cr16 CPU clocksource unstable on all SMP machines
        parisc: Fix "make install" on newer debian releases
        parisc/agp: Annotate parisc agp init functions with __init
        parisc: Enable sata sil, audit and usb support on 64-bit defconfig
        parisc: Fix KBUILD_IMAGE for self-extracting kernel
      268ba095
    • Linus Torvalds's avatar
      Merge tag 'usb-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 94420704
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are some small USB fixes for a few reported issues. Included in
        here are:
      
         - xhci fix for a _much_ reported regression. I don't think there's a
           community distro that has not reported this problem yet :(
      
         - new USB quirk addition
      
         - cdns3 minor fixes
      
         - typec regression fix.
      
        All of these have been in linux-next with no reported problems, and
        the xhci fix has been reported by many to resolve their reported
        problem"
      
      * tag 'usb-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb:
        usb: cdnsp: Fix a NULL pointer dereference in cdnsp_endpoint_init()
        usb: cdns3: gadget: fix new urb never complete if ep cancel previous requests
        usb: typec: tcpm: Wait in SNK_DEBOUNCED until disconnect
        USB: NO_LPM quirk Lenovo Powered USB-C Travel Hub
        xhci: Fix commad ring abort, write all 64 bits to CRCR register.
      94420704
    • Linus Torvalds's avatar
      Merge tag 'tty-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty · 51639539
      Linus Torvalds authored
      Pull tty/serial fixes from Greg KH:
       "Here are some small TTY and Serial driver fixes for 5.16-rc4 to
        resolve a number of reported problems.
      
        They include:
      
         - liteuart serial driver fixes
      
         - 8250_pci serial driver fixes for pericom devices
      
         - 8250 RTS line control fix while in RS-485 mode
      
         - tegra serial driver fix
      
         - msm_serial driver fix
      
         - pl011 serial driver new id
      
         - fsl_lpuart revert of broken change
      
         - 8250_bcm7271 serial driver fix
      
         - MAINTAINERS file update for rpmsg tty driver that came in 5.16-rc1
      
         - vgacon fix for reported problem
      
        All of these, except for the 8250_bcm7271 fix have been in linux-next
        with no reported problem. The 8250_bcm7271 fix was added to the tree
        on Friday so no chance to be linux-next yet. But it should be fine as
        the affected developers submitted it"
      
      * tag 'tty-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/tty:
        serial: 8250_bcm7271: UART errors after resuming from S2
        serial: 8250_pci: rewrite pericom_do_set_divisor()
        serial: 8250_pci: Fix ACCES entries in pci_serial_quirks array
        serial: 8250: Fix RTS modem control while in rs485 mode
        Revert "tty: serial: fsl_lpuart: drop earlycon entry for i.MX8QXP"
        serial: tegra: Change lower tolerance baud rate limit for tegra20 and tegra30
        serial: liteuart: relax compile-test dependencies
        serial: liteuart: fix minor-number leak on probe errors
        serial: liteuart: fix use-after-free and memleak on unbind
        serial: liteuart: Fix NULL pointer dereference in ->remove()
        vgacon: Propagate console boot parameters before calling `vc_resize'
        tty: serial: msm_serial: Deactivate RX DMA for polling support
        serial: pl011: Add ACPI SBSA UART match id
        serial: core: fix transmit-buffer reset and memleak
        MAINTAINERS: Add rpmsg tty driver maintainer
      51639539
    • Linus Torvalds's avatar
      Merge tag 'timers_urgent_for_v5.16_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 7587a4a5
      Linus Torvalds authored
      Pull timer fix from Borislav Petkov:
      
       - Prevent a tick storm when a dedicated timekeeper CPU in nohz_full
         mode runs for prolonged periods with interrupts disabled and ends up
         programming the next tick in the past, leading to that storm
      
      * tag 'timers_urgent_for_v5.16_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        timers/nohz: Last resort update jiffies on nohz_full IRQ entry
      7587a4a5
    • Linus Torvalds's avatar
      Merge tag 'sched_urgent_for_v5.16_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · 1d213767
      Linus Torvalds authored
      Pull scheduler fixes from Borislav Petkov:
      
       - Properly init uclamp_flags of a runqueue, on first enqueuing
      
       - Fix preempt= callback return values
      
       - Correct utime/stime resource usage reporting on nohz_full to return
         the proper times instead of shorter ones
      
      * tag 'sched_urgent_for_v5.16_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        sched/uclamp: Fix rq->uclamp_max not set on first enqueue
        preempt/dynamic: Fix setup_preempt_mode() return value
        sched/cputime: Fix getrusage(RUSAGE_THREAD) with nohz_full
      1d213767
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v5.16_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · f5d54a42
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
      
       - Fix a couple of SWAPGS fencing issues in the x86 entry code
      
       - Use the proper operand types in __{get,put}_user() to prevent
         truncation in SEV-ES string io
      
       - Make sure the kernel mappings are present in trampoline_pgd in order
         to prevent any potential accesses to unmapped memory after switching
         to it
      
       - Fix a trivial list corruption in objtool's pv_ops validation
      
       - Disable the clocksource watchdog for TSC on platforms which claim
         that the TSC is constant, doesn't stop in sleep states, CPU has TSC
         adjust and the number of sockets of the platform are max 2, to
         prevent erroneous markings of the TSC as unstable.
      
       - Make sure TSC adjust is always checked not only when going idle
      
       - Prevent a stack leak by initializing struct _fpx_sw_bytes properly in
         the FPU code
      
       - Fix INTEL_FAM6_RAPTORLAKE define naming to adhere to the convention
      
      * tag 'x86_urgent_for_v5.16_rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/xen: Add xenpv_restore_regs_and_return_to_usermode()
        x86/entry: Use the correct fence macro after swapgs in kernel CR3
        x86/entry: Add a fence for kernel entry SWAPGS in paranoid_entry()
        x86/sev: Fix SEV-ES INS/OUTS instructions for word, dword, and qword
        x86/64/mm: Map all kernel memory into trampoline_pgd
        objtool: Fix pv_ops noinstr validation
        x86/tsc: Disable clocksource watchdog for TSC on qualified platorms
        x86/tsc: Add a timer to make sure TSC_adjust is always checked
        x86/fpu/signal: Initialize sw_bytes in save_xstate_epilog()
        x86/cpu: Drop spurious underscore from RAPTOR_LAKE #define
      f5d54a42
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 90bf8d98
      Linus Torvalds authored
      Pull more kvm fixes from Paolo Bonzini:
      
       - Static analysis fix
      
       - New SEV-ES protocol for communicating invalid VMGEXIT requests
      
       - Ensure APICv is considered inactive if there is no APIC
      
       - Fix reserved bits for AMD PerfEvtSeln register
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: SVM: Do not terminate SEV-ES guests on GHCB validation failure
        KVM: SEV: Fall back to vmalloc for SEV-ES scratch area if necessary
        KVM: SEV: Return appropriate error codes if SEV-ES scratch setup fails
        KVM: x86/mmu: Retry page fault if root is invalidated by memslot update
        KVM: VMX: Set failure code in prepare_vmcs02()
        KVM: ensure APICv is considered inactive if there is no APIC
        KVM: x86/pmu: Fix reserved bits for AMD PerfEvtSeln register
      90bf8d98
  3. Dec 05, 2021
    • Tom Lendacky's avatar
      KVM: SVM: Do not terminate SEV-ES guests on GHCB validation failure · ad5b3532
      Tom Lendacky authored
      Currently, an SEV-ES guest is terminated if the validation of the VMGEXIT
      exit code or exit parameters fails.
      
      The VMGEXIT instruction can be issued from userspace, even though
      userspace (likely) can't update the GHCB. To prevent userspace from being
      able to kill the guest, return an error through the GHCB when validation
      fails rather than terminating the guest. For cases where the GHCB can't be
      updated (e.g. the GHCB can't be mapped, etc.), just return back to the
      guest.
      
      The new error codes are documented in the lasest update to the GHCB
      specification.
      
      Fixes: 291bd20d
      
       ("KVM: SVM: Add initial support for a VMGEXIT VMEXIT")
      Signed-off-by: default avatarTom Lendacky <thomas.lendacky@amd.com>
      Message-Id: <b57280b5562893e2616257ac9c2d4525a9aeeb42.1638471124.git.thomas.lendacky@amd.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      ad5b3532
    • Sean Christopherson's avatar
      KVM: SEV: Fall back to vmalloc for SEV-ES scratch area if necessary · a655276a
      Sean Christopherson authored
      
      
      Use kvzalloc() to allocate KVM's buffer for SEV-ES's GHCB scratch area so
      that KVM falls back to __vmalloc() if physically contiguous memory isn't
      available.  The buffer is purely a KVM software construct, i.e. there's
      no need for it to be physically contiguous.
      
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20211109222350.2266045-3-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a655276a
    • Sean Christopherson's avatar
      KVM: SEV: Return appropriate error codes if SEV-ES scratch setup fails · 75236f5f
      Sean Christopherson authored
      Return appropriate error codes if setting up the GHCB scratch area for an
      SEV-ES guest fails.  In particular, returning -EINVAL instead of -ENOMEM
      when allocating the kernel buffer could be confusing as userspace would
      likely suspect a guest issue.
      
      Fixes: 8f423a80
      
       ("KVM: SVM: Support MMIO for an SEV-ES guest")
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20211109222350.2266045-2-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      75236f5f
    • Linus Torvalds's avatar
      Merge tag 'xfs-5.16-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux · 79a72162
      Linus Torvalds authored
      Pull xfs fix from Darrick Wong:
       "Remove an unnecessary (and backwards) rename flags check that
        duplicates a VFS level check"
      
      * tag 'xfs-5.16-fixes-2' of git://git.kernel.org/pub/scm/fs/xfs/xfs-linux:
        xfs: remove incorrect ASSERT in xfs_rename
      79a72162
    • Linus Torvalds's avatar
      Merge tag '5.16-rc3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6 · 23b55d67
      Linus Torvalds authored
      Pull cifs fixes from Steve French:
       "Three SMB3 multichannel/fscache fixes and a DFS fix.
      
        In testing multichannel reconnect scenarios recently various problems
        with the cifs.ko implementation of fscache were found (e.g. incorrect
        initialization of fscache cookies in some cases)"
      
      * tag '5.16-rc3-smb3-fixes' of git://git.samba.org/sfrench/cifs-2.6:
        cifs: avoid use of dstaddr as key for fscache client cookie
        cifs: add server conn_id to fscache client cookie
        cifs: wait for tcon resource_id before getting fscache super
        cifs: fix missed refcounting of ipc tcon
      23b55d67
    • Helge Deller's avatar
      parisc: Mark cr16 CPU clocksource unstable on all SMP machines · afdb4a5b
      Helge Deller authored
      In commit c8c37359 ("parisc: Enhance detection of synchronous cr16
      clocksources") I assumed that CPUs on the same physical core are syncronous.
      While booting up the kernel on two different C8000 machines, one with a
      dual-core PA8800 and one with a dual-core PA8900 CPU, this turned out to be
      wrong. The symptom was that I saw a jump in the internal clocks printed to the
      syslog and strange overall behaviour.  On machines which have 4 cores (2
      dual-cores) the problem isn't visible, because the current logic already marked
      the cr16 clocksource unstable in this case.
      
      This patch now marks the cr16 interval timers unstable if we have more than one
      CPU in the system, and it fixes this issue.
      
      Fixes: c8c37359
      
       ("parisc: Enhance detection of synchronous cr16 clocksources")
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Cc: <stable@vger.kernel.org> # v5.15+
      afdb4a5b
    • Helge Deller's avatar
      parisc: Fix "make install" on newer debian releases · 0f9fee4c
      Helge Deller authored
      
      
      On newer debian releases the debian-provided "installkernel" script is
      installed in /usr/sbin. Fix the kernel install.sh script to look for the
      script in this directory as well.
      
      Signed-off-by: default avatarHelge Deller <deller@gmx.de>
      Cc: <stable@vger.kernel.org> # v3.13+
      0f9fee4c
    • Linus Torvalds's avatar
      Merge tag 'block-5.16-2021-12-03' of git://git.kernel.dk/linux-block · bbef3c7a
      Linus Torvalds authored
      Pull block fix from Jens Axboe:
       "A single fix for repeated printk spam from loop"
      
      * tag 'block-5.16-2021-12-03' of git://git.kernel.dk/linux-block:
        loop: Use pr_warn_once() for loop_control_remove() warning
      bbef3c7a
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.16-2021-12-03' of git://git.kernel.dk/linux-block · 8b9a0228
      Linus Torvalds authored
      Pull io_uring fix from Jens Axboe:
       "Just a single fix preventing repeated retries of task_work based io-wq
        thread creation, fixing a regression from when io-wq was made more (a
        bit too much) resilient against signals"
      
      * tag 'io_uring-5.16-2021-12-03' of git://git.kernel.dk/linux-block:
        io-wq: don't retry task_work creation failure on fatal conditions
      8b9a0228
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · e3b8bb45
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "Two patches, both in drivers.
      
        One is a fix to FC recovery (lpfc) and the other is an enhancement to
        support the Intel Alder Motherboard with the UFS driver which comes
        under the -rc exception process for hardware enabling"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: ufs: ufs-pci: Add support for Intel ADL
        scsi: lpfc: Fix non-recovery of remote ports following an unsolicited LOGO
      e3b8bb45
    • Linus Torvalds's avatar
      Merge tag 'gfs2-v5.16-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2 · 5c623c36
      Linus Torvalds authored
      Pull gfs2 fixes from Andreas Gruenbacher:
      
       - Since commit 486408d6 ("gfs2: Cancel remote delete work
         asynchronously"), inode create and lookup-by-number can overlap more
         easily and we can end up with temporary duplicate inodes. Fix the
         code to prevent that.
      
       - Fix a BUG demoting weak glock holders from a remote node.
      
      * tag 'gfs2-v5.16-rc4-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/gfs2/linux-gfs2:
        gfs2: gfs2_create_inode rework
        gfs2: gfs2_inode_lookup rework
        gfs2: gfs2_inode_lookup cleanup
        gfs2: Fix remote demote of weak glock holders
      5c623c36
  4. Dec 04, 2021
    • Qais Yousef's avatar
      sched/uclamp: Fix rq->uclamp_max not set on first enqueue · 315c4f88
      Qais Yousef authored
      Commit d81ae8aa ("sched/uclamp: Fix initialization of struct
      uclamp_rq") introduced a bug where uclamp_max of the rq is not reset to
      match the woken up task's uclamp_max when the rq is idle.
      
      The code was relying on rq->uclamp_max initialized to zero, so on first
      enqueue
      
      	static inline void uclamp_rq_inc_id(struct rq *rq, struct task_struct *p,
      					    enum uclamp_id clamp_id)
      	{
      		...
      
      		if (uc_se->value > READ_ONCE(uc_rq->value))
      			WRITE_ONCE(uc_rq->value, uc_se->value);
      	}
      
      was actually resetting it. But since commit d81ae8aa changed the
      default to 1024, this no longer works. And since rq->uclamp_flags is
      also initialized to 0, neither above code path nor uclamp_idle_reset()
      update the rq->uclamp_max on first wake up from idle.
      
      This is only visible from first wake up(s) until the first dequeue to
      idle after enabling the static key. And it only matters if the
      uclamp_max of this task is < 1024 since only then its uclamp_max will be
      effectively ignored.
      
      Fix it by properly initializing rq->uclamp_flags = UCLAMP_FLAG_IDLE to
      ensure uclamp_idle_reset() is called which then will update the rq
      uclamp_max value as expected.
      
      Fixes: d81ae8aa
      
       ("sched/uclamp: Fix initialization of struct uclamp_rq")
      Signed-off-by: default avatarQais Yousef <qais.yousef@arm.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Reviewed-by: default avatarValentin Schneider <Valentin.Schneider@arm.com>
      Tested-by: default avatarDietmar Eggemann <dietmar.eggemann@arm.com>
      Link: https://lkml.kernel.org/r/20211202112033.1705279-1-qais.yousef@arm.com
      315c4f88
    • Andrew Halaney's avatar
      preempt/dynamic: Fix setup_preempt_mode() return value · 9ed20baf
      Andrew Halaney authored
      __setup() callbacks expect 1 for success and 0 for failure. Correct the
      usage here to reflect that.
      
      Fixes: 826bfeb3
      
       ("preempt/dynamic: Support dynamic preempt with preempt= boot option")
      Reported-by: default avatarMark Rutland <mark.rutland@arm.com>
      Signed-off-by: default avatarAndrew Halaney <ahalaney@redhat.com>
      Signed-off-by: default avatarPeter Zijlstra (Intel) <peterz@infradead.org>
      Link: https://lkml.kernel.org/r/20211203233203.133581-1-ahalaney@redhat.com
      9ed20baf
    • Linus Torvalds's avatar
      Merge tag 'vfio-v5.16-rc4' of git://github.com/awilliam/linux-vfio · 12119cfa
      Linus Torvalds authored
      Pull VFIO fixes from Alex Williamson:
      
       - Fix OpRegion pointer arithmetic (Zhenyu Wang)
      
       - Fix comment format triggering kernel-doc warnings (Randy Dunlap)
      
      * tag 'vfio-v5.16-rc4' of git://github.com/awilliam/linux-vfio:
        vfio/pci: Fix OpRegion read
        vfio: remove all kernel-doc notation
      12119cfa
    • Linus Torvalds's avatar
      Merge tag 'pm-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · 4ec6afd6
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These fix a CPU hot-add issue in the cpufreq core, fix a comment in
        the cpufreq core code and update its documentation, and disable the
        DTPM (Dynamic Thermal Power Management) code for the time being to
        prevent it from causing issues to appear.
      
        Specifics:
      
         - Disable DTPM for this cycle to prevent it from causing issues to
           appear on otherwise functional systems (Daniel Lezcano)
      
         - Fix cpufreq sysfs interface failure related to physical CPU hot-add
           (Xiongfeng Wang)
      
         - Fix comment in cpufreq core and update its documentation (Tang
           Yizhou)"
      
      * tag 'pm-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        powercap: DTPM: Drop unused local variable from init_dtpm()
        cpufreq: docs: Update core.rst
        cpufreq: Fix a comment in cpufreq_policy_free
        powercap/drivers/dtpm: Disable DTPM at boot time
        cpufreq: Fix get_cpu_device() failure in add_cpu_dev_symlink()
      4ec6afd6
    • Linus Torvalds's avatar
      Merge tag 's390-5.16-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 757f3e6d
      Linus Torvalds authored
      Pull s390 fixes from Heiko Carstens:
      
       - Fix potential overlap of pseudo-MMIO addresses with MIO addresses
      
       - Fix stack unwinder test case inline assembly compile error that
         happens with LLVM's integrated assembler
      
       - Update defconfigs
      
      * tag 's390-5.16-4' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390: update defconfigs
        s390/pci: move pseudo-MMIO to prevent MIO overlap
        s390/test_unwind: use raw opcode instead of invalid instruction
      757f3e6d
    • Linus Torvalds's avatar
      Merge tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux · a2aeaeab
      Linus Torvalds authored
      Pull arm64 fixes from Will Deacon:
       "Three arm64 fixes for -rc4.
      
        One of them is just a trivial documentation fix, whereas the other two
        address a warning in the kexec code and a crash in ftrace on systems
        implementing BTI.
      
        The latter patch has a couple of ugly ifdefs which Mark plans to clean
        up separately, but as-is the patch is straightforward for backporting
        to stable kernels.
      
        Summary:
      
         - Add missing BTI landing instructions to the ftrace*_caller
           trampolines
      
         - Fix kexec() WARN when DEBUG_VIRTUAL is enabled
      
         - Fix PAC documentation by removing stale references to compiler
           flags"
      
      * tag 'arm64-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux:
        arm64: ftrace: add missing BTIs
        arm64: kexec: use __pa_symbol(empty_zero_page)
        arm64: update PAC description for kernel
      a2aeaeab
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · f66062c7
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "I2C has another set of driver bugfixes, mostly for the stm32f7 driver"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: rk3x: Handle a spurious start completion interrupt flag
        i2c: stm32f7: use proper DMAENGINE API for termination
        i2c: stm32f7: stop dma transfer in case of NACK
        i2c: stm32f7: recover the bus on access timeout
        i2c: stm32f7: flush TX FIFO upon transfer errors
        i2c: cbus-gpio: set atomic transfer callback
      f66062c7
    • Linus Torvalds's avatar
      Merge tag 'libata-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata · a44f27e4
      Linus Torvalds authored
      Pull libata fixes from Damien Le Moal:
       "Two sparse warning fixes and a couple of patches to fix an issue with
        sata_fsl driver module removal:
      
         - A couple of patches to avoid sparse warnings in libata-sata and in
           the pata_falcon driver (from Yang and Finn).
      
         - A couple of sata_fsl driver patches fixing IRQ free and proc
           unregister on module removal (from Baokun)"
      
      * tag 'libata-5.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
        ata: replace snprintf in show functions with sysfs_emit
        sata_fsl: fix warning in remove_proc_entry when rmmod sata_fsl
        sata_fsl: fix UAF in sata_fsl_port_stop when rmmod sata_fsl
        pata_falcon: Avoid type warnings from sparse
      a44f27e4
    • Shyam Prasad N's avatar
      cifs: avoid use of dstaddr as key for fscache client cookie · bbb9db5e
      Shyam Prasad N authored
      
      
      server->dstaddr can change when the DNS mapping for the
      server hostname changes. But conn_id is a u64 counter
      that is incremented each time a new TCP connection
      is setup. So use only that as a key.
      
      Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      bbb9db5e
    • Shyam Prasad N's avatar
      cifs: add server conn_id to fscache client cookie · 2adc8200
      Shyam Prasad N authored
      
      
      The fscache client cookie uses the server address
      (and port) as the cookie key. This is a problem when
      nosharesock is used. Two different connections will
      use duplicate cookies. Avoid this by adding
      server->conn_id to the key, so that it's guaranteed
      that cookie will not be duplicated.
      
      Also, for secondary channels of a session, copy the
      fscache pointer from the primary channel. The primary
      channel is guaranteed not to go away as long as secondary
      channels are in use.  Also addresses minor problem found
      by kernel test robot.
      
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      2adc8200
    • Shyam Prasad N's avatar
      cifs: wait for tcon resource_id before getting fscache super · 5bf91ef0
      Shyam Prasad N authored
      
      
      The logic for initializing tcon->resource_id is done inside
      cifs_root_iget. fscache super cookie relies on this for aux
      data. So we need to push the fscache initialization to this
      later point during mount.
      
      Signed-off-by: default avatarShyam Prasad N <sprasad@microsoft.com>
      Reviewed-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      5bf91ef0
    • Paulo Alcantara's avatar
      cifs: fix missed refcounting of ipc tcon · 65de262a
      Paulo Alcantara authored
      Fix missed refcounting of IPC tcon used for getting domain-based DFS
      root referrals.  We want to keep it alive as long as mount is active
      and can be refreshed.  For standalone DFS root referrals it wouldn't
      be a problem as the client ends up having an IPC tcon for both mount
      and cache.
      
      Fixes: c88f7dcd
      
       ("cifs: support nested dfs links over reconnect")
      Signed-off-by: default avatarPaulo Alcantara (SUSE) <pc@cjr.nz>
      Reviewed-by: default avatarEnzo Matsumiya <ematsumiya@suse.de>
      Signed-off-by: default avatarSteve French <stfrench@microsoft.com>
      65de262a
    • Lai Jiangshan's avatar
      x86/xen: Add xenpv_restore_regs_and_return_to_usermode() · 5c8f6a2e
      Lai Jiangshan authored
      In the native case, PER_CPU_VAR(cpu_tss_rw + TSS_sp0) is the
      trampoline stack. But XEN pv doesn't use trampoline stack, so
      PER_CPU_VAR(cpu_tss_rw + TSS_sp0) is also the kernel stack.
      
      In that case, source and destination stacks are identical, which means
      that reusing swapgs_restore_regs_and_return_to_usermode() in XEN pv
      would cause %rsp to move up to the top of the kernel stack and leave the
      IRET frame below %rsp.
      
      This is dangerous as it can be corrupted if #NMI / #MC hit as either of
      these events occurring in the middle of the stack pushing would clobber
      data on the (original) stack.
      
      And, with  XEN pv, swapgs_restore_regs_and_return_to_usermode() pushing
      the IRET frame on to the original address is useless and error-prone
      when there is any future attempt to modify the code.
      
       [ bp: Massage commit message. ]
      
      Fixes: 7f2590a1
      
       ("x86/entry/64: Use a per-CPU trampoline stack for IDT entries")
      Signed-off-by: default avatarLai Jiangshan <laijs@linux.alibaba.com>
      Signed-off-by: default avatarBorislav Petkov <bp@suse.de>
      Reviewed-by: default avatarBoris Ostrovsky <boris.ostrovsky@oracle.com>
      Link: https://lkml.kernel.org/r/20211126101209.8613-4-jiangshanlai@gmail.com
      5c8f6a2e