Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] vfio: selftests: missing -ENOTTY skip check for
  __vfio_pci_dmabuf_create()
--

commit 3d8e1bca27abb87842a5dfc06a0cde5ad88fe0fb
Author: David Matlack <[email protected]>

vfio: selftests: Add P2P DMA selftest

This commit adds vfio_pci_p2pdma_test to validate peer-to-peer DMA between
an initiator device and a target device's memory BAR across supported IOMMU
modes, including dmabuf revocation.

> diff --git a/tools/testing/selftests/vfio/vfio_pci_p2pdma_test.c 
> b/tools/testing/selftests/vfio/vfio_pci_p2pdma_test.c
> new file mode 100644
> index 0000000000000..43e1537076ad1
> --- /dev/null
> +++ b/tools/testing/selftests/vfio/vfio_pci_p2pdma_test.c
[ ... ]
> +FIXTURE_SETUP(vfio_pci_p2pdma_test)
> +{
[ ... ]
> +     if (self->iommu->iommufd) {
> +             u32 bar_idx = self->mem_bar.bar->info.index;
> +
> +             self->dmabuf_fd = __vfio_pci_dmabuf_create(self->target,
> +                                                        bar_idx,
> +                                                        self->mem_bar.offset,
> +                                                        bar_map_size,
> +                                                        O_RDWR | O_CLOEXEC);
> +             if (self->dmabuf_fd == -EOPNOTSUPP)
> +                     SKIP(return, "Kernel does not support 
> VFIO_DEVICE_FEATURE_DMA_BUF");
> +             ASSERT_GE(self->dmabuf_fd, 0);

[Severity: Medium]
Should this check also skip when self->dmabuf_fd is -ENOTTY?  When
CONFIG_VFIO_PCI_DMABUF is disabled (or on kernels predating
VFIO_DEVICE_FEATURE_DMA_BUF), the vfio_pci_core_feature_dma_buf() stub and
vfio_pci_core_ioctl_feature() return -ENOTTY rather than -EOPNOTSUPP,
causing the iommufd test variants to fail at ASSERT_GE() instead of
skipping.

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=7

Reply via email to