* [PATCH v4 0/2] nova/nouveau: add configs/module options to control binding behaviour
@ 2026-12-03 4:21 Dave Airlie via B4 Relay
2026-12-03 4:21 ` [PATCH v4 1/2] drm/nouveau: leave GSP-capable GPUs to nova-core when requested Dave Airlie via B4 Relay
2026-12-03 4:21 ` [PATCH v4 2/2] nova-core: only bind to GPUs when explicitly requested Dave Airlie via B4 Relay
0 siblings, 2 replies; 5+ messages in thread
From: Dave Airlie via B4 Relay @ 2026-12-03 4:21 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.
This version isn't exactly what Danilo asked for, but I think it does
the same thing, a single option that is NOVA only, and nouveau still respects
it.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
Changes in v4:
- use a single Kconfig option (Danilo)
- Link to v3: https://lore.kernel.org/r/20261124-nova-nouveau-gsp-v3-0-e1440479ded6@redhat.com
Changes in v3:
- back to single nouveau patch
- fixes ctor teardown path (Danilo)
- fixes passing bind_gsp flag (John)
- nova
- move to using a function (Danilo)
- Link to v2: https://lore.kernel.org/r/20261123-nova-nouveau-gsp-v2-0-5e8c27aa8555@redhat.com
Changes in v2:
- nouveau dtor path is broken, so fix that before adding the new code. (Sashiko)
- Link to v1: https://lore.kernel.org/r/20261119-nova-nouveau-gsp-v1-0-4cde2bc41132@redhat.com
---
Dave Airlie (2):
drm/nouveau: leave GSP-capable GPUs to nova-core when requested
nova-core: only bind to GPUs when explicitly requested
drivers/gpu/drm/nouveau/include/nvkm/core/pci.h | 6 +-
drivers/gpu/drm/nouveau/nouveau_drm.c | 10 +++-
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 67 ++++++++++++++++++-----
drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c | 11 +++-
drivers/gpu/nova-core/Kconfig | 21 +++++++
drivers/gpu/nova-core/driver.rs | 4 ++
drivers/gpu/nova-core/nova_core.rs | 24 ++++++++
7 files changed, 124 insertions(+), 19 deletions(-)
---
base-commit: bf3cac4a67a95ccd99763cf6e367fcbff93e0142
change-id: 20261119-nova-nouveau-gsp-10f8782498e4
Best regards,
--
Dave Airlie <airlied@redhat.com>
^ permalink raw reply [flat|nested] 5+ messages in thread
* [PATCH v4 1/2] drm/nouveau: leave GSP-capable GPUs to nova-core when requested
2026-12-03 4:21 [PATCH v4 0/2] nova/nouveau: add configs/module options to control binding behaviour Dave Airlie via B4 Relay
@ 2026-12-03 4:21 ` Dave Airlie via B4 Relay
2026-12-03 4:41 ` sashiko-bot
2026-12-03 4:21 ` [PATCH v4 2/2] nova-core: only bind to GPUs when explicitly requested Dave Airlie via B4 Relay
1 sibling, 1 reply; 5+ messages in thread
From: Dave Airlie via B4 Relay @ 2026-12-03 4:21 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.
Make nouveau leave GSP-capable GPUs to nova-core when nova-core has
been made the default driver for them: the nouveau bind_gsp module
parameter now defaults to the inverse of the NOVA_CORE_BIND_GSP option
introduced by the follow-up patch ("nova-core: only bind to GPUs when
explicitly requested"). Until that option exists, or in configurations
that do not build nova-core at all, its value is N and nouveau keeps
binding as before. The parameter still overrides the default in both
directions.
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.
Since a rejected GPU is handed off to another driver, the ctor failure
path now cleans up after itself: a new nvkm_device_dtor() (also used
by nvkm_device_del()) releases the subdevs, interrupt state, BAR
mapping and nv_devices membership of a partially constructed device,
so that the callers only have to release the resources they allocated
themselves. nvkm_device_pci_new() disables the PCI device and frees
the container on failure; the Tegra error handling already did the
equivalent. This also fixes the pre-existing leaks on the other ctor
failure paths (unknown chipset, vGPU detection), where the device
stayed on nv_devices with the PCI device enabled and the allocation
leaked.
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.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/drm/nouveau/include/nvkm/core/pci.h | 6 +-
drivers/gpu/drm/nouveau/nouveau_drm.c | 10 +++-
drivers/gpu/drm/nouveau/nvkm/engine/device/base.c | 67 ++++++++++++++++++-----
drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c | 11 +++-
4 files changed, 75 insertions(+), 19 deletions(-)
diff --git a/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h b/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h
index 7444c4d59e09..4ba9313a736b 100644
--- a/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h
+++ b/drivers/gpu/drm/nouveau/include/nvkm/core/pci.h
@@ -7,8 +7,12 @@ struct nvkm_device_pci {
struct nvkm_device device;
struct pci_dev *pdev;
bool suspend;
+ /* GSP-capable (Turing and later) GPUs may be bound; mirrors the
+ * bind_gsp module parameter.
+ */
+ bool bind_gsp;
};
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..6f279d78066c 100644
--- a/drivers/gpu/drm/nouveau/nouveau_drm.c
+++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
@@ -112,6 +112,12 @@ 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 "
+ "(default: Y unless CONFIG_NOVA_CORE_BIND_GSP is set; "
+ "0 = leave them to other drivers, e.g. nova)");
+static bool nouveau_bind_gsp = !IS_ENABLED(CONFIG_NOVA_CORE_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 +887,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 +1467,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..9d8e82781a25 100644
--- a/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
+++ b/drivers/gpu/drm/nouveau/nvkm/engine/device/base.c
@@ -25,6 +25,7 @@
#include "acpi.h"
#include <core/option.h>
+#include <core/pci.h>
#include <subdev/bios.h>
#include <subdev/therm.h>
@@ -3081,22 +3082,37 @@ nvkm_device_init(struct nvkm_device *device)
return ret;
}
+/* Release the state constructed by nvkm_device_ctor(), apart from the
+ * resources owned by the caller (bus-specific state and the container
+ * allocation).
+ *
+ * Must be called with nv_devices_mutex held.
+ */
+static void
+nvkm_device_dtor(struct nvkm_device *device)
+{
+ struct nvkm_subdev *subdev, *tmp;
+
+ nvkm_intr_dtor(device);
+
+ list_for_each_entry_safe_reverse(subdev, tmp, &device->subdev, head)
+ nvkm_subdev_del(&subdev);
+
+ if (device->pri)
+ iounmap(device->pri);
+
+ list_del(&device->head);
+}
+
void
nvkm_device_del(struct nvkm_device **pdevice)
{
struct nvkm_device *device = *pdevice;
- struct nvkm_subdev *subdev, *subtmp;
+
if (device) {
mutex_lock(&nv_devices_mutex);
- nvkm_intr_dtor(device);
-
- list_for_each_entry_safe_reverse(subdev, subtmp, &device->subdev, head)
- nvkm_subdev_del(&subdev);
-
- if (device->pri)
- iounmap(device->pri);
- list_del(&device->head);
+ nvkm_device_dtor(device);
if (device->func->dtor)
*pdevice = device->func->dtor(device);
@@ -3152,6 +3168,14 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
unsigned chipset;
mutex_lock(&nv_devices_mutex);
+
+ /* Initialize the state that the failure unwinding at done: relies
+ * on, so that it is safe to run on every error path.
+ */
+ INIT_LIST_HEAD(&device->head);
+ INIT_LIST_HEAD(&device->subdev);
+ nvkm_intr_ctor(device);
+
if (nvkm_device_find_locked(handle))
goto done;
@@ -3165,7 +3189,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
device->name = name;
list_add_tail(&device->head, &nv_devices);
device->debug = nvkm_dbgopt(device->dbgopt, "device");
- INIT_LIST_HEAD(&device->subdev);
mmio_base = device->func->resource_addr(device, NVKM_BAR0_PRI);
mmio_size = device->func->resource_size(device, NVKM_BAR0_PRI);
@@ -3381,6 +3404,21 @@ 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 &&
+ !device->func->pci(device)->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);
@@ -3402,7 +3440,6 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
device->name = device->chip->name;
mutex_init(&device->mutex);
- nvkm_intr_ctor(device);
#define NVKM_LAYOUT_ONCE(type,data,ptr) \
if (device->chip->ptr.inst) { \
@@ -3446,9 +3483,11 @@ nvkm_device_ctor(const struct nvkm_device_func *func,
ret = nvkm_intr_install(device);
done:
- if (ret && device->pri) {
- iounmap(device->pri);
- device->pri = NULL;
+ if (ret) {
+ /* Unwind the partially constructed device, so that the caller
+ * only has to release the resources it allocated itself.
+ */
+ nvkm_device_dtor(device);
}
mutex_unlock(&nv_devices_mutex);
return ret;
diff --git a/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c b/drivers/gpu/drm/nouveau/nvkm/engine/device/pci.c
index 248623b91e29..7e0127ff415f 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;
@@ -1692,8 +1692,8 @@ nvkm_device_pci_new(struct pci_dev *pci_dev, const char *cfg, const char *dbg,
pci_disable_device(pci_dev);
return -ENOMEM;
}
- *pdevice = &pdev->device;
pdev->pdev = pci_dev;
+ pdev->bind_gsp = bind_gsp;
ret = nvkm_device_ctor(&nvkm_device_pci_func, quirk, &pci_dev->dev,
pci_is_pcie(pci_dev) ? NVKM_DEVICE_PCIE :
@@ -1705,8 +1705,13 @@ nvkm_device_pci_new(struct pci_dev *pci_dev, const char *cfg, const char *dbg,
PCI_FUNC(pci_dev->devfn), name,
cfg, dbg, &pdev->device);
- if (ret)
+ if (ret) {
+ pci_disable_device(pci_dev);
+ kfree(pdev);
return ret;
+ }
+
+ *pdevice = &pdev->device;
/* Set DMA mask based on capabilities reported by the MMU subdev. */
if (pdev->device.mmu && !pdev->device.pci->agp.bridge)
--
2.56.1
^ permalink raw reply related [flat|nested] 5+ messages in thread
* [PATCH v4 2/2] nova-core: only bind to GPUs when explicitly requested
2026-12-03 4:21 [PATCH v4 0/2] nova/nouveau: add configs/module options to control binding behaviour Dave Airlie via B4 Relay
2026-12-03 4:21 ` [PATCH v4 1/2] drm/nouveau: leave GSP-capable GPUs to nova-core when requested Dave Airlie via B4 Relay
@ 2026-12-03 4:21 ` Dave Airlie via B4 Relay
2026-12-03 4:37 ` sashiko-bot
1 sibling, 1 reply; 5+ messages in thread
From: Dave Airlie via B4 Relay @ 2026-12-03 4:21 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.
The option is also the single switch deciding which driver claims
GSP-capable GPUs by default: nouveau's bind_gsp parameter (previous
patch) defaults to its inverse, so saying Y here makes nova-core the
default driver for GSP-capable GPUs without any additional nouveau
configuration. Configurations that do not build nova-core at all are
unaffected.
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.
Signed-off-by: Dave Airlie <airlied@redhat.com>
---
drivers/gpu/nova-core/Kconfig | 21 +++++++++++++++++++++
drivers/gpu/nova-core/driver.rs | 4 ++++
drivers/gpu/nova-core/nova_core.rs | 24 ++++++++++++++++++++++++
3 files changed, 49 insertions(+)
diff --git a/drivers/gpu/nova-core/Kconfig b/drivers/gpu/nova-core/Kconfig
index 2e11e46c99c7..a6d8797d245c 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,
+ and have nouveau leave GSP-capable (Turing and later) GPUs to
+ nova-core instead of claiming them itself. Pre-Turing GPUs are
+ always left to nouveau.
+
+ 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 GSP-capable GPUs
+ instead. For a single boot, nouveau.bind_gsp=1 makes nouveau
+ claim them again.
+
+ nova-core is work in progress and may not be functional, so this
+ is intended for nova developers and testers only.
+
+ If unsure, say N.
diff --git a/drivers/gpu/nova-core/driver.rs b/drivers/gpu/nova-core/driver.rs
index bea1b1b0844c..89f53944597c 100644
--- a/drivers/gpu/nova-core/driver.rs
+++ b/drivers/gpu/nova-core/driver.rs
@@ -106,6 +106,10 @@ fn probe<'bound>(
dev_dbg!(pdev, "Probe Nova Core GPU driver.\n");
try_pin_init!(NovaCore {
+ _: {
+ crate::NovaCoreModule::check_bind_allowed(pdev)?;
+ },
+
_: {
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..0aaf4f6c07f8 100644
--- a/drivers/gpu/nova-core/nova_core.rs
+++ b/drivers/gpu/nova-core/nova_core.rs
@@ -4,6 +4,7 @@
use kernel::{
device,
+ device::Core,
driver::Registration,
pci,
prelude::*,
@@ -68,6 +69,25 @@ pub(crate) fn debugfs_data<'a>(_dev: &'a device::Device<device::Bound>) -> &'a D
}
}
+impl NovaCoreModule {
+ /// Check whether nova-core is allowed to bind to GPUs.
+ ///
+ /// Binding needs to be requested explicitly, either through the
+ /// NOVA_CORE_BIND_GSP Kconfig option or the `bind_gsp` module parameter.
+ /// Otherwise, NVIDIA GPUs are left to other drivers, such as nouveau.
+ pub(crate) fn check_bind_allowed(pdev: &pci::Device<Core<'_>>) -> Result {
+ if crate::module_parameters::bind_gsp.value() {
+ return Ok(());
+ }
+
+ dev_info!(
+ pdev,
+ "Not binding to GPU; enable with CONFIG_NOVA_CORE_BIND_GSP=y or nova-core.bind_gsp=1\n"
+ );
+ Err(ENODEV)
+ }
+}
+
impl InPlaceModule for NovaCoreModule {
fn init(module: &'static kernel::ThisModule) -> impl PinInit<Self, Error> {
try_pin_init!(Self {
@@ -97,6 +117,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] 5+ messages in thread
* Re: [PATCH v4 2/2] nova-core: only bind to GPUs when explicitly requested
2026-12-03 4:21 ` [PATCH v4 2/2] nova-core: only bind to GPUs when explicitly requested Dave Airlie via B4 Relay
@ 2026-12-03 4:37 ` sashiko-bot
0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-12-03 4:37 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 4 potential
issues to consider:
- [Medium] nova-core: single-parameter bind_gsp override leaves drivers
competing
- [Medium] nova-core: NOVA_CORE_BIND_GSP omits DRM_NOUVEAU dependency
- [Medium] nova-core: bool NOVA_CORE_BIND_GSP auto-enabled by
allmodconfig/allyesconfig
- [Low] nova-core: check_bind_allowed() logs wrong advice on pre-Turing
GPUs
--
commit f2eb3485ce9fa1c56177d400d79136d6dcbb2d41
Author: Dave Airlie <airlied@redhat.com>
nova-core: only bind to GPUs when explicitly requested
This commit adds the NOVA_CORE_BIND_GSP Kconfig option and bind_gsp module
parameter so nova-core only binds to NVIDIA GPUs when explicitly requested,
returning -ENODEV from probe() otherwise.
> diff --git a/drivers/gpu/nova-core/Kconfig b/drivers/gpu/nova-core/Kconfig
> index 2e11e46c99c76..a6d8797d245ce 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
[Severity: Medium]
As reported by Danilo Krummrich on v2 [1], should NOVA_CORE_BIND_GSP depend
on DRM_NOUVEAU != n && NOVA_CORE != n instead of only NOVA_CORE?
When CONFIG_DRM_NOUVEAU=n, Kconfig still exposes this nouveau-vs-nova-core
switch, and bind_gsp defaults to cfg!(CONFIG_NOVA_CORE_BIND_GSP) in
nova_core.rs. A standalone nova-core build therefore rejects every GPU
probe with -ENODEV by default even though it is the only NVIDIA driver.
Gating NOVA_CORE_BIND_GSP on both drivers and defaulting bind_gsp to
!cfg!(CONFIG_DRM_NOUVEAU) || cfg!(CONFIG_NOVA_CORE_BIND_GSP) avoids both
problems.
[Severity: Medium]
As reported by Gary Guo on v3 [2], won't allmodconfig, allyesconfig, and
automated distro config scripts that select y on new booleans force
NOVA_CORE_BIND_GSP=y despite default n?
Because this option only flips the runtime binding defaults, enabling it
automatically makes work-in-progress nova-core claim Turing and later GPUs
while nouveau rejects them with -ENODEV. Using a Kconfig choice block
(whose default allmodconfig and allyesconfig preserve) or inverting the
boolean polarity to default y for nouveau avoids this.
[ ... ]
> + 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 GSP-capable GPUs
> + instead. For a single boot, nouveau.bind_gsp=1 makes nouveau
> + claim them again.
[Severity: Medium]
Does booting with only nova-core.bind_gsp=1 or only nouveau.bind_gsp=1
actually switch drivers when both nouveau and nova-core are enabled?
Neither driver checks the other's runtime bind_gsp parameter. With both
built-in and CONFIG_NOVA_CORE_BIND_GSP=n, passing only nova-core.bind_gsp=1
leaves nouveau_bind_gsp enabled, and drm/ links before nova-core.o so nouveau
still probes first and claims the GPU (when both are modules, they race).
Switching drivers for a single boot requires setting both parameters, e.g.
nova-core.bind_gsp=1 nouveau.bind_gsp=0. The dev_info!() message in
check_bind_allowed() has the same omission, and the bind_gsp parameter
description inaccurately says it makes nova-core the default NVIDIA driver.
[ ... ]
> diff --git a/drivers/gpu/nova-core/nova_core.rs b/drivers/gpu/nova-core/nova_core.rs
> index 84f7778445926..0aaf4f6c07f83 100644
> --- a/drivers/gpu/nova-core/nova_core.rs
> +++ b/drivers/gpu/nova-core/nova_core.rs
[ ... ]
> + pub(crate) fn check_bind_allowed(pdev: &pci::Device<Core<'_>>) -> Result {
> + if crate::module_parameters::bind_gsp.value() {
> + return Ok(());
> + }
> +
> + dev_info!(
> + pdev,
> + "Not binding to GPU; enable with CONFIG_NOVA_CORE_BIND_GSP=y or nova-core.bind_gsp=1\n"
> + );
> + Err(ENODEV)
> + }
[Severity: Low]
As reported by John Hubbard on v3 [3], isn't this advice misleading on
pre-Turing GPUs?
PCI_TABLE matches all NVIDIA VGA and 3D devices, and NovaCoreDriver::probe()
calls check_bind_allowed() before identifying the chipset. On pre-Turing
GPUs, enabling bind_gsp still fails later with -ENODEV; a shorter message
like "Not binding to GPU (bind_gsp=0)" avoids misleading users.
[1] https://lore.kernel.org/r/DN2OVF03FAL6.2EKLEYINW79YO@kernel.org
[2] https://lore.kernel.org/r/DN3IDZ94G4NN.1FUTSE7B4G1ZK@garyguo.net
[3] https://lore.kernel.org/r/95e63e66-1143-4c81-9206-68149ce00071@nvidia.com
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-nova-nouveau-gsp-v4-0-eb3e5e111968@redhat.com?part=2
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCH v4 1/2] drm/nouveau: leave GSP-capable GPUs to nova-core when requested
2026-12-03 4:21 ` [PATCH v4 1/2] drm/nouveau: leave GSP-capable GPUs to nova-core when requested Dave Airlie via B4 Relay
@ 2026-12-03 4:41 ` sashiko-bot
0 siblings, 0 replies; 5+ messages in thread
From: sashiko-bot @ 2026-12-03 4:41 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:
- [Medium] drm/nouveau: nouveau_register_dsm_handler() mutates rejected
GSP GPUs
--
commit 9ca41183c261ddad149f42829e0a7497b70fd715
Author: Dave Airlie <airlied@redhat.com>
drm/nouveau: leave GSP-capable GPUs to nova-core when requested
This commit adds a bind_gsp module parameter (defaulting to the inverse of
CONFIG_NOVA_CORE_BIND_GSP) so nouveau rejects Turing and later PCI GPUs in
nvkm_device_ctor() before subdev construction, and adds nvkm_device_dtor()
to unwind partially constructed devices on failure.
> diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b/drivers/gpu/drm/nouveau/nouveau_drm.c
> index 5e1336615cf6d..6f279d78066c2 100644
> --- a/drivers/gpu/drm/nouveau/nouveau_drm.c
> +++ b/drivers/gpu/drm/nouveau/nouveau_drm.c
[ ... ]
> @@ -881,7 +887,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;
>
[Severity: Medium]
Does nouveau_register_dsm_handler() still mutate PCI PM state and claim the
global vga_switcheroo handler slot for GSP-capable GPUs rejected here?
nouveau_drm_init() calls nouveau_register_dsm_handler() before
pci_register_driver(), so it runs before nouveau_drm_probe() rejects a GPU
under bind_gsp=0.
In nouveau_dsm_detect() -> nouveau_dsm_pci_probe(), any NVIDIA display
device whose upstream bridge has !bridge_d3 gets pci_d3cold_disable(pdev).
Since nouveau never calls pci_d3cold_enable() and pdev->no_d3cold cannot be
cleared from sysfs, the handed-off GPU stays capped at D3hot.
On Optimus laptops, nouveau_register_dsm_handler() also claims the exclusive
vgasr_priv.handler slot via vga_switcheroo_register_handler(). After
nouveau_drm_probe() returns -ENODEV, nouveau remains loaded with zero bound
devices while occupying that slot, making later registrations return -EINVAL.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261203-nova-nouveau-gsp-v4-0-eb3e5e111968@redhat.com?part=1
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-12-03 4:41 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-12-03 4:21 [PATCH v4 0/2] nova/nouveau: add configs/module options to control binding behaviour Dave Airlie via B4 Relay
2026-12-03 4:21 ` [PATCH v4 1/2] drm/nouveau: leave GSP-capable GPUs to nova-core when requested Dave Airlie via B4 Relay
2026-12-03 4:41 ` sashiko-bot
2026-12-03 4:21 ` [PATCH v4 2/2] nova-core: only bind to GPUs when explicitly requested Dave Airlie via B4 Relay
2026-12-03 4:37 ` sashiko-bot
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox