Skip to content
  1. Jan 28, 2021
    • Michael Roth's avatar
      KVM: x86: fix CPUID entries returned by KVM_GET_CPUID2 ioctl · 181f4948
      Michael Roth authored
      Recent commit 255cbecf modified struct kvm_vcpu_arch to make
      'cpuid_entries' a pointer to an array of kvm_cpuid_entry2 entries
      rather than embedding the array in the struct. KVM_SET_CPUID and
      KVM_SET_CPUID2 were updated accordingly, but KVM_GET_CPUID2 was missed.
      
      As a result, KVM_GET_CPUID2 currently returns random fields from struct
      kvm_vcpu_arch to userspace rather than the expected CPUID values. Fix
      this by treating 'cpuid_entries' as a pointer when copying its
      contents to userspace buffer.
      
      Fixes: 255cbecf
      
       ("KVM: x86: allocate vcpu->arch.cpuid_entries dynamically")
      Cc: Vitaly Kuznetsov <vkuznets@redhat.com>
      Signed-off-by: default avatarMichael Roth <michael.roth@amd.com.com>
      Message-Id: <20210128024451.1816770-1-michael.roth@amd.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      181f4948
  2. Jan 26, 2021
    • Paolo Bonzini's avatar
      KVM: x86: allow KVM_REQ_GET_NESTED_STATE_PAGES outside guest mode for VMX · 9a78e158
      Paolo Bonzini authored
      VMX also uses KVM_REQ_GET_NESTED_STATE_PAGES for the Hyper-V eVMCS,
      which may need to be loaded outside guest mode.  Therefore we cannot
      WARN in that case.
      
      However, that part of nested_get_vmcs12_pages is _not_ needed at
      vmentry time.  Split it out of KVM_REQ_GET_NESTED_STATE_PAGES handling,
      so that both vmentry and migration (and in the latter case, independent
      of is_guest_mode) do the parts that are needed.
      
      Cc: <stable@vger.kernel.org> # 5.10.x: f2c7ef3b
      
      : KVM: nSVM: cancel KVM_REQ_GET_NESTED_STATE_PAGES
      Cc: <stable@vger.kernel.org> # 5.10.x
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      9a78e158
    • Sean Christopherson's avatar
      KVM: x86: Revert "KVM: x86: Mark GPRs dirty when written" · aed89418
      Sean Christopherson authored
      Revert the dirty/available tracking of GPRs now that KVM copies the GPRs
      to the GHCB on any post-VMGEXIT VMRUN, even if a GPR is not dirty.  Per
      commit de3cd117 ("KVM: x86: Omit caching logic for always-available
      GPRs"), tracking for GPRs noticeably impacts KVM's code footprint.
      
      This reverts commit 1c04d8c9
      
      .
      
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20210122235049.3107620-3-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      aed89418
    • Sean Christopherson's avatar
      KVM: SVM: Unconditionally sync GPRs to GHCB on VMRUN of SEV-ES guest · 25009140
      Sean Christopherson authored
      Drop the per-GPR dirty checks when synchronizing GPRs to the GHCB, the
      GRPs' dirty bits are set from time zero and never cleared, i.e. will
      always be seen as dirty.  The obvious alternative would be to clear
      the dirty bits when appropriate, but removing the dirty checks is
      desirable as it allows reverting GPR dirty+available tracking, which
      adds overhead to all flavors of x86 VMs.
      
      Note, unconditionally writing the GPRs in the GHCB is tacitly allowed
      by the GHCB spec, which allows the hypervisor (or guest) to provide
      unnecessary info; it's the guest's responsibility to consume only what
      it needs (the hypervisor is untrusted after all).
      
        The guest and hypervisor can supply additional state if desired but
        must not rely on that additional state being provided.
      
      Cc: Brijesh Singh <brijesh.singh@amd.com>
      Cc: Tom Lendacky <thomas.lendacky@amd.com>
      Fixes: 291bd20d
      
       ("KVM: SVM: Add initial support for a VMGEXIT VMEXIT")
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20210122235049.3107620-2-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      25009140
    • Maxim Levitsky's avatar
      KVM: nVMX: Sync unsync'd vmcs02 state to vmcs12 on migration · d51e1d3f
      Maxim Levitsky authored
      Even when we are outside the nested guest, some vmcs02 fields
      may not be in sync vs vmcs12.  This is intentional, even across
      nested VM-exit, because the sync can be delayed until the nested
      hypervisor performs a VMCLEAR or a VMREAD/VMWRITE that affects those
      rarely accessed fields.
      
      However, during KVM_GET_NESTED_STATE, the vmcs12 has to be up to date to
      be able to restore it.  To fix that, call copy_vmcs02_to_vmcs12_rare()
      before the vmcs12 contents are copied to userspace.
      
      Fixes: 7952d769
      
       ("KVM: nVMX: Sync rarely accessed guest fields only when needed")
      Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarMaxim Levitsky <mlevitsk@redhat.com>
      Message-Id: <20210114205449.8715-2-mlevitsk@redhat.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      d51e1d3f
    • Lorenzo Brescia's avatar
      kvm: tracing: Fix unmatched kvm_entry and kvm_exit events · d95df951
      Lorenzo Brescia authored
      
      
      On VMX, if we exit and then re-enter immediately without leaving
      the vmx_vcpu_run() function, the kvm_entry event is not logged.
      That means we will see one (or more) kvm_exit, without its (their)
      corresponding kvm_entry, as shown here:
      
       CPU-1979 [002] 89.871187: kvm_entry: vcpu 1
       CPU-1979 [002] 89.871218: kvm_exit:  reason MSR_WRITE
       CPU-1979 [002] 89.871259: kvm_exit:  reason MSR_WRITE
      
      It also seems possible for a kvm_entry event to be logged, but then
      we leave vmx_vcpu_run() right away (if vmx->emulation_required is
      true). In this case, we will have a spurious kvm_entry event in the
      trace.
      
      Fix these situations by moving trace_kvm_entry() inside vmx_vcpu_run()
      (where trace_kvm_exit() already is).
      
      A trace obtained with this patch applied looks like this:
      
       CPU-14295 [000] 8388.395387: kvm_entry: vcpu 0
       CPU-14295 [000] 8388.395392: kvm_exit:  reason MSR_WRITE
       CPU-14295 [000] 8388.395393: kvm_entry: vcpu 0
       CPU-14295 [000] 8388.395503: kvm_exit:  reason EXTERNAL_INTERRUPT
      
      Of course, not calling trace_kvm_entry() in common x86 code any
      longer means that we need to adjust the SVM side of things too.
      
      Signed-off-by: default avatarLorenzo Brescia <lorenzo.brescia@edu.unito.it>
      Signed-off-by: default avatarDario Faggioli <dfaggioli@suse.com>
      Message-Id: <160873470698.11652.13483635328769030605.stgit@Wayrath>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      d95df951
    • Zenghui Yu's avatar
      KVM: Documentation: Update description of KVM_{GET,CLEAR}_DIRTY_LOG · 01ead84c
      Zenghui Yu authored
      
      
      Update various words, including the wrong parameter name and the vague
      description of the usage of "slot" field.
      
      Signed-off-by: default avatarZenghui Yu <yuzenghui@huawei.com>
      Message-Id: <20201208043439.895-1-yuzenghui@huawei.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      01ead84c
    • Jay Zhou's avatar
      KVM: x86: get smi pending status correctly · 1f7becf1
      Jay Zhou authored
      
      
      The injection process of smi has two steps:
      
          Qemu                        KVM
      Step1:
          cpu->interrupt_request &= \
              ~CPU_INTERRUPT_SMI;
          kvm_vcpu_ioctl(cpu, KVM_SMI)
      
                                      call kvm_vcpu_ioctl_smi() and
                                      kvm_make_request(KVM_REQ_SMI, vcpu);
      
      Step2:
          kvm_vcpu_ioctl(cpu, KVM_RUN, 0)
      
                                      call process_smi() if
                                      kvm_check_request(KVM_REQ_SMI, vcpu) is
                                      true, mark vcpu->arch.smi_pending = true;
      
      The vcpu->arch.smi_pending will be set true in step2, unfortunately if
      vcpu paused between step1 and step2, the kvm_run->immediate_exit will be
      set and vcpu has to exit to Qemu immediately during step2 before mark
      vcpu->arch.smi_pending true.
      During VM migration, Qemu will get the smi pending status from KVM using
      KVM_GET_VCPU_EVENTS ioctl at the downtime, then the smi pending status
      will be lost.
      
      Signed-off-by: default avatarJay Zhou <jianjay.zhou@huawei.com>
      Signed-off-by: default avatarShengen Zhuang <zhuangshengen@huawei.com>
      Message-Id: <20210118084720.1585-1-jianjay.zhou@huawei.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      1f7becf1
    • Like Xu's avatar
      KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_arch_events[] · 98dd2f10
      Like Xu authored
      The HW_REF_CPU_CYCLES event on the fixed counter 2 is pseudo-encoded as
      0x0300 in the intel_perfmon_event_map[]. Correct its usage.
      
      Fixes: 62079d8a
      
       ("KVM: PMU: add proper support for fixed counter 2")
      Signed-off-by: default avatarLike Xu <like.xu@linux.intel.com>
      Message-Id: <20201230081916.63417-1-like.xu@linux.intel.com>
      Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      98dd2f10
    • Like Xu's avatar
      KVM: x86/pmu: Fix UBSAN shift-out-of-bounds warning in intel_pmu_refresh() · e61ab2a3
      Like Xu authored
      
      
      Since we know vPMU will not work properly when (1) the guest bit_width(s)
      of the [gp|fixed] counters are greater than the host ones, or (2) guest
      requested architectural events exceeds the range supported by the host, so
      we can setup a smaller left shift value and refresh the guest cpuid entry,
      thus fixing the following UBSAN shift-out-of-bounds warning:
      
      shift exponent 197 is too large for 64-bit type 'long long unsigned int'
      
      Call Trace:
       __dump_stack lib/dump_stack.c:79 [inline]
       dump_stack+0x107/0x163 lib/dump_stack.c:120
       ubsan_epilogue+0xb/0x5a lib/ubsan.c:148
       __ubsan_handle_shift_out_of_bounds.cold+0xb1/0x181 lib/ubsan.c:395
       intel_pmu_refresh.cold+0x75/0x99 arch/x86/kvm/vmx/pmu_intel.c:348
       kvm_vcpu_after_set_cpuid+0x65a/0xf80 arch/x86/kvm/cpuid.c:177
       kvm_vcpu_ioctl_set_cpuid2+0x160/0x440 arch/x86/kvm/cpuid.c:308
       kvm_arch_vcpu_ioctl+0x11b6/0x2d70 arch/x86/kvm/x86.c:4709
       kvm_vcpu_ioctl+0x7b9/0xdb0 arch/x86/kvm/../../../virt/kvm/kvm_main.c:3386
       vfs_ioctl fs/ioctl.c:48 [inline]
       __do_sys_ioctl fs/ioctl.c:753 [inline]
       __se_sys_ioctl fs/ioctl.c:739 [inline]
       __x64_sys_ioctl+0x193/0x200 fs/ioctl.c:739
       do_syscall_64+0x2d/0x70 arch/x86/entry/common.c:46
       entry_SYSCALL_64_after_hwframe+0x44/0xa9
      
      Reported-by: default avatar <syzbot+ae488dc136a4cc6ba32b@syzkaller.appspotmail.com>
      Signed-off-by: default avatarLike Xu <like.xu@linux.intel.com>
      Message-Id: <20210118025800.34620-1-like.xu@linux.intel.com>
      Cc: stable@vger.kernel.org
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      e61ab2a3
    • Sean Christopherson's avatar
      KVM: x86: Add more protection against undefined behavior in rsvd_bits() · eb79cd00
      Sean Christopherson authored
      
      
      Add compile-time asserts in rsvd_bits() to guard against KVM passing in
      garbage hardcoded values, and cap the upper bound at '63' for dynamic
      values to prevent generating a mask that would overflow a u64.
      
      Suggested-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Message-Id: <20210113204515.3473079-1-seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      eb79cd00
    • Quentin Perret's avatar
      KVM: Documentation: Fix spec for KVM_CAP_ENABLE_CAP_VM · a10f373a
      Quentin Perret authored
      The documentation classifies KVM_ENABLE_CAP with KVM_CAP_ENABLE_CAP_VM
      as a vcpu ioctl, which is incorrect. Fix it by specifying it as a VM
      ioctl.
      
      Fixes: e5d83c74
      
       ("kvm: make KVM_CAP_ENABLE_CAP_VM architecture agnostic")
      Signed-off-by: default avatarQuentin Perret <qperret@google.com>
      Message-Id: <20210108165349.747359-1-qperret@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      a10f373a
    • Paolo Bonzini's avatar
      Merge tag 'kvmarm-fixes-5.11-2' of... · 615099b0
      Paolo Bonzini authored
      Merge tag 'kvmarm-fixes-5.11-2' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
      
      KVM/arm64 fixes for 5.11, take #2
      
      - Don't allow tagged pointers to point to memslots
      - Filter out ARMv8.1+ PMU events on v8.0 hardware
      - Hide PMU registers from userspace when no PMU is configured
      - More PMU cleanups
      - Don't try to handle broken PSCI firmware
      - More sys_reg() to reg_to_encoding() conversions
      615099b0
  3. Jan 21, 2021
  4. Jan 14, 2021
  5. Jan 11, 2021
    • Linus Torvalds's avatar
      Linux 5.11-rc3 · 7c53f6b6
      Linus Torvalds authored
      v5.11-rc3
      7c53f6b6
    • Linus Torvalds's avatar
      Merge tag 'kbuild-fixes-v5.11' of... · 20210a98
      Linus Torvalds authored
      Merge tag 'kbuild-fixes-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild
      
      Pull Kbuild fixes from Masahiro Yamada:
      
       - Search for <ncurses.h> in the default header path of HOSTCC
      
       - Tweak the option order to be kind to old BSD awk
      
       - Remove 'kvmconfig' and 'xenconfig' shorthands
      
       - Fix documentation
      
      * tag 'kbuild-fixes-v5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/masahiroy/linux-kbuild:
        Documentation: kbuild: Fix section reference
        kconfig: remove 'kvmconfig' and 'xenconfig' shorthands
        lib/raid6: Let $(UNROLL) rules work with macOS userland
        kconfig: Support building mconf with vendor sysroot ncurses
        kconfig: config script: add a little user help
        MAINTAINERS: adjust GCC PLUGINS after gcc-plugin.sh removal
      20210a98
    • Linus Torvalds's avatar
      Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi · 688daed2
      Linus Torvalds authored
      Pull SCSI fixes from James Bottomley:
       "This is two driver fixes (megaraid_sas and hisi_sas).
      
        The megaraid one is a revert of a previous revert of a cpu hotplug fix
        which exposed a bug in the block layer which has been fixed in this
        merge window.
      
        The hisi_sas performance enhancement comes from switching to interrupt
        managed completion queues, which depended on the addition of
        devm_platform_get_irqs_affinity() which is now upstream via the irq
        tree in the last merge window"
      
      * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi:
        scsi: hisi_sas: Expose HW queues for v2 hw
        Revert "Revert "scsi: megaraid_sas: Added support for shared host tagset for cpuhotplug""
      688daed2
    • Linus Torvalds's avatar
      Merge tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block · ed41fd07
      Linus Torvalds authored
      Pull block fixes from Jens Axboe:
      
       - Missing CRC32 selections (Arnd)
      
       - Fix for a merge window regression with bdev inode init (Christoph)
      
       - bcache fixes
      
       - rnbd fixes
      
       - NVMe pull request from Christoph:
          - fix a race in the nvme-tcp send code (Sagi Grimberg)
          - fix a list corruption in an nvme-rdma error path (Israel Rukshin)
          - avoid a possible double fetch in nvme-pci (Lalithambika Krishnakumar)
          - add the susystem NQN quirk for a Samsung driver (Gopal Tiwari)
          - fix two compiler warnings in nvme-fcloop (James Smart)
          - don't call sleeping functions from irq context in nvme-fc (James Smart)
          - remove an unused argument (Max Gurtovoy)
          - remove unused exports (Minwoo Im)
      
       - Use-after-free fix for partition iteration (Ming)
      
       - Missing blk-mq debugfs flag annotation (John)
      
       - Bdev freeze regression fix (Satya)
      
       - blk-iocost NULL pointer deref fix (Tejun)
      
      * tag 'block-5.11-2021-01-10' of git://git.kernel.dk/linux-block: (26 commits)
        bcache: set bcache device into read-only mode for BCH_FEATURE_INCOMPAT_OBSO_LARGE_BUCKET
        bcache: introduce BCH_FEATURE_INCOMPAT_LOG_LARGE_BUCKET_SIZE for large bucket
        bcache: check unsupported feature sets for bcache register
        bcache: fix typo from SUUP to SUPP in features.h
        bcache: set pdev_set_uuid before scond loop iteration
        blk-mq-debugfs: Add decode for BLK_MQ_F_TAG_HCTX_SHARED
        block/rnbd-clt: avoid module unload race with close confirmation
        block/rnbd: Adding name to the Contributors List
        block/rnbd-clt: Fix sg table use after free
        block/rnbd-srv: Fix use after free in rnbd_srv_sess_dev_force_close
        block/rnbd: Select SG_POOL for RNBD_CLIENT
        block: pre-initialize struct block_device in bdev_alloc_inode
        fs: Fix freeze_bdev()/thaw_bdev() accounting of bd_fsfreeze_sb
        nvme: remove the unused status argument from nvme_trace_bio_complete
        nvmet-rdma: Fix list_del corruption on queue establishment failure
        nvme: unexport functions with no external caller
        nvme: avoid possible double fetch in handling CQE
        nvme-tcp: Fix possible race of io_work and direct send
        nvme-pci: mark Samsung PM1725a as IGNORE_DEV_SUBNQN
        nvme-fcloop: Fix sscanf type and list_first_entry_or_null warnings
        ...
      ed41fd07
    • Linus Torvalds's avatar
      Merge tag 'io_uring-5.11-2021-01-10' of git://git.kernel.dk/linux-block · d430adfe
      Linus Torvalds authored
      Pull io_uring fixes from Jens Axboe:
       "A bit larger than I had hoped at this point, but it's all changes that
        will be directed towards stable anyway. In detail:
      
         - Fix a merge window regression on error return (Matthew)
      
         - Remove useless variable declaration/assignment (Ye Bin)
      
         - IOPOLL fixes (Pavel)
      
         - Exit and cancelation fixes (Pavel)
      
         - fasync lockdep complaint fix (Pavel)
      
         - Ensure SQPOLL is synchronized with creator life time (Pavel)"
      
      * tag 'io_uring-5.11-2021-01-10' of git://git.kernel.dk/linux-block:
        io_uring: stop SQPOLL submit on creator's death
        io_uring: add warn_once for io_uring_flush()
        io_uring: inline io_uring_attempt_task_drop()
        io_uring: io_rw_reissue lockdep annotations
        io_uring: synchronise ev_posted() with waitqueues
        io_uring: dont kill fasync under completion_lock
        io_uring: trigger eventfd for IOPOLL
        io_uring: Fix return value from alloc_fixed_file_ref_node
        io_uring: Delete useless variable ‘id’ in io_prep_async_work
        io_uring: cancel more aggressively in exit_work
        io_uring: drop file refs after task cancel
        io_uring: patch up IOPOLL overflow_flush sync
        io_uring: synchronise IOPOLL on task_submit fail
      d430adfe
    • Linus Torvalds's avatar
      Merge tag 'usb-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb · 28318f53
      Linus Torvalds authored
      Pull USB fixes from Greg KH:
       "Here are a number of small USB driver fixes for 5.11-rc3.
      
        Include in here are:
      
         - USB gadget driver fixes for reported issues
      
         - new usb-serial driver ids
      
         - dma from stack bugfixes
      
         - typec bugfixes
      
         - dwc3 bugfixes
      
         - xhci driver bugfixes
      
         - other small misc usb driver bugfixes
      
        All of these have been in linux-next with no reported issues"
      
      * tag 'usb-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb: (35 commits)
        usb: dwc3: gadget: Clear wait flag on dequeue
        usb: typec: Send uevent for num_altmodes update
        usb: typec: Fix copy paste error for NVIDIA alt-mode description
        usb: gadget: enable super speed plus
        kcov, usb: hide in_serving_softirq checks in __usb_hcd_giveback_urb
        usb: uas: Add PNY USB Portable SSD to unusual_uas
        usb: gadget: configfs: Preserve function ordering after bind failure
        usb: gadget: select CONFIG_CRC32
        usb: gadget: core: change the comment for usb_gadget_connect
        usb: gadget: configfs: Fix use-after-free issue with udc_name
        usb: dwc3: gadget: Restart DWC3 gadget when enabling pullup
        usb: usbip: vhci_hcd: protect shift size
        USB: usblp: fix DMA to stack
        USB: serial: iuu_phoenix: fix DMA from stack
        USB: serial: option: add LongSung M5710 module support
        USB: serial: option: add Quectel EM160R-GL
        USB: Gadget: dummy-hcd: Fix shift-out-of-bounds bug
        usb: gadget: f_uac2: reset wMaxPacketSize
        usb: dwc3: ulpi: Fix USB2.0 HS/FS/LS PHY suspend regression
        usb: dwc3: ulpi: Replace CPU-based busyloop with Protocol-based one
        ...
      28318f53
    • Linus Torvalds's avatar
      Merge tag 'staging-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging · 4ad9a28f
      Linus Torvalds authored
      Pull staging driver fixes from Greg KH:
       "Here are some small staging driver fixes for 5.11-rc3. Nothing major,
        just resolving some reported issues:
      
         - cleanup some remaining mentions of the ION drivers that were
           removed in 5.11-rc1
      
         - comedi driver bugfix
      
         - two error path memory leak fixes
      
        All have been in linux-next for a while with no reported issues"
      
      * tag 'staging-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/staging:
        staging: ION: remove some references to CONFIG_ION
        staging: mt7621-dma: Fix a resource leak in an error handling path
        Staging: comedi: Return -EFAULT if copy_to_user() fails
        staging: spmi: hisi-spmi-controller: Fix some error handling paths
      4ad9a28f
    • Linus Torvalds's avatar
      Merge tag 'char-misc-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc · e07cd2f3
      Linus Torvalds authored
      Pull char/misc driver fixes from Greg KH:
       "Here are some small char and misc driver fixes for 5.11-rc3.
      
        The majority here are fixes for the habanalabs drivers, but also in
        here are:
      
         - crypto driver fix
      
         - pvpanic driver fix
      
         - updated font file
      
         - interconnect driver fixes
      
        All of these have been in linux-next for a while with no reported
        issues"
      
      * tag 'char-misc-5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/gregkh/char-misc: (26 commits)
        Fonts: font_ter16x32: Update font with new upstream Terminus release
        misc: pvpanic: Check devm_ioport_map() for NULL
        speakup: Add github repository URL and bug tracker
        MAINTAINERS: Update Georgi's email address
        crypto: asym_tpm: correct zero out potential secrets
        habanalabs: Fix memleak in hl_device_reset
        interconnect: imx8mq: Use icc_sync_state
        interconnect: imx: Remove a useless test
        interconnect: imx: Add a missing of_node_put after of_device_is_available
        interconnect: qcom: fix rpmh link failures
        habanalabs: fix order of status check
        habanalabs: register to pci shutdown callback
        habanalabs: add validation cs counter, fix misplaced counters
        habanalabs/gaudi: retry loading TPC f/w on -EINTR
        habanalabs: adjust pci controller init to new firmware
        habanalabs: update comment in hl_boot_if.h
        habanalabs/gaudi: enhance reset message
        habanalabs: full FW hard reset support
        habanalabs/gaudi: disable CGM at HW initialization
        habanalabs: Revise comment to align with mirror list name
        ...
      e07cd2f3
    • Viresh Kumar's avatar
      Documentation: kbuild: Fix section reference · 5625dcfb
      Viresh Kumar authored
      
      
      Section 3.11 was incorrectly called 3.9, fix it.
      
      Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
      Signed-off-by: default avatarMasahiro Yamada <masahiroy@kernel.org>
      5625dcfb
    • Linus Torvalds's avatar
      Merge tag 'arc-5.11-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc · 0653161f
      Linus Torvalds authored
      Pull ARC fixes from Vineet Gupta:
      
       - Address the 2nd boot failure due to snafu in signal handling code
         (first was generic console ttynull issue)
      
       - misc other fixes
      
      * tag 'arc-5.11-rc3-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/vgupta/arc:
        ARC: [hsdk]: Enable FPU_SAVE_RESTORE
        ARC: unbork 5.11 bootup: fix snafu in _TIF_NOTIFY_SIGNAL handling
        include/soc: remove headers for EZChip NPS
        arch/arc: add copy_user_page() to <asm/page.h> to fix build error on ARC
      0653161f
    • Linus Torvalds's avatar
      Merge tag 'powerpc-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux · b3cd1a16
      Linus Torvalds authored
      Pull powerpc fixes from Michael Ellerman:
      
       - A fix for machine check handling with VMAP stack on 32-bit.
      
       - A clang build fix.
      
      Thanks to Christophe Leroy and Nathan Chancellor.
      
      * tag 'powerpc-5.11-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux:
        powerpc: Handle .text.{hot,unlikely}.* in linker script
        powerpc/32s: Fix RTAS machine check with VMAP stack
      b3cd1a16
    • Linus Torvalds's avatar
      Merge tag 'x86_urgent_for_v5.11_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip · a440e4d7
      Linus Torvalds authored
      Pull x86 fixes from Borislav Petkov:
       "As expected, fixes started trickling in after the holidays so here is
        the accumulated pile of x86 fixes for 5.11:
      
         - A fix for fanotify_mark() missing the conversion of x86_32 native
           syscalls which take 64-bit arguments to the compat handlers due to
           former having a general compat handler. (Brian Gerst)
      
         - Add a forgotten pmd page destructor call to pud_free_pmd_page()
           where a pmd page is freed. (Dan Williams)
      
         - Make IN/OUT insns with an u8 immediate port operand handling for
           SEV-ES guests more precise by using only the single port byte and
           not the whole s32 value of the insn decoder. (Peter Gonda)
      
         - Correct a straddling end range check before returning the proper
           MTRR type, when the end address is the same as top of memory.
           (Ying-Tsun Huang)
      
         - Change PQR_ASSOC MSR update scheme when moving a task to a resctrl
           resource group to avoid significant performance overhead with some
           resctrl workloads. (Fenghua Yu)
      
         - Avoid the actual task move overhead when the task is already in the
           resource group. (Fenghua Yu)"
      
      * tag 'x86_urgent_for_v5.11_rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/tip:
        x86/resctrl: Don't move a task to the same resource group
        x86/resctrl: Use an IPI instead of task_work_add() to update PQR_ASSOC MSR
        x86/mtrr: Correct the range check before performing MTRR type lookups
        x86/sev-es: Fix SEV-ES OUT/IN immediate opcode vc handling
        x86/mm: Fix leak of pmd ptlock
        fanotify: Fix sys_fanotify_mark() on native x86-32
      a440e4d7
  6. Jan 10, 2021
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v5.11-rc3' of... · 2ff90100
      Linus Torvalds authored
      Merge tag 'hwmon-for-v5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
      
       - Fix possible KASAN issue in amd_energy driver
      
       - Avoid configuration problem in pwm-fan driver
      
       - Fix kernel-doc warning in sbtsi_temp documentation
      
      * tag 'hwmon-for-v5.11-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (amd_energy) fix allocation of hwmon_channel_info config
        hwmon: (pwm-fan) Ensure that calculation doesn't discard big period values
        hwmon: (sbtsi_temp) Fix Documenation kernel-doc warning
      2ff90100
    • Linus Torvalds's avatar
      Merge tag 'dmaengine-fix-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine · f408126b
      Linus Torvalds authored
      Pull dmaengine fixes from Vinod Koul:
       "A bunch of dmaengine driver fixes for:
      
         - coverity discovered issues for xilinx driver
      
         - qcom, gpi driver fix for undefined bhaviour and one off cleanup
      
         - update Peter's email for TI DMA drivers
      
         - one-off for idxd driver
      
         - resource leak fix for mediatek and milbeaut drivers"
      
      * tag 'dmaengine-fix-5.11' of git://git.kernel.org/pub/scm/linux/kernel/git/vkoul/dmaengine:
        dmaengine: stm32-mdma: fix STM32_MDMA_VERY_HIGH_PRIORITY value
        dmaengine: xilinx_dma: fix mixed_enum_type coverity warning
        dmaengine: xilinx_dma: fix incompatible param warning in _child_probe()
        dmaengine: xilinx_dma: check dma_async_device_register return value
        dmaengine: qcom: fix gpi undefined behavior
        dt-bindings: dma: ti: Update maintainer and author information
        MAINTAINERS: Add entry for Texas Instruments DMA drivers
        qcom: bam_dma: Delete useless kfree code
        dmaengine: dw-edma: Fix use after free in dw_edma_alloc_chunk()
        dmaengine: milbeaut-xdmac: Fix a resource leak in the error handling path of the probe function
        dmaengine: mediatek: mtk-hsdma: Fix a resource leak in the error handling path of the probe function
        dmaengine: qcom: gpi: Fixes a format mismatch
        dmaengine: idxd: off by one in cleanup code
        dmaengine: ti: k3-udma: Fix pktdma rchan TPL level setup
      f408126b
    • Linus Torvalds's avatar
      Merge branch 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux · caab3147
      Linus Torvalds authored
      Pull i2c fixes from Wolfram Sang:
       "Three driver bugfixes for I2C. Buisness as usual"
      
      * 'i2c/for-current' of git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux:
        i2c: mediatek: Fix apdma and i2c hand-shake timeout
        i2c: i801: Fix the i2c-mux gpiod_lookup_table not being properly terminated
        i2c: sprd: use a specific timeout to avoid system hang up issue
      caab3147
    • Darrick J. Wong's avatar
      maintainers: update my email address · 6bae85bd
      Darrick J. Wong authored
      
      
      Change my email contact ahead of a likely painful eleven-month migration
      to a certain cobalt enteprisey groupware cloud product that will totally
      break my workflow.  Some day I may get used to having to email being
      sequestered behind both claret and cerulean oath2+sms 2fa layers, but
      for now I'll stick with keying in one password to receive an email vs.
      the required four.
      
      Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6bae85bd
    • Pavel Begunkov's avatar
      io_uring: stop SQPOLL submit on creator's death · d9d05217
      Pavel Begunkov authored
      When the creator of SQPOLL io_uring dies (i.e. sqo_task), we don't want
      its internals like ->files and ->mm to be poked by the SQPOLL task, it
      have never been nice and recently got racy. That can happen when the
      owner undergoes destruction and SQPOLL tasks tries to submit new
      requests in parallel, and so calls io_sq_thread_acquire*().
      
      That patch halts SQPOLL submissions when sqo_task dies by introducing
      sqo_dead flag. Once set, the SQPOLL task must not do any submission,
      which is synchronised by uring_lock as well as the new flag.
      
      The tricky part is to make sure that disabling always happens, that
      means either the ring is discovered by creator's do_exit() -> cancel,
      or if the final close() happens before it's done by the creator. The
      last is guaranteed by the fact that for SQPOLL the creator task and only
      it holds exactly one file note, so either it pins up to do_exit() or
      removed by the creator on the final put in flush. (see comments in
      uring_flush() around file->f_count == 2).
      
      One more place that can trigger io_sq_thread_acquire_*() is
      __io_req_task_submit(). Shoot off requests on sqo_dead there, even
      though actually we don't need to. That's because cancellation of
      sqo_task should wait for the request before going any further.
      
      note 1: io_disable_sqo_submit() does io_ring_set_wakeup_flag() so the
      caller would enter the ring to get an error, but it still doesn't
      guarantee that the flag won't be cleared.
      
      note 2: if final __userspace__ close happens not from the creator
      task, the file note will pin the ring until the task dies.
      
      Fixed: b1b6b5a3
      
       ("kernel/io_uring: cancel io_uring before task works")
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      d9d05217
    • Pavel Begunkov's avatar
      io_uring: add warn_once for io_uring_flush() · 6b5733eb
      Pavel Begunkov authored
      
      
      files_cancel() should cancel all relevant requests and drop file notes,
      so we should never have file notes after that, including on-exit fput
      and flush. Add a WARN_ONCE to be sure.
      
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      6b5733eb
    • Pavel Begunkov's avatar
      io_uring: inline io_uring_attempt_task_drop() · 4f793dc4
      Pavel Begunkov authored
      
      
      A simple preparation change inlining io_uring_attempt_task_drop() into
      io_uring_flush().
      
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      4f793dc4
    • Pavel Begunkov's avatar
      io_uring: io_rw_reissue lockdep annotations · 55e6ac1e
      Pavel Begunkov authored
      
      
      We expect io_rw_reissue() to take place only during submission with
      uring_lock held. Add a lockdep annotation to check that invariant.
      
      Signed-off-by: default avatarPavel Begunkov <asml.silence@gmail.com>
      Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
      55e6ac1e