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: dma-buf: heaps: system: add an option to allocate explicitly decrypted memory
Date: Tue, 24 Feb 2026 10:16:38 +1000	[thread overview]
Message-ID: <review-overall-20260223095136.225277-1-jiri@resnulli.us> (raw)
In-Reply-To: <20260223095136.225277-1-jiri@resnulli.us>

Overall Series Review

Subject: dma-buf: heaps: system: add an option to allocate explicitly decrypted memory
Author: Jiri Pirko <jiri@resnulli.us>
Patches: 4
Reviewed: 2026-02-24T10:16:38.464553

---

This 2-patch series adds support for explicitly decrypted memory allocations in confidential computing (CoCo) VMs (AMD SEV, Intel TDX). Patch 1 introduces a new DMA attribute `DMA_ATTR_CC_DECRYPTED` that lets the DMA direct mapping path skip swiotlb bounce buffering for memory the caller has already decrypted. Patch 2 adds a new `system_cc_decrypted` dma-buf heap that allocates pages, decrypts them via `set_memory_decrypted()`, and makes them available to userspace and DMA importers with the correct page protections and DMA attributes.

The architectural approach in v2 (a separate heap rather than a flag on the existing heap) is cleaner and was requested by reviewers. The series is well-motivated and the commit messages are thorough and accurate.

There is one concrete bug in the error handling path of the allocation function in patch 2: when page decryption fails partway through the sg_table, the cleanup path attempts to re-encrypt pages that were never decrypted, which could cause unnecessary page leaks on CoCo VMs. There are also leftover UAPI header changes from v1 that appear unnecessary in v2. The `dma_direct_unmap_phys` function is not updated in patch 1, which is worth discussing even if it is likely benign.

---
Generated by Claude Code Patch Reviewer

  parent reply	other threads:[~2026-02-24  0:16 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-23  9:51 [PATCH v2 0/2] dma-buf: heaps: system: add an option to allocate explicitly decrypted memory Jiri Pirko
2026-02-23  9:51 ` [PATCH v2 1/2] dma-mapping: introduce DMA_ATTR_CC_DECRYPTED for pre-decrypted memory Jiri Pirko
2026-02-24  0:16   ` Claude review: " Claude Code Review Bot
2026-02-23  9:51 ` [PATCH v2 2/2] dma-buf: heaps: system: add system_cc_decrypted heap for explicitly decrypted memory Jiri Pirko
2026-02-23 18:33   ` John Stultz
2026-02-24  0:16   ` Claude review: " Claude Code Review Bot
2026-02-24  0:16 ` Claude Code Review Bot [this message]
  -- strict thread matches above, loose matches on Subject: below --
2026-02-09 15:38 [PATCH 0/5] dma-buf: heaps: system: add an option to allocate " Jiri Pirko
2026-02-09 15:38 ` [PATCH 5/5] " Jiri Pirko
2026-02-11  6:59   ` Claude review: " Claude Code Review Bot
2026-02-11  6:59 ` 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-overall-20260223095136.225277-1-jiri@resnulli.us \
    --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