Re: [PATCH v2 8/8] gpu: nova-core: add NVKV GSP_INIT schemas

From: Alexandre Courbot

Date: Mon Sep 14 2026 - 00:11:56 EST


On Thu Aug 27, 2026 at 11:12 PM JST, Eliot Courtney wrote:
<...>
> +impl RegKey {
> + // Define the Key IDs read/written by GSP.
> + const REGKEY_NAME_KEY: KeyId = 0x3070;
> + const REGKEY_VALUE_U32_KEY: KeyId = 0x3071;
> +}
> +
> +impl Encodable for KVVec<RegKey> {
> + fn encode(&self, encoder: &mut Encoder) -> Result {
> + for regkey in self {
> + regkey.encode(encoder)?;
> + }
> + Ok(())

Maybe this is just me misunderstanding, but how are the keys
sequentially sent here? Because I don't see any mention of an index, and
`Key::encode` hardcodes `Index::new::<0>()`, so how are these supposed
to be decoded into an array? The `gsp_init_request` test below only adds
one key to its `regkeys`, can we add at least another one to see what
happens and verify that the received content decodes as expected on top
of checking its length?

Also drive-by design question: do we expect to have bidirectional types,
i.e. types that need to go through `nvkv_encode` and `nvkv_decode`?
Because I guess there would be some mechanical overlap in the
definitions for that case. Although maybe we can mitigate that with
another macro. :)