<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/drivers/vfio, branch master</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>Merge tag 'vfio-v7.4-rc1' of https://github.com/awilliam/linux-vfio</title>
<updated>2026-10-24T00:22:52+00:00</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2026-10-24T00:22:52+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=26344c0dd32af8790d8474d233619db825441138'/>
<id>26344c0dd32af8790d8474d233619db825441138</id>
<content type='text'>
Pull VFIO updates from Alex Williamson:

 - Fix missing selftest &lt;libgen.h&gt; include for basename() to support
   non-glibc builds (Hisam Mehboob)

 - Add vfio selftest documentation covering the libvfio helper library
   and guidance for developers to aid in adding and understanding the
   framework (David Matlack)

 - Fix vfio cdev open path to prevent a second open from clobbering the
   vf_token or clearing the KVM reference. Add a selftest to avoid
   future recurrences (Alex Williamson)

 - Extend vfio selftest mix_and_match timeouts, in particular to account
   for systems where generated faults can induce heavy SMM load,
   delaying internal timeouts. Also extend timeout for execution via
   runner to account for various tests exceeding default 45s timeout
   (Alex Williamson)

 - Add tracking for non-reserved mappings into a vfio_dma object in
   order to optimize the tear-down paths where per-page tests can be
   entirely skipped. This resolves a soft lockup for large memory GPUs
   (Samuel Crossley)

 - Add vfio selftest driver for mlx5, providing another target for
   exercising DMA and interrupts against a physical device (Jason
   Gunthorpe)

 - Hardening against read-only region promotion, preserving vm_pgoff for
   unmap_mapping_range(), and reject non-shared MMIO mmaps as necessary
   through vfio-platform, vfio-fsl-mc, and vfio-cdx. These prevent
   future issues, though none are currently reachable (Abdifatah Suruur)

 - Fix 8-byte ioeventfd support, removing a static error test that was
   erroneously left in place when generalizing 8-byte io accesses (Li
   RongQing)

 - Fix missed RCU drain on module exit (Jiale Yao)

 - Fix off-by-one boundary check in migration support within the mlx5
   vfio-pci variant driver (Seongjun Hong)

 - Remove drvdata usage convention across vfio-pci-core, allowing
   variant drivers to freely create their own conventions and enabling a
   future Rust-based variant driver. A DRM topic branch is also merged
   in support of this effort, modifying the vga arbiter API to more
   cleanly remove the drvdata dependency (Simon Song)

 - Fix hisi_acc vfio-pci variant driver to avoid NULL pointer accesses
   when bound to unsupported devices and also disabling migration
   support when running on 64K host page size due to BAR mapping
   constraints (Longfang Liu)

 - Add device IDs for Crescent Island and Nova Lake devices to the Xe
   vfio-pci variant driver (Satyanarayana K V P)

 - Fix fallback mode in nvgrace-gpu variant driver to use symmetric open
   and close handlers to avoid reported use-after-free issue. Remove the
   resulting unnecessary test in the now single-purpose open function
   (Andrea Parri)

* tag 'vfio-v7.4-rc1' of https://github.com/awilliam/linux-vfio: (35 commits)
  vfio/nvgrace-gpu: Drop the usemem length check in open_device
  vfio/nvgrace-gpu: Use a core-only open_device in fallback mode
  vfio/xe: Add CRI and NVL device IDs
  hisi_acc_vfio_pci: reject live migration on 64KB page with QM_HW_V3 hardware
  hisi_acc_vfio_pci: fix NULL dereference in reset_prepare on PF passthrough
  vfio/pci: Remove the core dependency on driver data
  vfio/mlx5: Fix boundary check in set_report_output()
  vfio/pci: Drain eventfd RCU callbacks on module exit
  PCI/VGA: pass a data pointer to be used in the decode callback (v2)
  vfio/pci: Restore 8-byte ioeventfd support
  vfio/cdx: reject non-shared MMIO mmaps
  vfio/cdx: keep logical vm_pgoff in MMIO region mmap
  vfio/fsl-mc: keep logical vm_pgoff in MMIO region mmap
  vfio/platform: keep logical vm_pgoff in MMIO region mmap
  vfio/cdx: prevent read-only region mappings from becoming writable
  vfio/fsl-mc: prevent read-only region mappings from becoming writable
  vfio/platform: prevent read-only region mappings from becoming writable
  vfio: selftests: Verify a failed second open preserves the vf_token
  vfio: selftests: mlx5 driver - add send_msi support
  vfio: selftests: Add mlx5 driver - data path and memcpy ops
  ...
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Pull VFIO updates from Alex Williamson:

 - Fix missing selftest &lt;libgen.h&gt; include for basename() to support
   non-glibc builds (Hisam Mehboob)

 - Add vfio selftest documentation covering the libvfio helper library
   and guidance for developers to aid in adding and understanding the
   framework (David Matlack)

 - Fix vfio cdev open path to prevent a second open from clobbering the
   vf_token or clearing the KVM reference. Add a selftest to avoid
   future recurrences (Alex Williamson)

 - Extend vfio selftest mix_and_match timeouts, in particular to account
   for systems where generated faults can induce heavy SMM load,
   delaying internal timeouts. Also extend timeout for execution via
   runner to account for various tests exceeding default 45s timeout
   (Alex Williamson)

 - Add tracking for non-reserved mappings into a vfio_dma object in
   order to optimize the tear-down paths where per-page tests can be
   entirely skipped. This resolves a soft lockup for large memory GPUs
   (Samuel Crossley)

 - Add vfio selftest driver for mlx5, providing another target for
   exercising DMA and interrupts against a physical device (Jason
   Gunthorpe)

 - Hardening against read-only region promotion, preserving vm_pgoff for
   unmap_mapping_range(), and reject non-shared MMIO mmaps as necessary
   through vfio-platform, vfio-fsl-mc, and vfio-cdx. These prevent
   future issues, though none are currently reachable (Abdifatah Suruur)

 - Fix 8-byte ioeventfd support, removing a static error test that was
   erroneously left in place when generalizing 8-byte io accesses (Li
   RongQing)

 - Fix missed RCU drain on module exit (Jiale Yao)

 - Fix off-by-one boundary check in migration support within the mlx5
   vfio-pci variant driver (Seongjun Hong)

 - Remove drvdata usage convention across vfio-pci-core, allowing
   variant drivers to freely create their own conventions and enabling a
   future Rust-based variant driver. A DRM topic branch is also merged
   in support of this effort, modifying the vga arbiter API to more
   cleanly remove the drvdata dependency (Simon Song)

 - Fix hisi_acc vfio-pci variant driver to avoid NULL pointer accesses
   when bound to unsupported devices and also disabling migration
   support when running on 64K host page size due to BAR mapping
   constraints (Longfang Liu)

 - Add device IDs for Crescent Island and Nova Lake devices to the Xe
   vfio-pci variant driver (Satyanarayana K V P)

 - Fix fallback mode in nvgrace-gpu variant driver to use symmetric open
   and close handlers to avoid reported use-after-free issue. Remove the
   resulting unnecessary test in the now single-purpose open function
   (Andrea Parri)

* tag 'vfio-v7.4-rc1' of https://github.com/awilliam/linux-vfio: (35 commits)
  vfio/nvgrace-gpu: Drop the usemem length check in open_device
  vfio/nvgrace-gpu: Use a core-only open_device in fallback mode
  vfio/xe: Add CRI and NVL device IDs
  hisi_acc_vfio_pci: reject live migration on 64KB page with QM_HW_V3 hardware
  hisi_acc_vfio_pci: fix NULL dereference in reset_prepare on PF passthrough
  vfio/pci: Remove the core dependency on driver data
  vfio/mlx5: Fix boundary check in set_report_output()
  vfio/pci: Drain eventfd RCU callbacks on module exit
  PCI/VGA: pass a data pointer to be used in the decode callback (v2)
  vfio/pci: Restore 8-byte ioeventfd support
  vfio/cdx: reject non-shared MMIO mmaps
  vfio/cdx: keep logical vm_pgoff in MMIO region mmap
  vfio/fsl-mc: keep logical vm_pgoff in MMIO region mmap
  vfio/platform: keep logical vm_pgoff in MMIO region mmap
  vfio/cdx: prevent read-only region mappings from becoming writable
  vfio/fsl-mc: prevent read-only region mappings from becoming writable
  vfio/platform: prevent read-only region mappings from becoming writable
  vfio: selftests: Verify a failed second open preserves the vf_token
  vfio: selftests: mlx5 driver - add send_msi support
  vfio: selftests: Add mlx5 driver - data path and memcpy ops
  ...
</pre>
</div>
</content>
</entry>
<entry>
<title>vfio/nvgrace-gpu: Drop the usemem length check in open_device</title>
<updated>2026-10-16T15:32:02+00:00</updated>
<author>
<name>Andrea Parri</name>
<email>parri.andrea@gmail.com</email>
</author>
<published>2026-10-15T08:19:35+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=076d7e989cb69f6ded7d60f2a080eb909930061b'/>
<id>076d7e989cb69f6ded7d60f2a080eb909930061b</id>
<content type='text'>
nvgrace_gpu_open_device() sets up the fake BAR registers and remap_lock
only when usemem.memlength is nonzero.  The check exists for fallback
mode, which used to share this open path.  Fallback mode now has its own
open_device, so only devices with ACPI memory properties reach this one.

For those devices usemem.memlength is never zero: an empty region from
nvgrace_gpu_fetch_memory_property() selects fallback mode, and probe
fails when nvgrace_gpu_init_nvdev_struct() rounds usemem down to
nothing.  Do the setup unconditionally.

Assisted-by: LLM
Signed-off-by: Andrea Parri &lt;parri.andrea@gmail.com&gt;
Reviewed-by: Ankit Agrawal &lt;ankita@nvidia.com&gt;
Link: https://lore.kernel.org/r/20261015081937.405320-3-parri.andrea@gmail.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
nvgrace_gpu_open_device() sets up the fake BAR registers and remap_lock
only when usemem.memlength is nonzero.  The check exists for fallback
mode, which used to share this open path.  Fallback mode now has its own
open_device, so only devices with ACPI memory properties reach this one.

For those devices usemem.memlength is never zero: an empty region from
nvgrace_gpu_fetch_memory_property() selects fallback mode, and probe
fails when nvgrace_gpu_init_nvdev_struct() rounds usemem down to
nothing.  Do the setup unconditionally.

Assisted-by: LLM
Signed-off-by: Andrea Parri &lt;parri.andrea@gmail.com&gt;
Reviewed-by: Ankit Agrawal &lt;ankita@nvidia.com&gt;
Link: https://lore.kernel.org/r/20261015081937.405320-3-parri.andrea@gmail.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfio/nvgrace-gpu: Use a core-only open_device in fallback mode</title>
<updated>2026-10-16T15:32:02+00:00</updated>
<author>
<name>Andrea Parri</name>
<email>parri.andrea@gmail.com</email>
</author>
<published>2026-10-15T08:19:34+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9c48b994b66d7b585698f9aaee8ff559a7755c0a'/>
<id>9c48b994b66d7b585698f9aaee8ff559a7755c0a</id>
<content type='text'>
When the ACPI memory properties are missing or the C2C link is down, the
device is exposed through nvgrace_gpu_pci_core_ops.  That table opens
through nvgrace_gpu_open_device() but closes through
vfio_pci_core_close_device(), so open and close are not symmetric.

nvgrace_gpu_open_device() registers nvdev-&gt;usemem for poison handling
unconditionally.  In fallback mode usemem.memlength is zero, and
register_pfn_address_space() inserts a node covering [0, ULONG_MAX].
Nothing removes it: a second open fails with -EBUSY, and once the device
is unbound the node outlives the nvdev that contains it.  The next open
after a rebind reports:

  BUG: KASAN: slab-use-after-free in interval_tree_iter_first+0x209/0x310
  Read of size 8 at addr ffff88800894aa30 by task nvgrace_repro/203
  Call Trace:
   &lt;TASK&gt;
   dump_stack_lvl+0x5d/0x80
   print_report+0x153/0x4c6
   kasan_report+0xe4/0x1a0
   interval_tree_iter_first+0x209/0x310
   register_pfn_address_space+0x97/0x100
   nvgrace_gpu_open_device+0x21c/0x730
   vfio_df_open+0x213/0x520
   vfio_df_ioctl_bind_iommufd+0x3e8/0x6e0
   vfio_device_fops_unl_ioctl+0x782/0x1570
   __x64_sys_ioctl+0x13c/0x1c0
   do_syscall_64+0x106/0x630
   entry_SYSCALL_64_after_hwframe+0x77/0x7f
   &lt;/TASK&gt;

  Allocated by task 188:
   ...
   _vfio_alloc_device+0x3a/0x500
   nvgrace_gpu_probe+0xcb/0x660
   local_pci_probe+0xcf/0x170
   ...

  Freed by task 188:
   ...
   kfree+0x20d/0x600
   device_release+0xcf/0x250
   kobject_put+0x152/0x2f0
   pci_device_remove+0xb0/0x1c0
   device_release_driver_internal+0x38d/0x540
   unbind_store+0xde/0x100
   ...

Give the fallback table its own open_device that only calls
vfio_pci_core_enable() and vfio_pci_core_finish_enable(), the
counterpart of vfio_pci_core_close_device().  Fallback mode then never
touches the nvgrace memory regions, as Alex suggested.

This should be safe because the fallback table uses the vfio-pci core
read, write and mmap handlers, so nothing there uses the state
nvgrace_gpu_open_device() sets up.  The one visible difference is that a
fallback open no longer fails when BAR0 cannot be mapped, which matches
vfio-pci.

Fixes: e5f19b619fa0 ("vfio/nvgrace-gpu: register device memory for poison handling")
Cc: stable@vger.kernel.org
Suggested-by: Alex Williamson &lt;alex@shazbot.org&gt;
Assisted-by: LLM
Signed-off-by: Andrea Parri &lt;parri.andrea@gmail.com&gt;
Reviewed-by: Ankit Agrawal &lt;ankita@nvidia.com&gt;
Link: https://lore.kernel.org/r/20261015081937.405320-2-parri.andrea@gmail.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When the ACPI memory properties are missing or the C2C link is down, the
device is exposed through nvgrace_gpu_pci_core_ops.  That table opens
through nvgrace_gpu_open_device() but closes through
vfio_pci_core_close_device(), so open and close are not symmetric.

nvgrace_gpu_open_device() registers nvdev-&gt;usemem for poison handling
unconditionally.  In fallback mode usemem.memlength is zero, and
register_pfn_address_space() inserts a node covering [0, ULONG_MAX].
Nothing removes it: a second open fails with -EBUSY, and once the device
is unbound the node outlives the nvdev that contains it.  The next open
after a rebind reports:

  BUG: KASAN: slab-use-after-free in interval_tree_iter_first+0x209/0x310
  Read of size 8 at addr ffff88800894aa30 by task nvgrace_repro/203
  Call Trace:
   &lt;TASK&gt;
   dump_stack_lvl+0x5d/0x80
   print_report+0x153/0x4c6
   kasan_report+0xe4/0x1a0
   interval_tree_iter_first+0x209/0x310
   register_pfn_address_space+0x97/0x100
   nvgrace_gpu_open_device+0x21c/0x730
   vfio_df_open+0x213/0x520
   vfio_df_ioctl_bind_iommufd+0x3e8/0x6e0
   vfio_device_fops_unl_ioctl+0x782/0x1570
   __x64_sys_ioctl+0x13c/0x1c0
   do_syscall_64+0x106/0x630
   entry_SYSCALL_64_after_hwframe+0x77/0x7f
   &lt;/TASK&gt;

  Allocated by task 188:
   ...
   _vfio_alloc_device+0x3a/0x500
   nvgrace_gpu_probe+0xcb/0x660
   local_pci_probe+0xcf/0x170
   ...

  Freed by task 188:
   ...
   kfree+0x20d/0x600
   device_release+0xcf/0x250
   kobject_put+0x152/0x2f0
   pci_device_remove+0xb0/0x1c0
   device_release_driver_internal+0x38d/0x540
   unbind_store+0xde/0x100
   ...

Give the fallback table its own open_device that only calls
vfio_pci_core_enable() and vfio_pci_core_finish_enable(), the
counterpart of vfio_pci_core_close_device().  Fallback mode then never
touches the nvgrace memory regions, as Alex suggested.

This should be safe because the fallback table uses the vfio-pci core
read, write and mmap handlers, so nothing there uses the state
nvgrace_gpu_open_device() sets up.  The one visible difference is that a
fallback open no longer fails when BAR0 cannot be mapped, which matches
vfio-pci.

Fixes: e5f19b619fa0 ("vfio/nvgrace-gpu: register device memory for poison handling")
Cc: stable@vger.kernel.org
Suggested-by: Alex Williamson &lt;alex@shazbot.org&gt;
Assisted-by: LLM
Signed-off-by: Andrea Parri &lt;parri.andrea@gmail.com&gt;
Reviewed-by: Ankit Agrawal &lt;ankita@nvidia.com&gt;
Link: https://lore.kernel.org/r/20261015081937.405320-2-parri.andrea@gmail.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfio/xe: Add CRI and NVL device IDs</title>
<updated>2026-10-16T15:31:15+00:00</updated>
<author>
<name>Satyanarayana K V P</name>
<email>satyanarayana.k.v.p@intel.com</email>
</author>
<published>2026-10-14T13:18:50+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=60519dd563d91369bfae59f37895459a542eff66'/>
<id>60519dd563d91369bfae59f37895459a542eff66</id>
<content type='text'>
Crescent Island (CRI), Nova Lake-S (NVL-S) and Nova Lake-P (NVL-P)
support SR-IOV in the Xe driver. Add their PCI IDs to the xe-vfio-pci
device table, so that the generated vfio_pci module aliases allow
userspace to select this variant driver for their VFs.

Also reordered the table entries.

Signed-off-by: Satyanarayana K V P &lt;satyanarayana.k.v.p@intel.com&gt;
Cc: Michał Winiarski &lt;michal.winiarski@intel.com&gt;
Cc: Jason Gunthorpe &lt;jgg@ziepe.ca&gt;
Cc: Yishai Hadas &lt;yishaih@nvidia.com&gt;
Cc: Shameer Kolothum &lt;skolothumtho@nvidia.com&gt;
Cc: Kevin Tian &lt;kevin.tian@intel.com&gt;
Cc: Alex Williamson &lt;alex@shazbot.org&gt;
Cc: kvm@vger.kernel.org
Cc: intel-xe@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Michał Winiarski &lt;michal.winiarski@intel.com&gt;
Link: https://lore.kernel.org/r/20261014131849.157593-2-satyanarayana.k.v.p@intel.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Crescent Island (CRI), Nova Lake-S (NVL-S) and Nova Lake-P (NVL-P)
support SR-IOV in the Xe driver. Add their PCI IDs to the xe-vfio-pci
device table, so that the generated vfio_pci module aliases allow
userspace to select this variant driver for their VFs.

Also reordered the table entries.

Signed-off-by: Satyanarayana K V P &lt;satyanarayana.k.v.p@intel.com&gt;
Cc: Michał Winiarski &lt;michal.winiarski@intel.com&gt;
Cc: Jason Gunthorpe &lt;jgg@ziepe.ca&gt;
Cc: Yishai Hadas &lt;yishaih@nvidia.com&gt;
Cc: Shameer Kolothum &lt;skolothumtho@nvidia.com&gt;
Cc: Kevin Tian &lt;kevin.tian@intel.com&gt;
Cc: Alex Williamson &lt;alex@shazbot.org&gt;
Cc: kvm@vger.kernel.org
Cc: intel-xe@lists.freedesktop.org
Cc: linux-kernel@vger.kernel.org
Reviewed-by: Michał Winiarski &lt;michal.winiarski@intel.com&gt;
Link: https://lore.kernel.org/r/20261014131849.157593-2-satyanarayana.k.v.p@intel.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hisi_acc_vfio_pci: reject live migration on 64KB page with QM_HW_V3 hardware</title>
<updated>2026-10-13T15:26:40+00:00</updated>
<author>
<name>Longfang Liu</name>
<email>liulongfang@huawei.com</email>
</author>
<published>2026-10-13T07:19:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a80597900b8a0f1a9e87360164695f6a0a10556c'/>
<id>a80597900b8a0f1a9e87360164695f6a0a10556c</id>
<content type='text'>
On QM_HW_V3 (VF_CTRL mode) hardware with 64KB pages, the functional
region and migration registers share one BAR2 physical page with no
isolation, which leaks migration registers to the guest and causes
guest kernel calltrace under the KVM emulated device scheme.

The previous fix rejected the device in hisi_acc_vf_qm_init() during
open_device, returning -EINVAL and breaking passthrough entirely.
Move the drv_mode check into a helper called from probe() so that a
VF_CTRL device on a 64KB page is bound to the generic ops, keeping
passthrough working while disabling live migration.

Fixes: b0eed085903e ("hisi_acc_vfio_pci: Add support for VFIO live migration")
Signed-off-by: Longfang Liu &lt;liulongfang@huawei.com&gt;
Link: https://lore.kernel.org/r/20261013071929.3988687-3-liulongfang@huawei.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
On QM_HW_V3 (VF_CTRL mode) hardware with 64KB pages, the functional
region and migration registers share one BAR2 physical page with no
isolation, which leaks migration registers to the guest and causes
guest kernel calltrace under the KVM emulated device scheme.

The previous fix rejected the device in hisi_acc_vf_qm_init() during
open_device, returning -EINVAL and breaking passthrough entirely.
Move the drv_mode check into a helper called from probe() so that a
VF_CTRL device on a 64KB page is bound to the generic ops, keeping
passthrough working while disabling live migration.

Fixes: b0eed085903e ("hisi_acc_vfio_pci: Add support for VFIO live migration")
Signed-off-by: Longfang Liu &lt;liulongfang@huawei.com&gt;
Link: https://lore.kernel.org/r/20261013071929.3988687-3-liulongfang@huawei.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>hisi_acc_vfio_pci: fix NULL dereference in reset_prepare on PF passthrough</title>
<updated>2026-10-13T15:25:28+00:00</updated>
<author>
<name>Longfang Liu</name>
<email>liulongfang@huawei.com</email>
</author>
<published>2026-10-13T07:19:28+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=e1d2d60b1f50296828d3f7ff26c45d1a90f142ef'/>
<id>e1d2d60b1f50296828d3f7ff26c45d1a90f142ef</id>
<content type='text'>
When a PF is bound to the driver via driver_override and passed
through to a VM, its pf_qm stays NULL. The PCI error handler
reset_prepare() runs during open_device through
pci_try_reset_function(), before the mig_ops gate, and dereferences
the NULL pf_qm for the timeout log, crashing the kernel.

Move the mig_ops check to the entry of reset_prepare() and
aer_reset_done() so non-migration devices skip the QM_RESETTING
coordination. The dev local resolved &amp;qm-&gt;pdev-&gt;dev before the
gate, so open code it at the dev_err() call where qm is known
valid. Also clear set_reset_flag together with QM_RESETTING in
aer_reset_done(); the flag was never cleared before, so a later
timed-out reset could release a foreign lock.

Fixes: b0eed085903e ("hisi_acc_vfio_pci: Add support for VFIO live migration")
Fixes: a22099ed7936f ("hisi_acc_vfio_pci: fix VF reset timeout issue")
Signed-off-by: Longfang Liu &lt;liulongfang@huawei.com&gt;
Link: https://lore.kernel.org/r/20261013071929.3988687-2-liulongfang@huawei.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
When a PF is bound to the driver via driver_override and passed
through to a VM, its pf_qm stays NULL. The PCI error handler
reset_prepare() runs during open_device through
pci_try_reset_function(), before the mig_ops gate, and dereferences
the NULL pf_qm for the timeout log, crashing the kernel.

Move the mig_ops check to the entry of reset_prepare() and
aer_reset_done() so non-migration devices skip the QM_RESETTING
coordination. The dev local resolved &amp;qm-&gt;pdev-&gt;dev before the
gate, so open code it at the dev_err() call where qm is known
valid. Also clear set_reset_flag together with QM_RESETTING in
aer_reset_done(); the flag was never cleared before, so a later
timed-out reset could release a foreign lock.

Fixes: b0eed085903e ("hisi_acc_vfio_pci: Add support for VFIO live migration")
Fixes: a22099ed7936f ("hisi_acc_vfio_pci: fix VF reset timeout issue")
Signed-off-by: Longfang Liu &lt;liulongfang@huawei.com&gt;
Link: https://lore.kernel.org/r/20261013071929.3988687-2-liulongfang@huawei.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfio/pci: Remove the core dependency on driver data</title>
<updated>2026-10-10T17:58:19+00:00</updated>
<author>
<name>Simon Song</name>
<email>xinmengs@nvidia.com</email>
</author>
<published>2026-10-05T18:42:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6a5f427bee12c82beaf13efbd133416da1541c39'/>
<id>6a5f427bee12c82beaf13efbd133416da1541c39</id>
<content type='text'>
vfio-pci-core currently has runtime functions that interpret pci
driver_data as a pointer to vfio_pci_core_device, and enforce vfio
variant drivers must set vfio_pci_core_device to their pci driver_data.
This constrains variant drivers' private-data layout, including the
typed driver data used by the Rust PCI infrastructure.

Add VFIO_PCI_CORE_DEFINE_CALLBACKS macro to generate wrapper code for
each vfio variant driver, update vfio variant drivers to store their
private structures in driver_data and use generated wrapper to pass the
vfio core device to helpers.

Assisted-by: LLM
Suggested-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Suggested-by: Alex Williamson &lt;alex.williamson@nvidia.com&gt;
Suggested-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Link: https://lore.kernel.org/all/DLFD2ZDSK9YQ.3A4R66G8UJMD8@kernel.org/
Signed-off-by: Simon Song &lt;xinmengs@nvidia.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Reviewed-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Link: https://lore.kernel.org/r/20261005184236.1946167-2-xinmengs@nvidia.com
[VGA chunks and commit log reference dropped with rebase to
commit 93d41424caf7 ("PCI/VGA: pass a data pointer to be used in the decode callback (v2)")]
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vfio-pci-core currently has runtime functions that interpret pci
driver_data as a pointer to vfio_pci_core_device, and enforce vfio
variant drivers must set vfio_pci_core_device to their pci driver_data.
This constrains variant drivers' private-data layout, including the
typed driver data used by the Rust PCI infrastructure.

Add VFIO_PCI_CORE_DEFINE_CALLBACKS macro to generate wrapper code for
each vfio variant driver, update vfio variant drivers to store their
private structures in driver_data and use generated wrapper to pass the
vfio core device to helpers.

Assisted-by: LLM
Suggested-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Suggested-by: Alex Williamson &lt;alex.williamson@nvidia.com&gt;
Suggested-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Link: https://lore.kernel.org/all/DLFD2ZDSK9YQ.3A4R66G8UJMD8@kernel.org/
Signed-off-by: Simon Song &lt;xinmengs@nvidia.com&gt;
Reviewed-by: Jason Gunthorpe &lt;jgg@nvidia.com&gt;
Reviewed-by: Danilo Krummrich &lt;dakr@kernel.org&gt;
Link: https://lore.kernel.org/r/20261005184236.1946167-2-xinmengs@nvidia.com
[VGA chunks and commit log reference dropped with rebase to
commit 93d41424caf7 ("PCI/VGA: pass a data pointer to be used in the decode callback (v2)")]
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Merge tag 'topic/pci-vgaarb-rework-2026-10-01' of https://gitlab.freedesktop.org/drm/kernel into v7.4/vfio/next</title>
<updated>2026-10-10T17:15:38+00:00</updated>
<author>
<name>Alex Williamson</name>
<email>alex@shazbot.org</email>
</author>
<published>2026-10-10T17:15:38+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=f1b563d3e3cb0f9a97ef77f538ffc0e75e79a628'/>
<id>f1b563d3e3cb0f9a97ef77f538ffc0e75e79a628</id>
<content type='text'>
pci/vgaarb rework for drm/vfio

This reworks the vgaarb API to be a bit more sane.

Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
pci/vgaarb rework for drm/vfio

This reworks the vgaarb API to be a bit more sane.

Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfio/mlx5: Fix boundary check in set_report_output()</title>
<updated>2026-10-09T20:01:58+00:00</updated>
<author>
<name>Seongjun Hong</name>
<email>hsj0512@snu.ac.kr</email>
</author>
<published>2026-10-05T16:16:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=37b2ee6747b7857920ebc71eabc25208a39164a4'/>
<id>37b2ee6747b7857920ebc71eabc25208a39164a4</id>
<content type='text'>
Use &gt; instead of &gt;= on boundary check of recv_buf to avoid the bug which
the full message in the last slot of recv_buf is ignored even though the
received data size does not overflow the recv_buf.

Fixes: 9c7c5430bca3 ("vfio/mlx5: Align the page tracking max message size with the device capability")
Cc: stable@vger.kernel.org
Reviewed-by: Yishai Hadas &lt;yishaih@nvidia.com&gt;
Signed-off-by: Seongjun Hong &lt;hsj0512@snu.ac.kr&gt;
Link: https://lore.kernel.org/r/20261005-vfio-mlx5-fix-boundary-check-v2-1-75599d2f4497@snu.ac.kr
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use &gt; instead of &gt;= on boundary check of recv_buf to avoid the bug which
the full message in the last slot of recv_buf is ignored even though the
received data size does not overflow the recv_buf.

Fixes: 9c7c5430bca3 ("vfio/mlx5: Align the page tracking max message size with the device capability")
Cc: stable@vger.kernel.org
Reviewed-by: Yishai Hadas &lt;yishaih@nvidia.com&gt;
Signed-off-by: Seongjun Hong &lt;hsj0512@snu.ac.kr&gt;
Link: https://lore.kernel.org/r/20261005-vfio-mlx5-fix-boundary-check-v2-1-75599d2f4497@snu.ac.kr
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>vfio/pci: Drain eventfd RCU callbacks on module exit</title>
<updated>2026-10-09T19:55:57+00:00</updated>
<author>
<name>Jiale Yao</name>
<email>yaojiale02@163.com</email>
</author>
<published>2026-10-03T09:38:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3b2e9b05011ee74543b6d17401bb02f1df3b93ff'/>
<id>3b2e9b05011ee74543b6d17401bb02f1df3b93ff</id>
<content type='text'>
vfio_pci_eventfd_replace_locked() defers freeing replaced eventfds to
vfio_pci_eventfd_rcu_free(). A callback can remain queued after
close_device() returns and the device driver module reference is dropped.
Once the dependent driver is removed, vfio-pci-core can be unloaded while
the callback still points into its module text.

Wait for outstanding RCU callbacks before vfio-pci-core exits.

Fixes: 98693e0897f7 ("vfio/pci: Use RCU for error/request triggers to avoid circular locking")
Signed-off-by: Jiale Yao &lt;yaojiale02@163.com&gt;
Link: https://lore.kernel.org/r/20261003093806.544631-1-yaojiale02@163.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
vfio_pci_eventfd_replace_locked() defers freeing replaced eventfds to
vfio_pci_eventfd_rcu_free(). A callback can remain queued after
close_device() returns and the device driver module reference is dropped.
Once the dependent driver is removed, vfio-pci-core can be unloaded while
the callback still points into its module text.

Wait for outstanding RCU callbacks before vfio-pci-core exits.

Fixes: 98693e0897f7 ("vfio/pci: Use RCU for error/request triggers to avoid circular locking")
Signed-off-by: Jiale Yao &lt;yaojiale02@163.com&gt;
Link: https://lore.kernel.org/r/20261003093806.544631-1-yaojiale02@163.com
Signed-off-by: Alex Williamson &lt;alex@shazbot.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
