1. 16 Mar, 2023 1 commit
    • Linus Torvalds's avatar
      Merge tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm · 0ddc84d2
      Linus Torvalds authored
      Pull kvm fixes from Paolo Bonzini:
       "ARM64:
      
         - Address a rather annoying bug w.r.t. guest timer offsetting. The
           synchronization of timer offsets between vCPUs was broken, leading
           to inconsistent timer reads within the VM.
      
        x86:
      
         - New tests for the slow path of the EVTCHNOP_send Xen hypercall
      
         - Add missing nVMX consistency checks for CR0 and CR4
      
         - Fix bug that broke AMD GATag on 512 vCPU machines
      
        Selftests:
      
         - Skip hugetlb tests if huge pages are not available
      
         - Sync KVM exit reasons"
      
      * tag 'for-linus' of git://git.kernel.org/pub/scm/virt/kvm/kvm:
        KVM: selftests: Sync KVM exit reasons in selftests
        KVM: selftests: Add macro to generate KVM exit reason strings
        KVM: selftests: Print expected and actual exit reason in KVM exit reason assert
        KVM: selftests: Make vCPU exit reason test assertion common
        KVM: selftests: Add EVTCHNOP_send slow path test to xen_shinfo_test
        KVM: selftests: Use enum for test numbers in xen_shinfo_test
        KVM: selftests: Add helpers to make Xen-style VMCALL/VMMCALL hypercalls
        KVM: selftests: Move the guts of kvm_hypercall() to a separate macro
        KVM: SVM: WARN if GATag generation drops VM or vCPU ID information
        KVM: SVM: Modify AVIC GATag to support max number of 512 vCPUs
        KVM: SVM: Fix a benign off-by-one bug in AVIC physical table mask
        selftests: KVM: skip hugetlb tests if huge pages are not available
        KVM: VMX: Use tabs instead of spaces for indentation
        KVM: VMX: Fix indentation coding style issue
        KVM: nVMX: remove unnecessary #ifdef
        KVM: nVMX: add missing consistency checks for CR0 and CR4
        KVM: arm64: timers: Convert per-vcpu virtual offset to a global value
      0ddc84d2
  2. 15 Mar, 2023 5 commits
    • Linus Torvalds's avatar
      Merge tag 'linux-kselftest-fixes-6.3-rc3' of... · 9c1bec9c
      Linus Torvalds authored
      Merge tag 'linux-kselftest-fixes-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest
      
      Pull kselftest fixes from Shuah Khan:
       "A fix to amd-pstate test Makefile and a fix to LLVM build for x86 in
        kselftest common lib.mk"
      
      * tag 'linux-kselftest-fixes-6.3-rc3' of git://git.kernel.org/pub/scm/linux/kernel/git/shuah/linux-kselftest:
        selftests: fix LLVM build for i386 and x86_64
        selftests: amd-pstate: fix TEST_FILES
      9c1bec9c
    • Linus Torvalds's avatar
      sched_getaffinity: don't assume 'cpumask_size()' is fully initialized · 6015b1ac
      Linus Torvalds authored
      The getaffinity() system call uses 'cpumask_size()' to decide how big
      the CPU mask is - so far so good.  It is indeed the allocation size of a
      cpumask.
      
      But the code also assumes that the whole allocation is initialized
      without actually doing so itself.  That's wrong, because we might have
      fixed-size allocations (making copying and clearing more efficient), but
      not all of it is then necessarily used if 'nr_cpu_ids' is smaller.
      
      Having checked other users of 'cpumask_size()', they all seem to be ok,
      either using it purely for the allocation size, or explicitly zeroing
      the cpumask before using the size in bytes to copy it.
      
      See for example the ublk_ctrl_get_queue_affinity() function that uses
      the proper 'zalloc_cpumask_var()' to make sure that the whole mask is
      cleared, whether the storage is on the stack or if it was an external
      allocation.
      
      Fix this by just zeroing the allocation before using it.  Do the same
      for the compat version of sched_getaffinity(), which had the same logic.
      
      Also, for consistency, make sched_getaffinity() use 'cpumask_bits()' to
      access the bits.  For a cpumask_var_t, it ends up being a pointer to the
      same data either way, but it's just a good idea to treat it like you
      would a 'cpumask_t'.  The compat case already did that.
      Reported-by: default avatarRyan Roberts <ryan.roberts@arm.com>
      Link: https://lore.kernel.org/lkml/7d026744-6bd6-6827-0471-b5e8eae0be3f@arm.com/
      Cc: Yury Norov <yury.norov@gmail.com>
      Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
      6015b1ac
    • Linus Torvalds's avatar
      Merge tag 'mm-hotfixes-stable-2023-03-14-16-51' of... · 26e2878b
      Linus Torvalds authored
      Merge tag 'mm-hotfixes-stable-2023-03-14-16-51' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm
      
      Pull misc fixes from Andrew Morton:
       "Eleven hotfixes.
      
        Four of these are cc:stable and the remainder address post-6.2 issues
        or aren't considered suitable for backporting.
      
        Seven of these fixes are for MM"
      
      * tag 'mm-hotfixes-stable-2023-03-14-16-51' of git://git.kernel.org/pub/scm/linux/kernel/git/akpm/mm:
        mm/damon/paddr: fix folio_nr_pages() after folio_put() in damon_pa_mark_accessed_or_deactivate()
        mm/damon/paddr: fix folio_size() call after folio_put() in damon_pa_young()
        ocfs2: fix data corruption after failed write
        migrate_pages: try migrate in batch asynchronously firstly
        migrate_pages: move split folios processing out of migrate_pages_batch()
        migrate_pages: fix deadlock in batched migration
        .mailmap: add Alexandre Ghiti personal email address
        mailmap: correct Dikshita Agarwal's Qualcomm email address
        mailmap: updates for Jarkko Sakkinen
        mm/userfaultfd: propagate uffd-wp bit when PTE-mapping the huge zeropage
        mm: teach mincore_hugetlb about pte markers
      26e2878b
    • Linus Torvalds's avatar
      Merge tag 'trace-v6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace · 29db00c2
      Linus Torvalds authored
      Pull tracing fixes from Steven Rostedt:
      
       - Do not allow histogram values to have modifies. They can cause a NULL
         pointer dereference if they do.
      
       - Warn if hist_field_name() is passed a NULL. Prevent the NULL pointer
         dereference mentioned above.
      
       - Fix invalid address look up race in lookup_rec()
      
       - Define ftrace_stub_graph conditionally to prevent linker errors
      
       - Always check if RCU is watching at all tracepoint locations
      
      * tag 'trace-v6.3-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/trace/linux-trace:
        tracing: Make tracepoint lockdep check actually test something
        ftrace,kcfi: Define ftrace_stub_graph conditionally
        ftrace: Fix invalid address access in lookup_rec() when index is 0
        tracing: Check field value in hist_field_name()
        tracing: Do not let histogram values have some modifiers
      29db00c2
    • Linus Torvalds's avatar
      Merge tag 'zstd-linus-v6.3-rc3' of https://github.com/terrelln/linux · ed38ff16
      Linus Torvalds authored
      Pull zstd fixes from Nick Terrell:
       "A small number of fixes for zstd-v1.5.2.
      
        I'm not pulling in zstd-v1.5.4 from upstream this release because it
        didn't have any time to bake in linux-next, but I'm aiming for the
        next update in v6.4"
      
      * tag 'zstd-linus-v6.3-rc3' of https://github.com/terrelln/linux:
        zstd: Fix definition of assert()
        lib: zstd: Backport fix for in-place decompression
        lib: zstd: Fix -Wstringop-overflow warning
      ed38ff16
  3. 14 Mar, 2023 22 commits
  4. 13 Mar, 2023 4 commits
    • Linus Torvalds's avatar
      Merge tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost · fc89d7fb
      Linus Torvalds authored
      Pull virtio fixes from Michael Tsirkin:
       "Some virtio / vhost / vdpa fixes accumulated so far"
      
      * tag 'for_linus' of git://git.kernel.org/pub/scm/linux/kernel/git/mst/vhost:
        tools/virtio: Ignore virtio-trace/trace-agent
        vdpa_sim: set last_used_idx as last_avail_idx in vdpasim_queue_ready
        vhost-vdpa: free iommu domain after last use during cleanup
        vdpa/mlx5: should not activate virtq object when suspended
        vp_vdpa: fix the crash in hot unplug with vp_vdpa
      fc89d7fb
    • Rong Tao's avatar
      tools/virtio: Ignore virtio-trace/trace-agent · ae43c20d
      Rong Tao authored
      since commit 108fc825("tools: Add guest trace agent as a user tool")
      introduce virtio-trace/trace-agent, it should be ignored in the git tree.
      Signed-off-by: default avatarRong Tao <rongtao@cestc.cn>
      Message-Id: <tencent_52B2BC2F47540A5FEB46E710BD0C8485B409@qq.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      ae43c20d
    • Eugenio Pérez's avatar
      vdpa_sim: set last_used_idx as last_avail_idx in vdpasim_queue_ready · b4cca6d4
      Eugenio Pérez authored
      Starting from an used_idx different than 0 is needed in use cases like
      virtual machine migration.  Not doing so and letting the caller set an
      avail idx different than 0 causes destination device to try to use old
      buffers that source driver already recover and are not available
      anymore.
      
      Since vdpa_sim does not support receive inflight descriptors as a
      destination of a migration, let's set both avail_idx and used_idx the
      same at vq start.  This is how vhost-user works in a
      VHOST_SET_VRING_BASE call.
      
      Although the simple fix is to set last_used_idx at vdpasim_set_vq_state,
      it would be reset at vdpasim_queue_ready.  The last_avail_idx case is
      fixed with commit 0e84f918 ("vdpa_sim: not reset state in
      vdpasim_queue_ready").  Since the only option is to make it equal to
      last_avail_idx, adding the only change needed here.
      
      This was discovered and tested live migrating the vdpa_sim_net device.
      
      Fixes: 2c53d0f6 ("vdpasim: vDPA device simulator")
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      Signed-off-by: default avatarEugenio Pérez <eperezma@redhat.com>
      Message-Id: <20230302181857.925374-1-eperezma@redhat.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      b4cca6d4
    • Gautam Dawar's avatar
      vhost-vdpa: free iommu domain after last use during cleanup · 5a522150
      Gautam Dawar authored
      Currently vhost_vdpa_cleanup() unmaps the DMA mappings by calling
      `iommu_unmap(v->domain, map->start, map->size);`
      from vhost_vdpa_general_unmap() when the parent vDPA driver doesn't
      provide DMA config operations.
      
      However, the IOMMU domain referred to by `v->domain` is freed in
      vhost_vdpa_free_domain() before vhost_vdpa_cleanup() in
      vhost_vdpa_release() which results in NULL pointer de-reference.
      Accordingly, moving the call to vhost_vdpa_free_domain() in
      vhost_vdpa_cleanup() would makes sense. This will also help
      detaching the dma device in error handling of vhost_vdpa_alloc_domain().
      
      This issue was observed on terminating QEMU with SIGQUIT.
      
      Fixes: 037d4305 ("vhost-vdpa: call vhost_vdpa_cleanup during the release")
      Signed-off-by: default avatarGautam Dawar <gautam.dawar@amd.com>
      Message-Id: <20230301163203.29883-1-gautam.dawar@amd.com>
      Signed-off-by: default avatarMichael S. Tsirkin <mst@redhat.com>
      Acked-by: default avatarJason Wang <jasowang@redhat.com>
      Reviewed-by: default avatarStefano Garzarella <sgarzare@redhat.com>
      5a522150
  5. 12 Mar, 2023 8 commits