From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: vfio/pci: Convert BAR mmap() to use a DMABUF Date: Thu, 28 May 2026 12:28:52 +1000 Message-ID: In-Reply-To: <20260527102319.100128-5-mattev@meta.com> References: <20260527102319.100128-1-mattev@meta.com> <20260527102319.100128-5-mattev@meta.com> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review The main conversion patch. Removes `vma_to_pfn()`, updates the fault handler, and makes `VFIO_PCI_CORE` depend on `DMA_SHARED_BUFFER` and `PCI_P2PDMA_CORE`. **Kconfig change**: ```c + select PCI_P2PDMA_CORE + select DMA_SHARED_BUFFER ``` Making these unconditional `select`s for `VFIO_PCI_CORE` is a significant dependency change. `DMA_SHARED_BUFFER` is generally available, but this should be called out in the commit message more prominently since it affects all VFIO PCI users. **Conditional `.attach` in dma_buf_ops**: ```c static const struct dma_buf_ops vfio_pci_dmabuf_ops = { +#ifdef CONFIG_VFIO_PCI_DMABUF .attach = vfio_pci_dma_buf_attach, +#endif ``` Setting `.attach = NULL` when `CONFIG_VFIO_PCI_DMABUF` is disabled means DMA-BUF attach will silently succeed (the core code skips the callback if NULL). This is intentional -- BAR mmap DMABUFs don't need P2P attach semantics -- but it's worth noting that this means the DMABUFs created on the mmap path can't be used for DMA by importers when P2P is disabled. **Default fault return changed**: The old code defaulted to `VM_FAULT_FALLBACK`; the new code defaults to `VM_FAULT_SIGBUS`. This is correct since a revoked buffer should SIGBUS, and the fallback case is now explicit in the `-EAGAIN` return from `find_pfn`. --- Generated by Claude Code Patch Reviewer