* [PATCH 0/2] nova/nouveau: add configs/module options to control binding behaviour
@ 2026-11-19 1:38 Dave Airlie via B4 Relay
2026-11-19 1:38 ` [PATCH 1/2] drm/nouveau: add option to leave GSP-capable GPUs to other drivers Dave Airlie via B4 Relay
2026-11-19 1:38 ` [PATCH 2/2] nova-core: only bind to GPUs when explicitly requested Dave Airlie via B4 Relay
0 siblings, 2 replies; 4+ messages in thread
From: Dave Airlie via B4 Relay @ 2026-11-19 1:38 UTC (permalink / raw)
To: Lyude Paul, Danilo Krummrich, Alexandre Courbot
Cc: dri-devel, nouveau, nova-gpu, Dave Airlie
We want to be able to build both nova and nouveau and maintain the
status quo for now of nouveau binding to all GSP enabled GPUs.
In the future we may suggest switching the default to nova, but
for now the default is to let users use command line options for testing
and developers building their own kernel can set the kconfig.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
Dave Airlie (2):
drm/nouveau: add option to leave GSP-capable GPUs to other drivers
nova-core: only bind to GPUs when explicitly requested
drivers/gpu/drm/nouveau/Kconfig | 17 +++++++++++++++++
drivers/gpu/drm/nouveau/include/nvkm/core/pci.h | 2 +-
drivers/gpu/drm/nouveau/nouveau_drm.c | 9 ++++++++-
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 16 +++++++++++++++-
drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c | 4 ++--
drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h | 2 +-
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 5 ++++-
drivers/gpu/nova-core/Kconfig | 21 +++++++++++++++++++++
drivers/gpu/nova-core/driver.rs | 13 +++++++++++++
drivers/gpu/nova-core/nova_core.rs | 4 ++++
10 files changed, 86 insertions(+), 7 deletions(-)
---
base-commit: e55a991e09e3b44f0b0d8206bb523dc57c086341
change-id: 20261119-nova-nouveau-gsp-10f8782498e4
Best regards,
--
Dave Airlie <airlied@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
* [PATCH 1/2] drm/nouveau: add option to leave GSP-capable GPUs to other drivers
2026-11-19 1:38 [PATCH 0/2] nova/nouveau: add configs/module options to control binding behaviour Dave Airlie via B4 Relay
@ 2026-11-19 1:38 ` Dave Airlie via B4 Relay
2026-11-19 1:52 ` sashiko-bot
2026-11-19 1:38 ` [PATCH 2/2] nova-core: only bind to GPUs when explicitly requested Dave Airlie via B4 Relay
1 sibling, 1 reply; 4+ messages in thread
From: Dave Airlie via B4 Relay @ 2026-11-19 1:38 UTC (permalink / raw)
To: Lyude Paul, Danilo Krummrich, Alexandre Courbot
Cc: dri-devel, nouveau, nova-gpu, Dave Airlie
From: Dave Airlie <airlied@redhat.com>
nouveau currently binds to every NVIDIA GPU it encounters. The
nova-core driver is being written for GSP-capable (Turing and later)
GPUs, so the two drivers compete for the same devices, with whichever
registers first winning.
Add the DRM_NOUVEAU_BIND_GSP Kconfig option (default y) and a bind_gsp
module parameter, defaulting to the Kconfig value and able to override
it in both directions, controlling whether nouveau claims GSP-capable
GPUs.
When binding is disabled, the GPU is rejected in nvkm_device_ctor(),
right after the chipset has been identified and before any subdevs are
constructed; constructing subdevs would already load GSP firmware for
a GPU that is not going to be used. Pre-Turing GPUs are always bound,
as no other driver claims them, and Tegra platform devices are
unaffected since nova-core only handles PCI devices.
Distributions that want nova-core to be the default driver for
GSP-capable GPUs can set CONFIG_DRM_NOUVEAU_BIND_GSP=n; the
nouveau.bind_gsp=0 kernel command line parameter switches it at boot
time.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/nouveau/Kconfig | 17 +++++++++++++++++
drivers/gpu/drm/nouveau/include/nvkm/core/pci.h | 2 +-
drivers/gpu/drm/nouveau/nouveau_drm.c | 9 ++++++++-
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 16 +++++++++++++++-
drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c | 4 ++--
drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h | 2 +-
drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c | 5 ++++-
7 files changed, 48 insertions(+), 7 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/Kconfig b/drivers/gpu/drm/nouveau/Kconfig
index 3b5757aed9c8..863cc235838b 100644
--- a/drivers/gpu/drm/nouveau/Kconfig
+++ b/drivers/gpu/drm/nouveau/Kconfig
@@ -120,3 +120,20 @@ config DRM_NOUVEAU_SIL164
help
Support for sil164 and similar single-link (or dual-link
when used in pairs) TMDS transmitters.
+
+config DRM_NOUVEAU_BIND_GSP
+ bool "Make nouveau the default driver for GSP-capable GPUs"
+ depends on DRM_NOUVEAU
+ default y
+ help
+ Make nouveau bind to all NVIDIA GPUs by default, as it always
+ has.
+
+ If another NVIDIA driver, such as nova-core, should claim the
+ GSP-capable (Turing and later) GPUs instead, say N here; nouveau
+ then leaves those GPUs to other drivers and continues to bind to
+ older GPUs itself. nouveau can also be prevented from binding to
+ GSP-capable GPUs at boot with nouveau.bind_gsp=0 on the kernel
+ command line.
+
+ If unsure, say Y.
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h b/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h
index 7444c4d59e09..075fe192b26f 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h
@@ -10,5 +10,5 @@ struct nvkm_device_pci {
};
int nvkm_device_pci_new(struct pci_dev *, const char *cfg, const char *dbg,
- struct nvkm_device **);
+ bool bind_gsp, struct nvkm_device **);
#endif
diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
index 5e1336615cf6..582eb0c91b10 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -112,6 +112,11 @@ MODULE_PARM_DESC(runpm, "disable (0), force enable (1), optimus only default (-1
static int nouveau_runtime_pm = -1;
module_param_named(runpm, nouveau_runtime_pm, int, 0400);
+MODULE_PARM_DESC(bind_gsp, "bind to GSP-capable (Turing and later) GPUs "
+ "(0 = leave them to other drivers, e.g. nova)");
+static bool nouveau_bind_gsp = IS_ENABLED(CONFIG_DRM_NOUVEAU_BIND_GSP);
+module_param_named(bind_gsp, nouveau_bind_gsp, bool, 0400);
+
static const struct drm_driver driver_legacy_kms;
static const struct drm_driver driver_atomic_kms;
@@ -881,7 +886,8 @@ static int nouveau_drm_probe(struct pci_dev *pdev,
/* We need to check that the chipset is supported before booting
* fbdev off the hardware, as there's no way to put it back.
*/
- ret = nvkm_device_pci_new(pdev, nouveau_config, nouveau_debug, &device);
+ ret = nvkm_device_pci_new(pdev, nouveau_config, nouveau_debug,
+ nouveau_bind_gsp, &device);
if (ret)
return ret;
@@ -1460,6 +1466,7 @@ static void nouveau_display_options(void)
DRM_DEBUG_DRIVER("... runpm : %d\n", nouveau_runtime_pm);
DRM_DEBUG_DRIVER("... vram_pushbuf : %d\n", nouveau_vram_pushbuf);
DRM_DEBUG_DRIVER("... hdmimhz : %d\n", nouveau_hdmimhz);
+ DRM_DEBUG_DRIVER("... bind_gsp : %d\n", nouveau_bind_gsp);
}
static const struct dev_pm_ops nouveau_pm_ops = {
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
index a2ed8c4fe52a..a027860fa869 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
@@ -3143,7 +3143,7 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
const struct nvkm_device_quirk *quirk,
struct device *dev, enum nvkm_device_type type, u64 handle,
const char *name, const char *cfg, const char *dbg,
- struct nvkm_device *device)
+ bool bind_gsp, struct nvkm_device *device)
{
struct nvkm_subdev *subdev;
u64 mmio_base, mmio_size;
@@ -3381,6 +3381,20 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
goto done;
}
+ /* Unless nouveau is the default NVIDIA driver, leave GSP-capable
+ * (Turing and later) PCI GPUs to other drivers, such as nova-core.
+ * Older GPUs are always bound.
+ *
+ * Reject before subdevs are constructed, as that would already load
+ * GSP firmware for GPUs that are not going to be used.
+ */
+ if (device->func->pci && device->card_type >= TU100 && !bind_gsp) {
+ nvdev_info(device, "leaving GSP-capable GPU to other drivers "
+ "(bind_gsp=0)\n");
+ ret = -ENODEV;
+ goto done;
+ }
+
/* read strapping information */
strap = nvkm_rd32(device, 0x101000);
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c
index 248623b91e29..1477a2fff51f 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c
@@ -1650,7 +1650,7 @@ nvkm_device_pci_func = {
int
nvkm_device_pci_new(struct pci_dev *pci_dev, const char *cfg, const char *dbg,
- struct nvkm_device **pdevice)
+ bool bind_gsp, struct nvkm_device **pdevice)
{
const struct nvkm_device_quirk *quirk = NULL;
const struct nvkm_device_pci_device *pcid;
@@ -1703,7 +1703,7 @@ nvkm_device_pci_new(struct pci_dev *pci_dev, const char *cfg, const char *dbg,
pci_dev->bus->number << 16 |
PCI_SLOT(pci_dev->devfn) << 8 |
PCI_FUNC(pci_dev->devfn), name,
- cfg, dbg, &pdev->device);
+ cfg, dbg, bind_gsp, &pdev->device);
if (ret)
return ret;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h b/drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h
index d0c40f034244..a462051d2977 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/priv.h
@@ -54,7 +54,7 @@ int nvkm_device_ctor(const struct nvkm_device_func *,
const struct nvkm_device_quirk *,
struct device *, enum nvkm_device_type, u64 handle,
const char *name, const char *cfg, const char *dbg,
- struct nvkm_device *);
+ bool bind_gsp, struct nvkm_device *);
int nvkm_device_init(struct nvkm_device *);
int nvkm_device_fini(struct nvkm_device *, enum nvkm_suspend_state suspend);
#endif
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
index 3c8d0878891a..1e69662f91cd 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/tegra.c
@@ -329,9 +329,12 @@ nvkm_device_tegra_new(const struct nvkm_device_tegra_func *func,
tdev->gpu_speedo = tegra_sku_info.gpu_speedo_value;
tdev->gpu_speedo_id = tegra_sku_info.gpu_speedo_id;
+ /* Platform devices are always bound, regardless of the bind_gsp
+ * policy for PCI devices.
+ */
ret = nvkm_device_ctor(&nvkm_device_tegra_func, NULL, &pdev->dev,
NVKM_DEVICE_TEGRA, pdev->id, NULL,
- cfg, dbg, &tdev->device);
+ cfg, dbg, true, &tdev->device);
if (ret)
goto powerdown;
--
2.56.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* [PATCH 2/2] nova-core: only bind to GPUs when explicitly requested
2026-11-19 1:38 [PATCH 0/2] nova/nouveau: add configs/module options to control binding behaviour Dave Airlie via B4 Relay
2026-11-19 1:38 ` [PATCH 1/2] drm/nouveau: add option to leave GSP-capable GPUs to other drivers Dave Airlie via B4 Relay
@ 2026-11-19 1:38 ` Dave Airlie via B4 Relay
1 sibling, 0 replies; 4+ messages in thread
From: Dave Airlie via B4 Relay @ 2026-11-19 1:38 UTC (permalink / raw)
To: Lyude Paul, Danilo Krummrich, Alexandre Courbot
Cc: dri-devel, nouveau, nova-gpu, Dave Airlie
From: Dave Airlie <airlied@redhat.com>
nova-core currently binds to every NVIDIA GPU it supports
(GSP-capable, Turing and later GPUs), competing with nouveau for the
same devices.
Add the NOVA_CORE_BIND_GSP Kconfig option (default n) and a bind_gsp
module parameter, defaulting to the Kconfig value and able to override
it in both directions. Unless one of them requests binding, probe()
rejects the GPU with -ENODEV and leaves the device to other drivers,
such as nouveau. The PCI driver still registers, so module autoloading
via modalias keeps working when binding is disabled.
As nova-core is work in progress, the default is to not bind at all.
Developers can enable binding with CONFIG_NOVA_CORE_BIND_GSP=y, or
nova-core.bind_gsp=1 on the kernel command line, combined with
nouveau.bind_gsp=0 (or CONFIG_DRM_NOUVEAU_BIND_GSP=n) so that nouveau
yields the GSP-capable GPUs.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/nova-core/Kconfig | 21 +++++++++++++++++++++
drivers/gpu/nova-core/driver.rs | 13 +++++++++++++
drivers/gpu/nova-core/nova_core.rs | 4 ++++
3 files changed, 38 insertions(+)
diff --git a/drivers/gpu/nova-core/Kconfig b/drivers/gpu/nova-core/Kconfig
index 2e11e46c99c7..058742d50692 100644
--- a/drivers/gpu/nova-core/Kconfig
+++ b/drivers/gpu/nova-core/Kconfig
@@ -30,3 +30,24 @@ config NOVA_CORE_SELFTESTS
logs its failure and lets the probe continue.
If unsure, say N.
+
+config NOVA_CORE_BIND_GSP
+ bool "Make nova-core the default driver for GSP-capable GPUs"
+ depends on NOVA_CORE
+ default n
+ help
+ Make nova-core bind to all NVIDIA GPUs it supports by default.
+
+ By default nova-core does not bind to any GPU and leaves NVIDIA
+ GPUs to other drivers, such as nouveau. Say Y here, or boot with
+ nova-core.bind_gsp=1, to make nova-core claim NVIDIA GPUs
+ instead.
+
+ nova-core is work in progress and may not be functional, so this
+ is intended for nova developers and testers only. When enabled,
+ nouveau must not bind to the same (GSP-capable) GPUs, i.e.
+ CONFIG_DRM_NOUVEAU_BIND_GSP=N or nouveau.bind_gsp=0 is required.
+ Otherwise both drivers compete for the same devices and
+ whichever is loaded first wins.
+
+ If unsure, say N.
diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs
index d6bc972d47c7..66208a244cab 100644
--- a/drivers/gpu/nova-core/driver.rs
+++ b/drivers/gpu/nova-core/driver.rs
@@ -105,6 +105,19 @@ fn probe<'bound>(
dev_dbg!(pdev, "Probe Nova Core GPU driver.\n");
try_pin_init!(NovaCore {
+ // Only bind when explicitly requested through the corresponding
+ // Kconfig option or module parameter. By default, leave NVIDIA
+ // GPUs to other drivers, such as nouveau.
+ _: {
+ if !crate::module_parameters::bind_gsp.value() {
+ dev_info!(
+ pdev,
+ "Not binding to GPU; make nova-core the default NVIDIA driver with CONFIG_NOVA_CORE_BIND_GSP=y or nova-core.bind_gsp=1\n"
+ );
+ Err(ENODEV)?;
+ }
+ },
+
_: {
pdev.enable_device_mem()?;
pdev.set_master();
diff --git a/drivers/gpu/nova-core/nova_core.rs b/drivers/gpu/nova-core/nova_core.rs
index 84f777844592..d18dacad98b6 100644
--- a/drivers/gpu/nova-core/nova_core.rs
+++ b/drivers/gpu/nova-core/nova_core.rs
@@ -97,6 +97,10 @@ fn init(module: &'static kernel::ThisModule) -> impl PinInit<Self, Error> {
default: false,
description: "Keep the GSP-RM log buffers in debugfs after their GPU is unbound",
},
+ bind_gsp: bool {
+ default: cfg!(CONFIG_NOVA_CORE_BIND_GSP),
+ description: "Bind to GSP-capable GPUs, making nova-core the default NVIDIA driver",
+ },
},
}
--
2.56.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [PATCH 1/2] drm/nouveau: add option to leave GSP-capable GPUs to other drivers
2026-11-19 1:38 ` [PATCH 1/2] drm/nouveau: add option to leave GSP-capable GPUs to other drivers Dave Airlie via B4 Relay
@ 2026-11-19 1:52 ` sashiko-bot
0 siblings, 0 replies; 4+ messages in thread
From: sashiko-bot @ 2026-11-19 1:52 UTC (permalink / raw)
To: Dave Airlie, Lyude Paul, Danilo Krummrich, Alexandre Courbot
Cc: dri-devel, nova-gpu
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [High] drm/nouveau: resource leak and stale list entry in
nvkm_device_ctor()
--
commit 2b74a622d800f1d2cd12ecd10013a3d94e2a156e
Author: Dave Airlie <airlied@redhat.com>
drm/nouveau: add option to leave GSP-capable GPUs to other drivers
This commit adds a DRM_NOUVEAU_BIND_GSP Kconfig option and a bind_gsp
module parameter to let nouveau skip GSP-capable (Turing and later) PCI
GPUs so other drivers such as nova-core can claim them.
> diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
> index a2ed8c4fe52a0..a027860fa8694 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
[ ... ]
> @@ -3381,6 +3381,20 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
> goto done;
> }
>
> + /* Unless nouveau is the default NVIDIA driver, leave GSP-capable
> + * (Turing and later) PCI GPUs to other drivers, such as nova-core.
> + * Older GPUs are always bound.
> + *
> + * Reject before subdevs are constructed, as that would already load
> + * GSP firmware for GPUs that are not going to be used.
> + */
> + if (device->func->pci && device->card_type >= TU100 && !bind_gsp) {
> + nvdev_info(device, "leaving GSP-capable GPU to other drivers "
> + "(bind_gsp=0)\n");
> + ret = -ENODEV;
> + goto done;
> + }
> +
> /* read strapping information */
> strap = nvkm_rd32(device, 0x101000);
[Severity: High]
Does rejecting a GPU here leak pdev, leave pci_dev enabled, and leave a
freed or stale entry on nv_devices?
Before reaching this check, nvkm_device_pci_new() calls
pci_enable_device() and allocates pdev, and nvkm_device_ctor() adds
&device->head to the global nv_devices list:
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c:nvkm_device_ctor() {
...
list_add_tail(&device->head, &nv_devices);
...
done:
if (ret && device->pri) {
iounmap(device->pri);
device->pri = NULL;
}
mutex_unlock(&nv_devices_mutex);
return ret;
}
When nvkm_device_ctor() returns -ENODEV, the done label only unmaps
device->pri, and nvkm_device_pci_new() and nouveau_drm_probe() return
ret immediately without unlinking device->head from nv_devices, calling
pci_disable_device(), or freeing pdev. This leaves the PCI device's
enable_cnt elevated when handing off to another driver and causes any
later nouveau probe of the same device handle to fail with -EEXIST.
(Note that calling nvkm_device_del() directly on this failure path would
also hit an uninitialized device->intr.intr list in nvkm_intr_dtor(),
since nvkm_intr_ctor() has not run yet.)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261119-nova-nouveau-gsp-v1-0-4cde2bc41132@redhat.com?part=1
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2026-11-19 1:52 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-19 1:38 [PATCH 0/2] nova/nouveau: add configs/module options to control binding behaviour Dave Airlie via B4 Relay
2026-11-19 1:38 ` [PATCH 1/2] drm/nouveau: add option to leave GSP-capable GPUs to other drivers Dave Airlie via B4 Relay
2026-11-19 1:52 ` sashiko-bot
2026-11-19 1:38 ` [PATCH 2/2] nova-core: only bind to GPUs when explicitly requested Dave Airlie via B4 Relay
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox