Thread (37 messages) flat view 37 messages, 4 authors, 1d ago

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

From: "Alexandre Courbot" <acourbot@nvidia.com>
Date: 2026-09-14 04:11:48
Also in: dri-devel, lkml, rust-for-linux

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. :)
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help