Re: [PATCH RFC 0/4] rust: dma: bridge zerocopy-derived types into the transmute byte-safety bound
From: SeungJong Ha
Date: Mon Jun 29 2026 - 07:52:21 EST
On Mon Jun 29, 2026 at 8:57 AM UTC, Danilo Krummrich wrote:
> On Mon Jun 29, 2026 at 10:20 AM CEST, Alistair Popple wrote:
>> I think the context is in the description for patch 1. It's not directly related
>> to the bindings generator. Basically the problem is that these bindings are a
>> little bit unique in that we access them using the dma_write/read macros. In
>> other words we use these with Dma::Coherent which still requires the transmute
>> rather than zerocopy trait bounds to be implemented.
>>
>> That said I think the correct long-term fix here would be to fix Dma::Coherent
>> to make it work with the zerocopy traits. Not sure if anyone is looking at that
>> or not.
>
> I think it can just be done short term, please also see [1]. We can just convert
> the DMA code right away, no need for the proposed indirection.
>
> [1] https://lore.kernel.org/all/DJLEHDNJCUD0.38PFZ5773D6BX@xxxxxxxxxx/
Same here [2], It'll be better to make full transition from transmute after the new
version of zerocopy[3] and auto derive is merged.
Best Regards,
SeungJong
[2] https://lore.kernel.org/all/DJLHOQA5UAP4.340P2TKXGMME5@xxxxxxxxx/
[3] https://lore.kernel.org/all/20260625231919.692444-1-ojeda@xxxxxxxxxx/