From mboxrd@z Thu Jan 1 00:00:00 1970 From: Claude Code Review Bot To: dri-devel-reviews@example.com Subject: Claude review: gpu: nova-core: use I/O projection for cleaner encapsulation Date: Thu, 23 Apr 2026 08:25:46 +1000 Message-ID: In-Reply-To: <20260421-io_projection-v2-9-4c251c692ef4@garyguo.net> References: <20260421-io_projection-v2-0-4c251c692ef4@garyguo.net> <20260421-io_projection-v2-9-4c251c692ef4@garyguo.net> X-Mailer: Claude Code Patch Reviewer Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 7bit MIME-Version: 1.0 Patch Review This is the practical payoff: nova-core's `gsp_mem` module (which was a workaround for accessing shared DMA memory fields) is deleted entirely, and replaced by `io_project!` + `io_read!`/`io_write!` calls. The `GspMem` and `Msgq` structs can become private again, removing the `pub(super)` visibility that was only needed for the workaround module. The `PteArray::init` method now takes a `View` directly: ```rust fn init( view: io::View<'_, Coherent, Self>, start: DmaAddress, ) -> Result<()> { ``` This is much cleaner than the old slice-based approach. The fence operations are preserved correctly. One notable change: initialization of `cpuq.tx` and `cpuq.rx` now uses `CoherentBox` (exclusive access) before converting to `Coherent`: ```rust let mut gsp_mem = CoherentBox::::zeroed(dev, GFP_KERNEL)?; gsp_mem.cpuq.tx = MsgqTxHeader::new(MSGQ_SIZE, RX_HDR_OFF, MSGQ_NUM_PAGES); gsp_mem.cpuq.rx = MsgqRxHeader::new(); let gsp_mem: Coherent<_> = gsp_mem.into(); ``` This is better than the old `dma_write!` approach since the headers are fully initialized before the DMA region becomes shared. --- Generated by Claude Code Patch Reviewer