public inbox for drm-ai-reviews@public-inbox.freedesktop.org
 help / color / mirror / Atom feed
From: Claude Code Review Bot <claude-review@example.com>
To: dri-devel-reviews@example.com
Subject: Claude review: vfio/pci: Permanently revoke a DMABUF on request
Date: Thu, 28 May 2026 12:28:53 +1000	[thread overview]
Message-ID: <review-patch8-20260527102319.100128-9-mattev@meta.com> (raw)
In-Reply-To: <20260527102319.100128-9-mattev@meta.com>

Patch Review

Adds three-state revocation (OK/TEMP_REVOKED/PERM_REVOKED) and a new `VFIO_DEVICE_PCI_DMABUF_REVOKE` ioctl.

**Ioctl number**: Uses `VFIO_BASE + 22` which is confirmed available.

**Security check in `vfio_pci_dma_buf_revoke`**:
```c
+	if (dmabuf->ops != &vfio_pci_dmabuf_ops || priv->vdev != vdev) {
```
Checking `dmabuf->ops` prevents accepting arbitrary dmabufs. Good. The `priv->vdev != vdev` check prevents cross-device revocation. The comment about racing cleanup on a different vdev is well-reasoned.

**The `__vfio_pci_dma_buf_revoke` function**: The early-return logic for state transitions is clear:
```c
+	if ((priv->status == VFIO_PCI_DMABUF_PERM_REVOKED) ||
+	    (priv->status == VFIO_PCI_DMABUF_OK && !revoked) ||
+	    (priv->status == VFIO_PCI_DMABUF_TEMP_REVOKED && revoked && !permanently)) {
+		return;
+	}
```
The third condition (temp-revoked and requesting non-permanent revoke) correctly avoids redundant work. TEMP->PERM upgrade skips the invalidation path since the buffer is already gone. Sound.

**Missing `flags` field question**: The author asks whether a `flags` field should be added to `struct vfio_pci_dmabuf_revoke`. Given the `argsz` pattern already allows extension, I'd say no -- add it when needed. UAPI extensibility is already handled.

---
Generated by Claude Code Patch Reviewer

  reply	other threads:[~2026-05-28  2:28 UTC|newest]

Thread overview: 25+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-05-27 10:23 [PATCH v2 0/9] vfio/pci: Add mmap() for DMABUFs Matt Evans
2026-05-27 10:23 ` [PATCH v2 1/9] PCI/P2PDMA: Add CONFIG_PCI_P2PDMA_CORE Matt Evans
2026-05-27 16:07   ` Logan Gunthorpe
2026-05-27 17:13     ` Matt Evans
2026-05-27 21:09   ` Alex Williamson
2026-05-28  2:28   ` Claude review: " Claude Code Review Bot
2026-05-27 10:23 ` [PATCH v2 2/9] vfio/pci: Add a helper to look up PFNs for DMABUFs Matt Evans
2026-05-27 22:38   ` Alex Williamson
2026-05-28  2:28   ` Claude review: " Claude Code Review Bot
2026-05-27 10:23 ` [PATCH v2 3/9] vfio/pci: Add a helper to create a DMABUF for a BAR-map VMA Matt Evans
2026-05-27 22:59   ` Alex Williamson
2026-05-28  2:28   ` Claude review: " Claude Code Review Bot
2026-05-27 10:23 ` [PATCH v2 4/9] vfio/pci: Convert BAR mmap() to use a DMABUF Matt Evans
2026-05-28  2:28   ` Claude review: " Claude Code Review Bot
2026-05-27 10:23 ` [PATCH v2 5/9] vfio/pci: Provide a user-facing name for BAR mappings Matt Evans
2026-05-28  2:28   ` Claude review: " Claude Code Review Bot
2026-05-27 10:23 ` [PATCH v2 6/9] vfio/pci: Clean up BAR zap and revocation Matt Evans
2026-05-28  2:28   ` Claude review: " Claude Code Review Bot
2026-05-27 10:23 ` [PATCH v2 7/9] vfio/pci: Support mmap() of a VFIO DMABUF Matt Evans
2026-05-28  2:28   ` Claude review: " Claude Code Review Bot
2026-05-27 10:23 ` [PATCH v2 8/9] vfio/pci: Permanently revoke a DMABUF on request Matt Evans
2026-05-28  2:28   ` Claude Code Review Bot [this message]
2026-05-27 10:23 ` [PATCH v2 9/9] vfio/pci: Add mmap() attributes to DMABUF feature Matt Evans
2026-05-28  2:28   ` Claude review: " Claude Code Review Bot
2026-05-28  2:28 ` Claude review: vfio/pci: Add mmap() for DMABUFs Claude Code Review Bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=review-patch8-20260527102319.100128-9-mattev@meta.com \
    --to=claude-review@example.com \
    --cc=dri-devel-reviews@example.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox