[PATCH v6 33/34] gpu: nova-core: Hopper/Blackwell: new location for PCI config mirror

John Hubbard posted 34 patches 1 month ago
There is a newer version of this series
[PATCH v6 33/34] gpu: nova-core: Hopper/Blackwell: new location for PCI config mirror
Posted by John Hubbard 1 month ago
Hopper and Blackwell GPUs use a different PCI config space mirror
address than older architectures. Update SetSystemInfo to accept a
chipset parameter and select the correct address based on architecture.

Signed-off-by: John Hubbard <jhubbard@nvidia.com>
---
 drivers/gpu/nova-core/gsp/boot.rs        |  2 +-
 drivers/gpu/nova-core/gsp/commands.rs    |  8 +++++---
 drivers/gpu/nova-core/gsp/fw/commands.rs | 18 +++++++++++++++---
 3 files changed, 21 insertions(+), 7 deletions(-)

diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
index 7bf160723acf..7b49ca6e7a41 100644
--- a/drivers/gpu/nova-core/gsp/boot.rs
+++ b/drivers/gpu/nova-core/gsp/boot.rs
@@ -257,7 +257,7 @@ pub(crate) fn boot(
         dma_write!(wpr_meta[0] = GspFwWprMeta::new(&gsp_fw, &fb_layout))?;
 
         self.cmdq
-            .send_command(bar, commands::SetSystemInfo::new(pdev))?;
+            .send_command(bar, commands::SetSystemInfo::new(pdev, chipset))?;
         self.cmdq.send_command(bar, commands::SetRegistry::new())?;
 
         gsp_falcon.reset(bar)?;
diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/gsp/commands.rs
index 8f270eca33be..e6a9a1fc6296 100644
--- a/drivers/gpu/nova-core/gsp/commands.rs
+++ b/drivers/gpu/nova-core/gsp/commands.rs
@@ -20,6 +20,7 @@
 
 use crate::{
     driver::Bar0,
+    gpu::Chipset,
     gsp::{
         cmdq::{
             Cmdq,
@@ -37,12 +38,13 @@
 /// The `GspSetSystemInfo` command.
 pub(crate) struct SetSystemInfo<'a> {
     pdev: &'a pci::Device<device::Bound>,
+    chipset: Chipset,
 }
 
 impl<'a> SetSystemInfo<'a> {
     /// Creates a new `GspSetSystemInfo` command using the parameters of `pdev`.
-    pub(crate) fn new(pdev: &'a pci::Device<device::Bound>) -> Self {
-        Self { pdev }
+    pub(crate) fn new(pdev: &'a pci::Device<device::Bound>, chipset: Chipset) -> Self {
+        Self { pdev, chipset }
     }
 }
 
@@ -52,7 +54,7 @@ impl<'a> CommandToGsp for SetSystemInfo<'a> {
     type InitError = Error;
 
     fn init(&self) -> impl Init<Self::Command, Self::InitError> {
-        GspSetSystemInfo::init(self.pdev)
+        GspSetSystemInfo::init(self.pdev, self.chipset)
     }
 }
 
diff --git a/drivers/gpu/nova-core/gsp/fw/commands.rs b/drivers/gpu/nova-core/gsp/fw/commands.rs
index db46276430be..c8d1e025b047 100644
--- a/drivers/gpu/nova-core/gsp/fw/commands.rs
+++ b/drivers/gpu/nova-core/gsp/fw/commands.rs
@@ -10,7 +10,13 @@
     }, //
 };
 
-use crate::gsp::GSP_PAGE_SIZE;
+use crate::{
+    gpu::{
+        Architecture,
+        Chipset, //
+    },
+    gsp::GSP_PAGE_SIZE, //
+};
 
 use super::bindings;
 
@@ -24,7 +30,10 @@ pub(crate) struct GspSetSystemInfo {
 impl GspSetSystemInfo {
     /// Returns an in-place initializer for the `GspSetSystemInfo` command.
     #[allow(non_snake_case)]
-    pub(crate) fn init<'a>(dev: &'a pci::Device<device::Bound>) -> impl Init<Self, Error> + 'a {
+    pub(crate) fn init<'a>(
+        dev: &'a pci::Device<device::Bound>,
+        chipset: Chipset,
+    ) -> impl Init<Self, Error> + 'a {
         type InnerGspSystemInfo = bindings::GspSystemInfo;
         let init_inner = try_init!(InnerGspSystemInfo {
             gpuPhysAddr: dev.resource_start(0)?,
@@ -35,7 +44,10 @@ pub(crate) fn init<'a>(dev: &'a pci::Device<device::Bound>) -> impl Init<Self, E
             // Using TASK_SIZE in r535_gsp_rpc_set_system_info() seems wrong because
             // TASK_SIZE is per-task. That's probably a design issue in GSP-RM though.
             maxUserVa: (1 << 47) - 4096,
-            pciConfigMirrorBase: 0x088000,
+            pciConfigMirrorBase: match chipset.arch() {
+                Architecture::Turing | Architecture::Ampere | Architecture::Ada => 0x088000,
+                Architecture::Hopper | Architecture::Blackwell => 0x092000,
+            },
             pciConfigMirrorSize: 0x001000,
 
             PCIDeviceID: (u32::from(dev.device_id()) << 16) | u32::from(dev.vendor_id().as_raw()),
-- 
2.53.0
Re: [PATCH v6 33/34] gpu: nova-core: Hopper/Blackwell: new location for PCI config mirror
Posted by Alexandre Courbot 3 weeks, 2 days ago
On Tue Mar 10, 2026 at 11:11 AM JST, John Hubbard wrote:
> Hopper and Blackwell GPUs use a different PCI config space mirror
> address than older architectures. Update SetSystemInfo to accept a
> chipset parameter and select the correct address based on architecture.
>
> Signed-off-by: John Hubbard <jhubbard@nvidia.com>
> ---
>  drivers/gpu/nova-core/gsp/boot.rs        |  2 +-
>  drivers/gpu/nova-core/gsp/commands.rs    |  8 +++++---
>  drivers/gpu/nova-core/gsp/fw/commands.rs | 18 +++++++++++++++---
>  3 files changed, 21 insertions(+), 7 deletions(-)
>
> diff --git a/drivers/gpu/nova-core/gsp/boot.rs b/drivers/gpu/nova-core/gsp/boot.rs
> index 7bf160723acf..7b49ca6e7a41 100644
> --- a/drivers/gpu/nova-core/gsp/boot.rs
> +++ b/drivers/gpu/nova-core/gsp/boot.rs
> @@ -257,7 +257,7 @@ pub(crate) fn boot(
>          dma_write!(wpr_meta[0] = GspFwWprMeta::new(&gsp_fw, &fb_layout))?;
>  
>          self.cmdq
> -            .send_command(bar, commands::SetSystemInfo::new(pdev))?;
> +            .send_command(bar, commands::SetSystemInfo::new(pdev, chipset))?;
>          self.cmdq.send_command(bar, commands::SetRegistry::new())?;
>  
>          gsp_falcon.reset(bar)?;
> diff --git a/drivers/gpu/nova-core/gsp/commands.rs b/drivers/gpu/nova-core/gsp/commands.rs
> index 8f270eca33be..e6a9a1fc6296 100644
> --- a/drivers/gpu/nova-core/gsp/commands.rs
> +++ b/drivers/gpu/nova-core/gsp/commands.rs
> @@ -20,6 +20,7 @@
>  
>  use crate::{
>      driver::Bar0,
> +    gpu::Chipset,
>      gsp::{
>          cmdq::{
>              Cmdq,
> @@ -37,12 +38,13 @@
>  /// The `GspSetSystemInfo` command.
>  pub(crate) struct SetSystemInfo<'a> {
>      pdev: &'a pci::Device<device::Bound>,
> +    chipset: Chipset,
>  }
>  
>  impl<'a> SetSystemInfo<'a> {
>      /// Creates a new `GspSetSystemInfo` command using the parameters of `pdev`.
> -    pub(crate) fn new(pdev: &'a pci::Device<device::Bound>) -> Self {
> -        Self { pdev }
> +    pub(crate) fn new(pdev: &'a pci::Device<device::Bound>, chipset: Chipset) -> Self {
> +        Self { pdev, chipset }
>      }
>  }
>  
> @@ -52,7 +54,7 @@ impl<'a> CommandToGsp for SetSystemInfo<'a> {
>      type InitError = Error;
>  
>      fn init(&self) -> impl Init<Self::Command, Self::InitError> {
> -        GspSetSystemInfo::init(self.pdev)
> +        GspSetSystemInfo::init(self.pdev, self.chipset)
>      }
>  }
>  
> diff --git a/drivers/gpu/nova-core/gsp/fw/commands.rs b/drivers/gpu/nova-core/gsp/fw/commands.rs
> index db46276430be..c8d1e025b047 100644
> --- a/drivers/gpu/nova-core/gsp/fw/commands.rs
> +++ b/drivers/gpu/nova-core/gsp/fw/commands.rs
> @@ -10,7 +10,13 @@
>      }, //
>  };
>  
> -use crate::gsp::GSP_PAGE_SIZE;
> +use crate::{
> +    gpu::{
> +        Architecture,
> +        Chipset, //
> +    },
> +    gsp::GSP_PAGE_SIZE, //
> +};
>  
>  use super::bindings;
>  
> @@ -24,7 +30,10 @@ pub(crate) struct GspSetSystemInfo {
>  impl GspSetSystemInfo {
>      /// Returns an in-place initializer for the `GspSetSystemInfo` command.
>      #[allow(non_snake_case)]
> -    pub(crate) fn init<'a>(dev: &'a pci::Device<device::Bound>) -> impl Init<Self, Error> + 'a {
> +    pub(crate) fn init<'a>(
> +        dev: &'a pci::Device<device::Bound>,
> +        chipset: Chipset,
> +    ) -> impl Init<Self, Error> + 'a {
>          type InnerGspSystemInfo = bindings::GspSystemInfo;
>          let init_inner = try_init!(InnerGspSystemInfo {
>              gpuPhysAddr: dev.resource_start(0)?,
> @@ -35,7 +44,10 @@ pub(crate) fn init<'a>(dev: &'a pci::Device<device::Bound>) -> impl Init<Self, E
>              // Using TASK_SIZE in r535_gsp_rpc_set_system_info() seems wrong because
>              // TASK_SIZE is per-task. That's probably a design issue in GSP-RM though.
>              maxUserVa: (1 << 47) - 4096,
> -            pciConfigMirrorBase: 0x088000,
> +            pciConfigMirrorBase: match chipset.arch() {
> +                Architecture::Turing | Architecture::Ampere | Architecture::Ada => 0x088000,
> +                Architecture::Hopper | Architecture::Blackwell => 0x092000,
> +            },

Can we document this in the code? I.e. is the new mirror space unavailable on chips < Hopper?
Re: [PATCH v6 33/34] gpu: nova-core: Hopper/Blackwell: new location for PCI config mirror
Posted by John Hubbard 3 weeks, 1 day ago
On 3/17/26 1:27 AM, Alexandre Courbot wrote:
> On Tue Mar 10, 2026 at 11:11 AM JST, John Hubbard wrote:
...
>> @@ -35,7 +44,10 @@ pub(crate) fn init<'a>(dev: &'a pci::Device<device::Bound>) -> impl Init<Self, E
>>              // Using TASK_SIZE in r535_gsp_rpc_set_system_info() seems wrong because
>>              // TASK_SIZE is per-task. That's probably a design issue in GSP-RM though.
>>              maxUserVa: (1 << 47) - 4096,
>> -            pciConfigMirrorBase: 0x088000,
>> +            pciConfigMirrorBase: match chipset.arch() {
>> +                Architecture::Turing | Architecture::Ampere | Architecture::Ada => 0x088000,
>> +                Architecture::Hopper | Architecture::Blackwell => 0x092000,
>> +            },
> 
> Can we document this in the code? I.e. is the new mirror space unavailable on chips < Hopper?

Yes, done.

Thanks for all of these review comments across the series. I have applied all
of them, and will post a v7 shortly on the very latest drm-rust-next.

thanks,
-- 
John Hubbard