On Thu, 2025-12-04 at 21:18 +0000, Timur Tabi wrote:
> If you can tell me how to fix the CoherentAllocation allocation call so that
> it allocates 4K, that
> would be a better fix for this problem. It's only necessary for
> Turing/GA100, however.
Actually, I think I figured it out.
/// Arguments for GSP startup.
#[repr(C)]
pub(crate) struct GspArgumentsCached(
bindings::GSP_ARGUMENTS_CACHED,
[u8; GSP_PAGE_SIZE -
core::mem::size_of::<bindings::GSP_ARGUMENTS_CACHED>()], // Padding to make
it 4K
);
impl GspArgumentsCached {
/// Creates the arguments for starting the GSP up using `cmdq` as its
command queue.
pub(crate) fn new(cmdq: &Cmdq) -> Self {
Self(
bindings::GSP_ARGUMENTS_CACHED {
messageQueueInitArguments:
MessageQueueInitArguments::new(cmdq).0,
bDmemStack: 1,
..Default::default()
},
[0u8; GSP_PAGE_SIZE -
core::mem::size_of::<bindings::GSP_ARGUMENTS_CACHED>()],
)
}
}
If you think this is okay, I'll put it in v3. I had to remove the
#[repr(transparent)]. Is that
okay? The code compiles and seems to work.