Skip to content
  1. Jan 29, 2022
    • Linus Torvalds's avatar
      Merge tag 'efi-urgent-for-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi · 073819e0
      Linus Torvalds authored
      Pull EFI fixes from Ard Biesheuvel:
      
       - avoid UEFI v2.00+ runtime services on Apple Mac systems, as they have
         been reported to cause crashes, and most Macs claim to be EFI v1.10
         anyway
      
       - avoid a spurious boot time warning on arm64 systems with 64k pages
      
      * tag 'efi-urgent-for-v5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/efi/efi:
        efi: runtime: avoid EFIv2 runtime services on Apple x86 machines
        efi/libstub: arm64: Fix image check alignment at entry
      073819e0
    • Linus Torvalds's avatar
      Merge tag 'pm-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm · a7b4b007
      Linus Torvalds authored
      Pull power management fixes from Rafael Wysocki:
       "These make the buffer handling in pm_show_wakelocks() more robust and
        drop an unused hibernation-related function.
      
        Specifics:
      
         - Make the buffer handling in pm_show_wakelocks() more robust by
           using sysfs_emit_at() in it to generate output (Greg
           Kroah-Hartman).
      
         - Drop register_nosave_region_late() which is not used (Amadeusz
           Sławiński)"
      
      * tag 'pm-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/rafael/linux-pm:
        PM: hibernate: Remove register_nosave_region_late()
        PM: wakeup: simplify the output logic of pm_show_wakelocks()
      a7b4b007
    • Linus Torvalds's avatar
      Merge tag 'trace-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace · df000154
      Linus Torvalds authored
      Pulltracing fixes from Steven Rostedt:
      
       - Limit mcount build time sorting to only those archs that we know it
         works for.
      
       - Fix memory leak in error path of histogram setup
      
       - Fix and clean up rel_loc array out of bounds issue
      
       - tools/rtla documentation fixes
      
       - Fix issues with histogram logic
      
      * tag 'trace-v5.17-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace:
        tracing: Don't inc err_log entry count if entry allocation fails
        tracing: Propagate is_signed to expression
        tracing: Fix smatch warning for do while check in event_hist_trigger_parse()
        tracing: Fix smatch warning for null glob in event_hist_trigger_parse()
        tools/tracing: Update Makefile to build rtla
        rtla: Make doc build optional
        tracing/perf: Avoid -Warray-bounds warning for __rel_loc macro
        tracing: Avoid -Warray-bounds warning for __rel_loc macro
        tracing/histogram: Fix a potential memory leak for kstrdup()
        ftrace: Have architectures opt-in for mcount build time sorting
      df000154
    • Linus Torvalds's avatar
      Merge branch 'ucount-rlimit-fixes-for-v5.17-rc2' of... · 76fcbc9c
      Linus Torvalds authored
      Merge branch 'ucount-rlimit-fixes-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace
      
      Pull ucount rlimit fix from Eric Biederman.
      
      Make sure the ucounts have a reference to the user namespace it refers
      to, so that users that themselves don't carry such a reference around
      can safely use the ucount functions.
      
      * 'ucount-rlimit-fixes-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/ebiederm/user-namespace:
        ucount:  Make get_ucount a safe get_user replacement
      76fcbc9c
    • Linus Torvalds's avatar
      Merge tag 'rcu-urgent.2022.01.26a' of... · a773abf7
      Linus Torvalds authored
      Merge tag 'rcu-urgent.2022.01.26a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu
      
      Pull RCU fix from Paul McKenney:
       "This fixes a brown-paper-bag bug in RCU tasks that causes things like
        BPF and ftrace to fail miserably on systems with non-power-of-two
        numbers of CPUs.
      
        It fixes a math error added in 7a30871b ("rcu-tasks: Introduce
        ->percpu_enqueue_shift for dynamic queue selection') during the v5.17
        merge window. This commit works correctly only on systems with a
        power-of-two number of CPUs, which just so happens to be the kind that
        rcutorture always uses by default.
      
        This pull request fixes the math so that things also work on systems
        that don't happen to have a power-of-two number of CPUs"
      
      * tag 'rcu-urgent.2022.01.26a' of git://git.kernel.org/pub/scm/linux/kernel/git/paulmck/linux-rcu:
        rcu-tasks: Fix computation of CPU-to-list shift counts
      a773abf7
    • Linus Torvalds's avatar
      Merge tag 'hyperv-fixes-signed-20220128' of... · 56a14c69
      Linus Torvalds authored
      Merge tag 'hyperv-fixes-signed-20220128' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux
      
      Pull hyperv fixes from Wei Liu:
      
       - Fix screen resolution for hyperv framebuffer (Michael Kelley)
      
       - Fix packet header accounting for balloon driver (Yanming Liu)
      
      * tag 'hyperv-fixes-signed-20220128' of git://git.kernel.org/pub/scm/linux/kernel/git/hyperv/linux:
        video: hyperv_fb: Fix validation of screen resolution
        Drivers: hv: balloon: account for vmbus packet header in max_pkt_size
      56a14c69
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 3cd7cd8a
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "Two larger x86 series:
      
         - Redo incorrect fix for SEV/SMAP erratum
      
         - Windows 11 Hyper-V workaround
      
        Other x86 changes:
      
         - Various x86 cleanups
      
         - Re-enable access_tracking_perf_test
      
         - Fix for #GP handling on SVM
      
         - Fix for CPUID leaf 0Dh in KVM_GET_SUPPORTED_CPUID
      
         - Fix for ICEBP in interrupt shadow
      
         - Avoid false-positive RCU splat
      
         - Enable Enlightened MSR-Bitmap support for real
      
        ARM:
      
         - Correctly update the shadow register on exception injection when
           running in nVHE mode
      
         - Correctly use the mm_ops indirection when performing cache
           invalidation from the page-table walker
      
         - Restrict the vgic-v3 workaround for SEIS to the two known broken
           implementations
      
        Generic code changes:
      
         - Dead code cleanup"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm: (43 commits)
        KVM: eventfd: Fix false positive RCU usage warning
        KVM: nVMX: Allow VMREAD when Enlightened VMCS is in use
        KVM: nVMX: Implement evmcs_field_offset() suitable for handle_vmread()
        KVM: nVMX: Rename vmcs_to_field_offset{,_table}
        KVM: nVMX: eVMCS: Filter out VM_EXIT_SAVE_VMX_PREEMPTION_TIMER
        KVM: nVMX: Also filter MSR_IA32_VMX_TRUE_PINBASED_CTLS when eVMCS
        selftests: kvm: check dynamic bits against KVM_X86_XCOMP_GUEST_SUPP
        KVM: x86: add system attribute to retrieve full set of supported xsave states
        KVM: x86: Add a helper to retrieve userspace address from kvm_device_attr
        selftests: kvm: move vm_xsave_req_perm call to amx_test
        KVM: x86: Sync the states size with the XCR0/IA32_XSS at, any time
        KVM: x86: Update vCPU's runtime CPUID on write to MSR_IA32_XSS
        KVM: x86: Keep MSR_IA32_XSS unchanged for INIT
        KVM: x86: Free kvm_cpuid_entry2 array on post-KVM_RUN KVM_SET_CPUID{,2}
        KVM: nVMX: WARN on any attempt to allocate shadow VMCS for vmcs02
        KVM: selftests: Don't skip L2's VMCALL in SMM test for SVM guest
        KVM: x86: Check .flags in kvm_cpuid_check_equal() too
        KVM: x86: Forcibly leave nested virt when SMM state is toggled
        KVM: SVM: drop unnecessary code in svm_hv_vmcb_dirty_nested_enlightenments()
        KVM: SVM: hyper-v: Enable Enlightened MSR-Bitmap support for real
        ...
      3cd7cd8a
    • Linus Torvalds's avatar
      Merge tag 'mips-fixes-5.17_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux · e0152705
      Linus Torvalds authored
      Pull MIPS build fix from Thomas Bogendoerfer:
       "Fix for allmodconfig build"
      
      * tag 'mips-fixes-5.17_1' of git://git.kernel.org/pub/scm/linux/kernel/git/mips/linux:
        MIPS: Fix build error due to PTR used in more places
      e0152705
    • Linus Torvalds's avatar
      Merge tag 's390-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux · 7eb36254
      Linus Torvalds authored
      Pull s390 fixes from Vasily Gorbik:
      
       - Fix loading of modules with lots of relocations and add a regression
         test for it.
      
       - Fix machine check handling for vector validity and guarded storage
         validity failures in KVM guests.
      
       - Fix hypervisor performance data to include z/VM guests with access
         control group set.
      
       - Fix z900 build problem in uaccess code.
      
       - Update defconfigs.
      
      * tag 's390-5.17-3' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux:
        s390/hypfs: include z/VM guests with access control group set
        s390: update defconfigs
        s390/module: test loading modules with a lot of relocations
        s390/module: fix loading modules with a lot of relocations
        s390/uaccess: fix compile error
        s390/nmi: handle vector validity failures for KVM guests
        s390/nmi: handle guarded storage validity failures for KVM guests
      7eb36254
    • Linus Torvalds's avatar
      Merge tag 'ceph-for-5.17-rc2' of git://github.com/ceph/ceph-client · 8157f470
      Linus Torvalds authored
      Pull ceph fixes from Ilya Dryomov:
       "A ZERO_SIZE_PTR dereference fix from Xiubo and two fixes for async
        creates interacting with pool namespace-constrained OSD permissions
        from Jeff (marked for stable)"
      
      * tag 'ceph-for-5.17-rc2' of git://github.com/ceph/ceph-client:
        ceph: set pool_ns in new inode layout for async creates
        ceph: properly put ceph_string reference after async create attempt
        ceph: put the requests/sessions when it fails to alloc memory
      8157f470
    • Linus Torvalds's avatar
      ocfs2: fix subdirectory registration with register_sysctl() · f6a26318
      Linus Torvalds authored
      The kernel test robot reports that commit c42ff46f ("ocfs2: simplify
      subdirectory registration with register_sysctl()") is broken, and
      results in kernel warning messages like
      
        sysctl table check failed: fs/ocfs2/nm Not a file
        sysctl table check failed: fs/ocfs2/nm No proc_handler
        sysctl table check failed: fs/ocfs2/nm bogus .mode 0555
      
      and in fact this was already reported back in linux-next, but nobody
      seems to have reacted to that report.  Possibly that original report
      only ever made it to the lkp list.
      
      The problem seems to be that the simplification didn't actually go far
      enough, and should have converted the whole directory path to the final
      sysctl file, rather than just the two first components.
      
      So take that last step.
      
      Fixes: c42ff46f
      
       ("ocfs2: simplify subdirectory registration with register_sysctl()")
      Reported-by: default avatarkernel test robot <oliver.sang@intel.com>
      Link: https://lore.kernel.org/all/20220128065310.GF8421@xsang-OptiPlex-9020/
      Link: https://lists.01.org/hyperkitty/list/lkp@lists.01.org/thread/KQ2F6TPJWMDVEXJM4WTUC4DU3EH3YJVT/
      Tested-by: default avatarJan Kara <jack@suse.cz>
      Reviewed-by: default avatarJan Kara <jack@suse.cz>
      Cc: Luis Chamberlain <mcgrof@kernel.org>
      Cc: Andrew Morton <akpm@linux-foundation.org>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      f6a26318
  2. Jan 28, 2022
    • Linus Torvalds's avatar
      Merge tag 'fsnotify_for_v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · 4897e722
      Linus Torvalds authored
      Pull fsnotify fixes from Jan Kara:
       "Fixes for userspace breakage caused by fsnotify changes ~3 years ago
        and one fanotify cleanup"
      
      * tag 'fsnotify_for_v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        fsnotify: fix fsnotify hooks in pseudo filesystems
        fsnotify: invalidate dcache before IN_DELETE event
        fanotify: remove variable set but not used
      4897e722
    • Linus Torvalds's avatar
      Merge tag 'fs_for_v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs · c2b19fd7
      Linus Torvalds authored
      Pull udf and quota fixes from Jan Kara:
       "Fixes for crashes in UDF when inode expansion fails and one quota
        cleanup"
      
      * tag 'fs_for_v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/jack/linux-fs:
        quota: cleanup double word in comment
        udf: Restore i_lenAlloc when inode expansion fails
        udf: Fix NULL ptr deref when converting from inline format
      c2b19fd7
    • Paolo Bonzini's avatar
      Merge tag 'kvmarm-fixes-5.17-1' of... · 17179d00
      Paolo Bonzini authored
      Merge tag 'kvmarm-fixes-5.17-1' of git://git.kernel.org/pub/scm/linux/kernel/git/kvmarm/kvmarm into HEAD
      
      KVM/arm64 fixes for 5.17, take #1
      
      - Correctly update the shadow register on exception injection when
        running in nVHE mode
      
      - Correctly use the mm_ops indirection when performing cache invalidation
        from the page-table walker
      
      - Restrict the vgic-v3 workaround for SEIS to the two known broken
        implementations
      17179d00
    • Hou Wenlong's avatar
      KVM: eventfd: Fix false positive RCU usage warning · 6a0c6170
      Hou Wenlong authored
      
      
      Fix the following false positive warning:
       =============================
       WARNING: suspicious RCU usage
       5.16.0-rc4+ #57 Not tainted
       -----------------------------
       arch/x86/kvm/../../../virt/kvm/eventfd.c:484 RCU-list traversed in non-reader section!!
      
       other info that might help us debug this:
      
       rcu_scheduler_active = 2, debug_locks = 1
       3 locks held by fc_vcpu 0/330:
        #0: ffff8884835fc0b0 (&vcpu->mutex){+.+.}-{3:3}, at: kvm_vcpu_ioctl+0x88/0x6f0 [kvm]
        #1: ffffc90004c0bb68 (&kvm->srcu){....}-{0:0}, at: vcpu_enter_guest+0x600/0x1860 [kvm]
        #2: ffffc90004c0c1d0 (&kvm->irq_srcu){....}-{0:0}, at: kvm_notify_acked_irq+0x36/0x180 [kvm]
      
       stack backtrace:
       CPU: 26 PID: 330 Comm: fc_vcpu 0 Not tainted 5.16.0-rc4+
       Hardware name: QEMU Standard PC (Q35 + ICH9, 2009), BIOS rel-1.14.0-0-g155821a1990b-prebuilt.qemu.org 04/01/2014
       Call Trace:
        <TASK>
        dump_stack_lvl+0x44/0x57
        kvm_notify_acked_gsi+0x6b/0x70 [kvm]
        kvm_notify_acked_irq+0x8d/0x180 [kvm]
        kvm_ioapic_update_eoi+0x92/0x240 [kvm]
        kvm_apic_set_eoi_accelerated+0x2a/0xe0 [kvm]
        handle_apic_eoi_induced+0x3d/0x60 [kvm_intel]
        vmx_handle_exit+0x19c/0x6a0 [kvm_intel]
        vcpu_enter_guest+0x66e/0x1860 [kvm]
        kvm_arch_vcpu_ioctl_run+0x438/0x7f0 [kvm]
        kvm_vcpu_ioctl+0x38a/0x6f0 [kvm]
        __x64_sys_ioctl+0x89/0xc0
        do_syscall_64+0x3a/0x90
        entry_SYSCALL_64_after_hwframe+0x44/0xae
      
      Since kvm_unregister_irq_ack_notifier() does synchronize_srcu(&kvm->irq_srcu),
      kvm->irq_ack_notifier_list is protected by kvm->irq_srcu. In fact,
      kvm->irq_srcu SRCU read lock is held in kvm_notify_acked_irq(), making it
      a false positive warning. So use hlist_for_each_entry_srcu() instead of
      hlist_for_each_entry_rcu().
      
      Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarHou Wenlong <houwenlong93@linux.alibaba.com>
      Message-Id: <f98bac4f5052bad2c26df9ad50f7019e40434512.1643265976.git.houwenlong.hwl@antgroup.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6a0c6170
    • Vitaly Kuznetsov's avatar
      KVM: nVMX: Allow VMREAD when Enlightened VMCS is in use · 6cbbaab6
      Vitaly Kuznetsov authored
      
      
      Hyper-V TLFS explicitly forbids VMREAD and VMWRITE instructions when
      Enlightened VMCS interface is in use:
      
      "Any VMREAD or VMWRITE instructions while an enlightened VMCS is
      active is unsupported and can result in unexpected behavior.""
      
      Windows 11 + WSL2 seems to ignore this, attempts to VMREAD VMCS field
      0x4404 ("VM-exit interruption information") are observed. Failing
      these attempts with nested_vmx_failInvalid() makes such guests
      unbootable.
      
      Microsoft confirms this is a Hyper-V bug and claims that it'll get fixed
      eventually but for the time being we need a workaround. (Temporary) allow
      VMREAD to get data from the currently loaded Enlightened VMCS.
      
      Note: VMWRITE instructions remain forbidden, it is not clear how to
      handle them properly and hopefully won't ever be needed.
      
      Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20220112170134.1904308-6-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      6cbbaab6
    • Vitaly Kuznetsov's avatar
      KVM: nVMX: Implement evmcs_field_offset() suitable for handle_vmread() · 892a42c1
      Vitaly Kuznetsov authored
      
      
      In preparation to allowing reads from Enlightened VMCS from
      handle_vmread(), implement evmcs_field_offset() to get the correct
      read offset. get_evmcs_offset(), which is being used by KVM-on-Hyper-V,
      is almost what's needed but a few things need to be adjusted. First,
      WARN_ON() is unacceptable for handle_vmread() as any field can (in
      theory) be supplied by the guest and not all fields are defined in
      eVMCS v1. Second, we need to handle 'holes' in eVMCS (missing fields).
      It also sounds like a good idea to WARN_ON() if such fields are ever
      accessed by KVM-on-Hyper-V.
      
      Implement dedicated evmcs_field_offset() helper.
      
      No functional change intended.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20220112170134.1904308-5-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      892a42c1
    • Vitaly Kuznetsov's avatar
      KVM: nVMX: Rename vmcs_to_field_offset{,_table} · 2423a4c0
      Vitaly Kuznetsov authored
      
      
      vmcs_to_field_offset{,_table} may sound misleading as VMCS is an opaque
      blob which is not supposed to be accessed directly. In fact,
      vmcs_to_field_offset{,_table} are related to KVM defined VMCS12 structure.
      
      Rename vmcs_field_to_offset() to get_vmcs12_field_offset() for clarity.
      
      No functional change intended.
      
      Reviewed-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20220112170134.1904308-4-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      2423a4c0
    • Vitaly Kuznetsov's avatar
      KVM: nVMX: eVMCS: Filter out VM_EXIT_SAVE_VMX_PREEMPTION_TIMER · 7a601e2c
      Vitaly Kuznetsov authored
      
      
      Enlightened VMCS v1 doesn't have VMX_PREEMPTION_TIMER_VALUE field,
      PIN_BASED_VMX_PREEMPTION_TIMER is also filtered out already so it makes
      sense to filter out VM_EXIT_SAVE_VMX_PREEMPTION_TIMER too.
      
      Note, none of the currently existing Windows/Hyper-V versions are known
      to enable 'save VMX-preemption timer value' when eVMCS is in use, the
      change is aimed at making the filtering future proof.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20220112170134.1904308-3-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      7a601e2c
    • Vitaly Kuznetsov's avatar
      KVM: nVMX: Also filter MSR_IA32_VMX_TRUE_PINBASED_CTLS when eVMCS · f80ae0ef
      Vitaly Kuznetsov authored
      
      
      Similar to MSR_IA32_VMX_EXIT_CTLS/MSR_IA32_VMX_TRUE_EXIT_CTLS,
      MSR_IA32_VMX_ENTRY_CTLS/MSR_IA32_VMX_TRUE_ENTRY_CTLS pair,
      MSR_IA32_VMX_TRUE_PINBASED_CTLS needs to be filtered the same way
      MSR_IA32_VMX_PINBASED_CTLS is currently filtered as guests may solely rely
      on 'true' MSR data.
      
      Note, none of the currently existing Windows/Hyper-V versions are known
      to stumble upon the unfiltered MSR_IA32_VMX_TRUE_PINBASED_CTLS, the change
      is aimed at making the filtering future proof.
      
      Signed-off-by: default avatarVitaly Kuznetsov <vkuznets@redhat.com>
      Message-Id: <20220112170134.1904308-2-vkuznets@redhat.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      f80ae0ef
    • Paolo Bonzini's avatar
      selftests: kvm: check dynamic bits against KVM_X86_XCOMP_GUEST_SUPP · b19c99b9
      Paolo Bonzini authored
      
      
      Provide coverage for the new API.
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      b19c99b9
    • Paolo Bonzini's avatar
      KVM: x86: add system attribute to retrieve full set of supported xsave states · dd6e6312
      Paolo Bonzini authored
      
      
      Because KVM_GET_SUPPORTED_CPUID is meant to be passed (by simple-minded
      VMMs) to KVM_SET_CPUID2, it cannot include any dynamic xsave states that
      have not been enabled.  Probing those, for example so that they can be
      passed to ARCH_REQ_XCOMP_GUEST_PERM, requires a new ioctl or arch_prctl.
      The latter is in fact worse, even though that is what the rest of the
      API uses, because it would require supported_xcr0 to be moved from the
      KVM module to the kernel just for this use.  In addition, the value
      would be nonsensical (or an error would have to be returned) until
      the KVM module is loaded in.
      
      Therefore, to limit the growth of system ioctls, add a /dev/kvm
      variant of KVM_{GET,HAS}_DEVICE_ATTR, and implement it in x86
      with just one group (0) and attribute (KVM_X86_XCOMP_GUEST_SUPP).
      
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      dd6e6312
    • Sean Christopherson's avatar
      KVM: x86: Add a helper to retrieve userspace address from kvm_device_attr · 56f289a8
      Sean Christopherson authored
      
      
      Add a helper to handle converting the u64 userspace address embedded in
      struct kvm_device_attr into a userspace pointer, it's all too easy to
      forget the intermediate "unsigned long" cast as well as the truncation
      check.
      
      No functional change intended.
      
      Signed-off-by: default avatarSean Christopherson <seanjc@google.com>
      Signed-off-by: default avatarPaolo Bonzini <pbonzini@redhat.com>
      56f289a8
    • Linus Torvalds's avatar
      Merge tag 'ata-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata · 145d9b49
      Linus Torvalds authored
      Pull ATA fix from Damien Le Moal:
       "A single fix for 5.17-rc2, adding a missing resource allocation error
        check in the pata_platform driver, from Zhou"
      
      * tag 'ata-5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/dlemoal/libata:
        ata: pata_platform: Fix a NULL pointer dereference in __pata_platform_probe()
      145d9b49
    • Linus Torvalds's avatar
      Merge tag 'hwmon-for-v5.17-rc2' of... · 374630e3
      Linus Torvalds authored
      Merge tag 'hwmon-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging
      
      Pull hwmon fixes from Guenter Roeck:
      
       - Fix crash in nct6775 driver
      
       - Prevent divide by zero in adt7470 driver
      
       - Fix conditional compile warning in pmbus/ir38064 driver
      
       - Various minor fixes in lm90 driver
      
      * tag 'hwmon-for-v5.17-rc2' of git://git.kernel.org/pub/scm/linux/kernel/git/groeck/linux-staging:
        hwmon: (nct6775) Fix crash in clear_caseopen
        hwmon: (adt7470) Prevent divide by zero in adt7470_fan_write()
        hwmon: (pmbus/ir38064) Mark ir38064_of_match as __maybe_unused
        hwmon: (lm90) Fix sysfs and udev notifications
        hwmon: (lm90) Mark alert as broken for MAX6646/6647/6649
        hwmon: (lm90) Mark alert as broken for MAX6680
        hwmon: (lm90) Mark alert as broken for MAX6654
        hwmon: (lm90) Re-enable interrupts after alert clears
        hwmon: (lm90) Reduce maximum conversion rate for G781
      374630e3
    • Linus Torvalds's avatar
      Merge tag 'drm-fixes-2022-01-28' of git://anongit.freedesktop.org/drm/drm · 82b550fa
      Linus Torvalds authored
      Pull drm fixes from Dave Airlie:
       "This week's regular normal fixes. amdgpu and msm make up the bulk of
        it, with a scattering of fixes elsewhere.
      
        atomic:
         - fix CRTC handling during modeset
      
        privcy-screen:
         - honor acpi=off
      
        ttm:
         - build fix for um
      
        panel:
         - add orientation quirk for 1NetBook OneXPlayer
      
        amdgpu:
         - Proper fix for otg synchronization logic regression
         - DCN3.01 fixes
         - Filter out secondary radeon PCI IDs
         - udelay fixes
         - Fix a memory leak in an error path
      
        msm:
         - parameter check fixes
         - put_device balancing
         - idle/suspend fixes
      
        etnaviv:
         - relax submit size checks
      
        vc4:
         - fix potential deadlock in DSI code
      
        ast:
         - revert 1600x900 mode change"
      
      * tag 'drm-fixes-2022-01-28' of git://anongit.freedesktop.org/drm/drm: (25 commits)
        drm/privacy-screen: honor acpi=off in detect_thinkpad_privacy_screen
        Revert "drm/ast: Support 1600x900 with 108MHz PCLK"
        drm/amdgpu/display: Remove t_srx_delay_us.
        drm/amd/display: Wrap dcn301_calculate_wm_and_dlg for FPU.
        drm/amd/display: Fix FP start/end for dcn30_internal_validate_bw.
        drm/amd/display/dc/calcs/dce_calcs: Fix a memleak in calculate_bandwidth()
        drm/amdgpu/display: use msleep rather than udelay for long delays
        drm/amdgpu/display: adjust msleep limit in dp_wait_for_training_aux_rd_interval
        drm/amdgpu: filter out radeon secondary ids as well
        drm/amd/display: change FIFO reset condition to embedded display only
        drm/amd/display: Correct MPC split policy for DCN301
        drm/amd/display: Fix for otg synchronization logic
        drm/etnaviv: relax submit size limits
        drm/msm/gpu: Cancel idle/boost work on suspend
        drm/msm/gpu: Wait for idle before suspending
        drm/atomic: Add the crtc to affected crtc only if uapi.enable = true
        drm/msm/dsi: invalid parameter check in msm_dsi_phy_enable
        drm/msm/a6xx: Add missing suspend_count increment
        drm/msm: Fix wrong size calculation
        drm/msm/dpu: invalid parameter check in dpu_setup_dspp_pcc
        ...
      82b550fa
    • Dave Airlie's avatar
      Merge tag 'amd-drm-fixes-5.17-2022-01-26' of... · db5aa149
      Dave Airlie authored
      
      Merge tag 'amd-drm-fixes-5.17-2022-01-26' of https://gitlab.freedesktop.org/agd5f/linux into drm-fixes
      
      amd-drm-fixes-5.17-2022-01-26:
      
      amdgpu:
      - Proper fix for otg synchronization logic regression
      - DCN3.01 fixes
      - Filter out secondary radeon PCI IDs
      - udelay fixes
      - Fix a memory leak in an error path
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Alex Deucher <alexander.deucher@amd.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/20220127041006.5695-1-alexander.deucher@amd.com
      db5aa149
    • Dave Airlie's avatar
      Merge branch 'etnaviv/fixes' of https://git.pengutronix.de/git/lst/linux into drm-fixes · b1d83f4c
      Dave Airlie authored
      
      
      - relax submit size checks.
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Lucas Stach <l.stach@pengutronix.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/8c2cb3e3a702be86db9d43ca8927b6b78ac2b1d2.camel@pengutronix.de
      b1d83f4c
    • Dave Airlie's avatar
      Merge tag 'drm-msm-fixes-2022-01-25' of https://gitlab.freedesktop.org/drm/msm into drm-fixes · 52fa904e
      Dave Airlie authored
      
      
      A few msm fixes.
      - parameter checks
      - put_device balancing
      - idle/suspend fixes
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      From: Rob Clark <robdclark@gmail.com>
      Link: https://patchwork.freedesktop.org/patch/msgid/CAF6AEGvAfsgtr==VM4wixAC_hSTuV=eNWXxX=BhZqQrbxHjKgg@mail.gmail.com
      52fa904e
    • Dave Airlie's avatar
      Merge tag 'drm-misc-fixes-2022-01-27' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes · 2fd0e5fb
      Dave Airlie authored
      
      
       * drm/ast: Revert 1600x800 with 108MHz PCLK
       * drm/atomic: fix CRTC handling during modeset
       * drm/privacy-screen: Honor acpi=off
       * drm/ttm: build fix for ARCH=um
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/YfJgH9fz+oo7YSXd@linux-uq9g.fritz.box
      2fd0e5fb
    • Dave Airlie's avatar
      Merge tag 'drm-misc-next-fixes-2022-01-21' of... · 23ecd4c1
      Dave Airlie authored
      
      Merge tag 'drm-misc-next-fixes-2022-01-21' of git://anongit.freedesktop.org/drm/drm-misc into drm-fixes
      
       * vc4: Fix potential deadlock in DSI code
       * panel: Add orientation quirk for 1Netbook OneXPlayer
      
      Signed-off-by: default avatarDave Airlie <airlied@redhat.com>
      
      From: Thomas Zimmermann <tzimmermann@suse.de>
      Link: https://patchwork.freedesktop.org/patch/msgid/Yepuhj+Ks+IyJ9Dp@linux-uq9g
      23ecd4c1
    • Tom Zanussi's avatar
      tracing: Don't inc err_log entry count if entry allocation fails · 67ab5eb7
      Tom Zanussi authored
      tr->n_err_log_entries should only be increased if entry allocation
      succeeds.
      
      Doing it when it fails won't cause any problems other than wasting an
      entry, but should be fixed anyway.
      
      Link: https://lkml.kernel.org/r/cad1ab28f75968db0f466925e7cba5970cec6c29.1643319703.git.zanussi@kernel.org
      
      Cc: stable@vger.kernel.org
      Fixes: 2f754e77
      
       ("tracing: Don't inc err_log entry count if entry allocation fails")
      Signed-off-by: default avatarTom Zanussi <zanussi@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      67ab5eb7
    • Tom Zanussi's avatar
      tracing: Propagate is_signed to expression · 097f1eef
      Tom Zanussi authored
      During expression parsing, a new expression field is created which
      should inherit the properties of the operands, such as size and
      is_signed.
      
      is_signed propagation was missing, causing spurious errors with signed
      operands.  Add it in parse_expr() and parse_unary() to fix the problem.
      
      Link: https://lkml.kernel.org/r/f4dac08742fd7a0920bf80a73c6c44042f5eaa40.1643319703.git.zanussi@kernel.org
      
      Cc: stable@vger.kernel.org
      Fixes: 100719dc
      
       ("tracing: Add simple expression support to hist triggers")
      Reported-by: default avatarYordan Karadzhov <ykaradzhov@vmware.com>
      BugLink: https://bugzilla.kernel.org/show_bug.cgi?id=215513
      Signed-off-by: default avatarTom Zanussi <zanussi@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      097f1eef
    • Tom Zanussi's avatar
      tracing: Fix smatch warning for do while check in event_hist_trigger_parse() · b59f2f2b
      Tom Zanussi authored
      The patch ec5ce098: "tracing: Allow whitespace to surround hist
      trigger filter" from Jan 15, 2018, leads to the following Smatch
      static checker warning:
      
          kernel/trace/trace_events_hist.c:6199 event_hist_trigger_parse()
          warn: 'p' can't be NULL.
      
      Since p is always checked for a NULL value at the top of loop and
      nothing in the rest of the loop will set it to NULL, the warning
      is correct and might as well be 1 to silence the warning.
      
      Link: https://lkml.kernel.org/r/a1d4c79766c0cf61e20438dc35244d216633fef6.1643319703.git.zanussi@kernel.org
      
      Fixes: ec5ce098
      
       ("tracing: Allow whitespace to surround hist trigger filter")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarTom Zanussi <zanussi@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      b59f2f2b
    • Tom Zanussi's avatar
      tracing: Fix smatch warning for null glob in event_hist_trigger_parse() · 798a5b6c
      Tom Zanussi authored
      The recent rename of event_hist_trigger_parse() caused smatch
      re-evaluation of trace_events_hist.c and as a result an old warning
      was found:
      
          kernel/trace/trace_events_hist.c:6174 event_hist_trigger_parse()
          error: we previously assumed 'glob' could be null (see line 6166)
      
      glob should never be null (and apparently smatch can also figure that
      out and skip the warning when using the cross-function DB (but which
      can't be used with a 0day build as it takes too much time to
      generate)).
      
      Nonetheless for clarity, remove the test but add a WARN_ON() in case
      the code ever changes.
      
      Link: https://lkml.kernel.org/r/96925e5c1f116654ada7ea0613d930b1266b5e1c.1643319703.git.zanussi@kernel.org
      
      Fixes: f404da6e
      
       ("tracing: Add 'last error' error facility for hist triggers")
      Reported-by: default avatarkernel test robot <lkp@intel.com>
      Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
      Signed-off-by: default avatarTom Zanussi <zanussi@kernel.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      798a5b6c
    • Shuah Khan's avatar
      tools/tracing: Update Makefile to build rtla · aa814c51
      Shuah Khan authored
      
      
      Update tracing Makefile to build/install/clean rtla tragets.
      
      Link: https://lkml.kernel.org/r/20220126002234.79337-1-skhan@linuxfoundation.org
      
      Reviewed-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      aa814c51
    • Shuah Khan's avatar
      rtla: Make doc build optional · 2201aea1
      Shuah Khan authored
      
      
      rtla build fails due to doc build dependency on rst2man. Make
      doc build optional so rtla could be built without docs. Leave
      the install dependency on doc_install alone.
      
      Link: https://lkml.kernel.org/r/20220126001301.79096-1-skhan@linuxfoundation.org
      
      Acked-by: default avatarDaniel Bristot de Oliveira <bristot@kernel.org>
      Signed-off-by: default avatarShuah Khan <skhan@linuxfoundation.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      2201aea1
    • Kees Cook's avatar
      tracing/perf: Avoid -Warray-bounds warning for __rel_loc macro · c6d777ac
      Kees Cook authored
      As done for trace_events.h, also fix the __rel_loc macro in perf.h,
      which silences the -Warray-bounds warning:
      
      In file included from ./include/linux/string.h:253,
                       from ./include/linux/bitmap.h:11,
                       from ./include/linux/cpumask.h:12,
                       from ./include/linux/mm_types_task.h:14,
                       from ./include/linux/mm_types.h:5,
                       from ./include/linux/buildid.h:5,
                       from ./include/linux/module.h:14,
                       from samples/trace_events/trace-events-sample.c:2:
      In function '__fortify_strcpy',
          inlined from 'perf_trace_foo_rel_loc' at samples/trace_events/./trace-events-sample.h:519:1:
      ./include/linux/fortify-string.h:47:33: warning: '__builtin_strcpy' offset 12 is out of the bounds [
      0, 4] [-Warray-bounds]
         47 | #define __underlying_strcpy     __builtin_strcpy
            |                                 ^
      ./include/linux/fortify-string.h:445:24: note: in expansion of macro '__underlying_strcpy'
        445 |                 return __underlying_strcpy(p, q);
            |                        ^~~~~~~~~~~~~~~~~~~
      
      Also make __data struct member a proper flexible array to avoid future
      problems.
      
      Link: https://lkml.kernel.org/r/20220125220037.2738923-1-keescook@chromium.org
      
      Cc: Steven Rostedt <rostedt@goodmis.org>
      Cc: Masami Hiramatsu <mhiramat@kernel.org>
      Fixes: 55de2c0b
      
       ("tracing: Add '__rel_loc' using trace event macros")
      Reported-by: default avatarStephen Rothwell <sfr@canb.auug.org.au>
      Signed-off-by: default avatarKees Cook <keescook@chromium.org>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      c6d777ac
    • Masami Hiramatsu's avatar
      tracing: Avoid -Warray-bounds warning for __rel_loc macro · 58c5724e
      Masami Hiramatsu authored
      
      
      Since -Warray-bounds checks the destination size from the type of given
      pointer, __assign_rel_str() macro gets warned because it passes the
      pointer to the 'u32' field instead of 'trace_event_raw_*' data structure.
      Pass the data address calculated from the 'trace_event_raw_*' instead of
      'u32' __rel_loc field.
      
      Link: https://lkml.kernel.org/r/20220125233154.dac280ed36944c0c2fe6f3ac@kernel.org
      
      Cc: Stephen Rothwell <sfr@canb.auug.org.au>
      Cc: Kees Cook <keescook@chromium.org>
      Signed-off-by: default avatarMasami Hiramatsu <mhiramat@kernel.org>
      [ This did not fix the warning, but is still a nice clean up ]
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      58c5724e
    • Xiaoke Wang's avatar
      tracing/histogram: Fix a potential memory leak for kstrdup() · e629e7b5
      Xiaoke Wang authored
      kfree() is missing on an error path to free the memory allocated by
      kstrdup():
      
        p = param = kstrdup(data->params[i], GFP_KERNEL);
      
      So it is better to free it via kfree(p).
      
      Link: https://lkml.kernel.org/r/tencent_C52895FD37802832A3E5B272D05008866F0A@qq.com
      
      Cc: stable@vger.kernel.org
      Fixes: d380dcde
      
       ("tracing: Fix now invalid var_ref_vals assumption in trace action")
      Signed-off-by: default avatarXiaoke Wang <xkernel.wang@foxmail.com>
      Signed-off-by: default avatarSteven Rostedt (Google) <rostedt@goodmis.org>
      e629e7b5