On Fri, 2025-12-19 at 12:43 +0900, Alexandre Courbot wrote:
> 
> Yes, the patch I sent in my previous message was in replacement of
> yours, not to be applied on top - I should have mentioned that.

Ok, I will replace my patch with yours.

> > and with the padding removed, doesn't this
> > 
> >          dma_write!(rmargs[0].inner = fw::GspArgumentsCached::new(&cmdq))?;
> > 
> > now only copy the args and leave the padding completely uninitialized?  
> > That's okay, I
> > think, I just
> > want to make sure I'm not missing anything.
> 
> Since we call `alloc_coherent` with `__GFP_ZERO`, all memory will be
> initialized to zero before that line is run. It's not 100% ideal but
> does work.

Ok, I get it now. You allocate the block, and then dma_write! memcpys the 
GspArgumentsCached
that's on the stack to it.

When you say it's not ideal, is that because it still has to do a memcpy from 
the stack to the
DMA buffer, whereas Nouveau was able to write to the buffer directly?

Reply via email to