Skip to contentSkip to conversation

gpu: nova-core: populate GSP_INIT timeout defaults

PATCH New Alok Kumar 1 participant 2 messages Nov 17

Subsystems (7)
DRM drivers KVM PCI Rust +3 more subsystems
lore
Share & tools
lore

Alok Kumar

author
#0 lore raw

cover gpu: nova-core: populate GSP_INIT timeout defaults

Populate the GSP_INIT request with nonzero default timeouts for vGPU.

The patch encodes the following keys as u32 values in microseconds:

0xA0: vGPU timeout 1,800,000 us
0xA1: graphics-mode timeout 4,000,000 us
0xA2: compute-mode timeout 30,000,000 us

This series is based on:
[PATCH 0/5] Transition nova-core to use TLV variables for heap sizes [1]

The complete integration tree, including the prerequisites and the companion VFIO driver, is available at:

    https://github.com/alokk-nvidia/nova-core/tree/nova-vgpu-wip-20261113

[1] https://lore.kernel.org/nova-gpu/[email protected]/

Alok Kumar (1):
gpu: nova-core: send GPU timeout defaults in GSP_INIT

 drivers/gpu/nova-core/gsp/fw/commands.rs | 11 +++++++++++
 1 file changed, 11 insertions(+)

base-commit: d1046d643c171875d6d350dcacbee89f56c7272a

Signature · 1 line
2.53.0
author
#1 lore raw

PATCH 1/1 gpu: nova-core: send GPU timeout defaults in GSP_INIT

GSP firmware requires a nonzero vGPU timeout in GSP_INIT.

Populate the NVKV keys as u32 values:

0xA0: vGPU timeout, 1,800,000 us
0xA1: graphics-mode timeout, 4,000,000 us
0xA2: compute-mode timeout, 30,000,000 us

---
 drivers/gpu/nova-core/gsp/fw/commands.rs | 11 +++++++++++
 1 file changed, 11 insertions(+)
drivers/gpu/nova-core/gsp/fw/commands.rs +11 -0
index 08798f150ad7..adb0b1f29ceb 100644
@@ -192,6 +192,9 @@ pub(crate) struct GspInitRequest {
         pci_config_mirror_base: Key<u32, 0x0010>,
         pci_config_mirror_size: Key<u32, 0x0011>,
         host_arch: Key<HostArch, 0x0070, u32>,
+        default_timeout_us_vgpu: Key<u32, 0x00a0>,
+        default_timeout_us_graphics_mode: Key<u32, 0x00a1>,
+        default_timeout_us_compute_mode: Key<u32, 0x00a2>,
         bus_device_func: Key<u64, 0x1020>,
         regkeys: KVVec<RegKey>,
         vf_info: Option<VfInfo>,
@@ -230,6 +233,11 @@ struct DomainBusDevice(u64) {
 ];
 
 impl GspInitRequest {
+    // GPU timeout defaults in microseconds. All three values must be nonzero in GSP_INIT.
+    const DEFAULT_TIMEOUT_US_VGPU: u32 = 1_800_000;
+    const DEFAULT_TIMEOUT_US_GRAPHICS_MODE: u32 = 4_000_000;
+    const DEFAULT_TIMEOUT_US_COMPUTE_MODE: u32 = 30_000_000;
+
     fn build_vf_info(ctx: &GspBootContext<'_, '_>) -> Result<Option<VfInfo>> {
         let total_vfs = match *ctx.vgpu_state {
             VgpuState::Disabled => return Ok(None),
@@ -300,6 +308,9 @@ pub(crate) fn new(ctx: &GspBootContext<'_, '_>) -> Result<Self> {
             pci_config_mirror_base: mirror.start.into(),
             pci_config_mirror_size: (mirror.end - mirror.start).into(),
             host_arch: HostArch::host().into(),
+            default_timeout_us_vgpu: Self::DEFAULT_TIMEOUT_US_VGPU.into(),
+            default_timeout_us_graphics_mode: Self::DEFAULT_TIMEOUT_US_GRAPHICS_MODE.into(),
+            default_timeout_us_compute_mode: Self::DEFAULT_TIMEOUT_US_COMPUTE_MODE.into(),
             bus_device_func: u64::from(bus_device_func).into(),
             regkeys,
             vf_info: Self::build_vf_info(ctx)?,
Signature · 1 line
2.53.0