* [PATCH v3 0/1] gpu: nova-core: populate VF information in GSP_INIT
@ 2026-10-19 17:16 Zhi Wang
2026-10-19 17:16 ` [PATCH v3 1/1] " Zhi Wang
0 siblings, 1 reply; 2+ messages in thread
From: Zhi Wang @ 2026-10-19 17:16 UTC (permalink / raw)
To: dakr, acourbot
Cc: airlied, simona, ojeda, alex.gaynor, boqun.feng, gary, bjorn3_gh,
lossin, a.hindborg, aliceryhl, tmgross, jhubbard, ecourtney,
apopple, cjia, smitra, kjaju, alkumar, ankita, aniketa,
kwankhede, targupta, nova-gpu, linux-kernel, zhiwang, Zhi Wang
This patch supplies VF topology to GSP-RM through GSP_INIT when vGPU
mode is enabled, allowing firmware to configure per-VF interrupt and
doorbell routing.
This patch depends on the PCI extended capability and SR-IOV support
patch, which has already been merged into driver-core-testing.
To avoid conflicts with the series currently under review, this patch is
based on a local merge of driver-core-testing into drm-rust-next, with
the following series applied on top:
- GSP command-queue preparation v4 [1].
- NVKV codec v4 [2].
- Boot on the r000 GSP firmware v3 [3].
- Channel ID allocation v9 [4], with its cv! v5 prerequisite [5].
Changes since v2 [6]:
- Rebase onto the integrated base and populate VF information through
the GSP_INIT NVKV schema.
- Use the merged PCI API's first_vf_offset() accessor and logical VF BAR
iterator.
[1] https://lore.kernel.org/nova-gpu/20261009-cmdq-rpc-v4-0-c9ab8de1d3f2@nvidia.com/
[2] https://lore.kernel.org/nova-gpu/20261016-b4-nvkv-v4-0-e8b92b91aa5b@nvidia.com/
[3] https://lore.kernel.org/nova-gpu/20260918010719.1176945-1-jhubbard@nvidia.com/
[4] https://lore.kernel.org/nova-gpu/20260930-chid-v9-0-0d6cca376cff@nvidia.com/
[5] https://lore.kernel.org/nova-gpu/20261013-cv-v5-0-113a538dfaef@nvidia.com/
[6] https://lore.kernel.org/nova-gpu/20260804170045.902069-1-zhiw@nvidia.com/
Zhi Wang (1):
gpu: nova-core: populate VF information in GSP_INIT
drivers/gpu/nova-core/gsp/fw/commands.rs | 34 +++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
base-commit: a767f1cd2b0da50e0dfc48d7991f55c92369ce6f
^ permalink raw reply [flat|nested] 2+ messages in thread
* [PATCH v3 1/1] gpu: nova-core: populate VF information in GSP_INIT
2026-10-19 17:16 [PATCH v3 0/1] gpu: nova-core: populate VF information in GSP_INIT Zhi Wang
@ 2026-10-19 17:16 ` Zhi Wang
0 siblings, 0 replies; 2+ messages in thread
From: Zhi Wang @ 2026-10-19 17:16 UTC (permalink / raw)
To: dakr, acourbot
Cc: airlied, simona, ojeda, alex.gaynor, boqun.feng, gary, bjorn3_gh,
lossin, a.hindborg, aliceryhl, tmgross, jhubbard, ecourtney,
apopple, cjia, smitra, kjaju, alkumar, ankita, aniketa,
kwankhede, targupta, nova-gpu, linux-kernel, zhiwang, Zhi Wang
GSP firmware requires the VF BAR layout to route interrupts and doorbell
events to individual virtual functions.
When vGPU mode is enabled, read the VF topology from the typed PCI SR-IOV
extended capability and populate the existing NVKV VF information schema
in GSP_INIT.
Link: https://lore.kernel.org/nova-gpu/20260730181404.776028-2-zhiw@nvidia.com/
Cc: Alexandre Courbot <acourbot@nvidia.com>
Signed-off-by: Zhi Wang <zhiw@nvidia.com>
---
drivers/gpu/nova-core/gsp/fw/commands.rs | 34 +++++++++++++++++++++++-
1 file changed, 33 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/nova-core/gsp/fw/commands.rs b/drivers/gpu/nova-core/gsp/fw/commands.rs
index 159f132d79d9..9ad730e22337 100644
--- a/drivers/gpu/nova-core/gsp/fw/commands.rs
+++ b/drivers/gpu/nova-core/gsp/fw/commands.rs
@@ -225,6 +225,38 @@ struct DomainBusDevice(u64) {
];
impl GspInitRequest {
+ fn build_vf_info(
+ dev: &pci::Device<device::Bound>,
+ vgpu_state: VgpuState,
+ ) -> Result<Option<VfInfo>> {
+ let total_vfs = match vgpu_state {
+ VgpuState::Disabled => return Ok(None),
+ VgpuState::Enabled { total_vfs } => total_vfs,
+ };
+
+ let sriov = dev
+ .config_space_extended()?
+ .find_ext_capability::<pci::ExtSriovRegs>()?
+ .ok_or(ENODEV)?;
+
+ let mut vf_bars = sriov.vf_bars()?;
+ let bar0 = vf_bars.next().ok_or(EINVAL)?;
+ let bar1 = vf_bars.next().ok_or(EINVAL)?;
+ let bar2 = vf_bars.next().ok_or(EINVAL)?;
+ let flags = u64::from(bar0.is_64bit)
+ | (u64::from(bar1.is_64bit) << 1)
+ | (u64::from(bar2.is_64bit) << 2);
+
+ Ok(Some(VfInfo {
+ total_vfs: u32::from(total_vfs.get()).into(),
+ first_vf_offset: u32::from(sriov.first_vf_offset()).into(),
+ flags: flags.into(),
+ first_bar0_address: bar0.address.into(),
+ first_bar1_address: bar1.address.into(),
+ first_bar2_address: bar2.address.into(),
+ }))
+ }
+
/// Creates the request for `dev`.
///
/// The registry keys are [`REGISTRY_ENTRIES`], plus `RMSetSriovMode` when `vgpu_state` reports
@@ -265,7 +297,7 @@ pub(crate) fn new(
host_arch: HostArch::host().into(),
domain_bus_device: u64::from(domain_bus_device).into(),
regkeys,
- vf_info: None,
+ vf_info: Self::build_vf_info(dev, vgpu_state)?,
})
}
}
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2026-10-19 17:17 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-10-19 17:16 [PATCH v3 0/1] gpu: nova-core: populate VF information in GSP_INIT Zhi Wang
2026-10-19 17:16 ` [PATCH v3 1/1] " Zhi Wang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®