From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796301539; b=KYjM+mi6uMTKcrlFaoEoM8lr0Uh9dESPUn8BZ/+YUTSG+I3IsvPJi2Rj7NmuBOzAYcJn XqWmK0oXhrRI+AaBxG1Bve3BvLFyzHh3s0H4wiv74JLDcjGoTX4o2erGCJMm1qFn9D6Vy gugqeQ8ET+iOjZ5g5qChs/97bIZE/gblhHxwKLrCh8AyTFzP+Cqqm4vetaD5619RxTfce ZdzXYLGIkc20+jaxfazeQM9yKuW1mShyuvrtiiq0S5aYacwgvgwrZBWV7lcNeyxMBokZ2 nLTM4RUDpfz/4m1mBiqow0GoVFBOW14cfMqMid5mcBJ4HtP+39vE9DJySOqr77blxBg== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796301539; h=Received:DKIM-Signature:Received:Received:X-ME-Sender:X-ME-Received: X-ME-Proxy-Cause:X-ME-Proxy:Feedback-ID:Received:Message-ID:Date: MIME-Version:User-Agent:Subject:To:Cc:References:From: Content-Language:In-Reply-To:Content-Type:Content-Transfer-Encoding; bh=hvLjUIQ88BakjHy37oqah6+M5dRrIceLBExbv7pXeuM=; b=ucVBUsaA+nTsD6bmbMU7Olg7nmYLZMqGxGg7GveziUzmwAlloSk2V0OuziBUNwfneO9D qITIjp5btI9+zmgNc6v2psoxXM9XeiqcKRxObQS1CrZm3nzcXx56bGeRkLLclTcTfQ2n1 +lyH7KV47pKb8uj0lQ+voJJrSYnJHVEILxogLjjJGKo4Sf1SdEGltMCCZ2xTrM4j/aZsN EYKKyfNi5qHARWE/IoALfT5s4FyaqoOiMMWL8hdnz3JyW4/vsFZDPVaOmUxIl6vChfi0e Gb0okrINvHV7wMWG7ov8VV6Mm/UC4FM/8fmOsuBuSDlg64rT0PSZqa61a9ckP7ujorg== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=G1+9j2RY; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 9EE6F606A339 for ; Thu, 3 Dec 2026 12:38:59 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=G1+9j2RY Received: by smtp.kernel.org (Postfix) with ESMTPSA id 90C1D1F00896; Thu, 3 Dec 2026 12:38:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796301539; bh=hvLjUIQ88BakjHy37oqah6+M5dRrIceLBExbv7pXeuM=; h=Date:Subject:To:Cc:References:From:In-Reply-To; b=G1+9j2RYepBzFDPQUO1DmzAYjpJtbiwGjg0UmKFKCqNuaJO0lX2CwiEL5V759zuau Dl3mJZOn3UPOYKTMvfhWKCrHMEmvwIhzy0/+FqQCTQrrD12ZoyJWF340Y0L5mUFxnZ dpbzcBaQpZ3it5DvNAryPUCZjw1tRa9Ua4orNCiKdh3ftPeqoyVBIqUSp0fg8ZMS3d LRBjGPsE6otZj47PXO9TLA3kHgq/c928g+AYR6aUUVfiCn6vcrIqOA65GYVI/VCnF3 GQJ5WIJZM5V6ht1LOU+jmE/Mn3sQ+LwPfIH3/1aeXqsdZ/m5bAY7PAzwWKywDTO5qa JU9FP+RiAxOuQ== Received: from ams-compute-02.internal (ams-compute-02.internal [10.64.2.62]) by mailfauth.ams.internal (Postfix) with ESMTP id 124041980052; Thu, 3 Dec 2026 07:38:57 -0500 (EST) Received: from ams-frontend-01 ([10.64.2.36]) by ams-compute-02.internal (MEProxy); Thu, 03 Dec 2026 07:38:57 -0500 X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: dmFkZTEzUP7oUndvTVMuvLhEgdiLNlNQW/qlIlruNAdXbOBZp356j+WG09uPcVzVAaOgUR 6CfP6TqqJO1hw7KTbNG96+u+i5WbuT8fQRcPPehXuftxUKj88G1XB+QgM6eYf05hSNkPSB bHb/9sC3kfvyFd9yD7LuxLjD2QTzoldv9eKgbMrlZGyxK/AlR5emntRwrxJkLB3OifhfE3 wVl2NunSqqQzLmY16kycqLHaw3UDFFfG1xd4EvFzUU+CutO/4Z5RHarVGfGLZvVpWr1fnJ IY0R6UZhDvon1o4JbHZPn0O/spnNhCEXxnWXqLnbMVoKUKV9WXyiNqJ9AHbuSUhKjkxoV1 NM67Pzh7+NIepve3KeJpDpmSTjRBmaWs3rvdYwi3WLC1HG4yLe+cb0q7cOhmE5ZE1sDZ1b ZfkPCFScp95hvI0FiZUmKUKiDUHgu1kWs+bDwVU2mgxi9UeE62HOY4Agb4knCPYE4bdOxc zQrsYWqJ9QyDB0O9exJzZsEtlb5YNNRNFRDzjucj+g44odxGXei45MnwMlSS2AH8f+21BA +yy6Bgxjpf51CKfDpUfXjBPb7THL57G95Y/JD2MHOBmpmhgWI/Q7zgTBGGRJbe6/qhzjBQ i3hgEJ3O13/LHoynFMUkJxK3WHy0G0bNoEEltQbbB9p5NW4pkU64QrOCsrYQ X-ME-Proxy: Feedback-ID: i78584a88:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Thu, 3 Dec 2026 07:38:54 -0500 (EST) Message-ID: <0bccb0cd-891a-4667-a509-5536cf789242@kernel.org> Date: Thu, 3 Dec 2026 13:38:53 +0100 X-Mailing-List: nova-gpu@lists.linux.dev List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH v3 2/2] nova-core: only bind to GPUs when explicitly requested To: Gary Guo Cc: Dave Airlie , airlied@redhat.com, Lyude Paul , Alexandre Courbot , dri-devel@lists.freedesktop.org, nouveau@lists.freedesktop.org, nova-gpu@lists.linux.dev References: <20261124-nova-nouveau-gsp-v3-0-e1440479ded6@redhat.com> <20261124-nova-nouveau-gsp-v3-2-e1440479ded6@redhat.com> From: Danilo Krummrich Content-Language: en-US In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit On 12/3/26 1:31 PM, Gary Guo wrote: > On Thu Dec 3, 2026 at 3:51 AM GMT, Dave Airlie wrote: >> On Wed, 25 Nov 2026 at 00:26, Gary Guo wrote: >>> >>> On Tue Nov 24, 2026 at 5:50 AM GMT, Dave Airlie via B4 Relay wrote: >>>> From: Dave Airlie >>>> >>>> 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. >>>> >>>> Signed-off-by: Dave Airlie >>>> --- >>>> drivers/gpu/nova-core/Kconfig | 21 +++++++++++++++++++++ >>>> drivers/gpu/nova-core/driver.rs | 4 ++++ >>>> drivers/gpu/nova-core/nova_core.rs | 23 +++++++++++++++++++++++ >>>> 3 files changed, 48 insertions(+) >>>> >>>> diff --git a/drivers/gpu/nova-core/nova_core.rs b/drivers/gpu/nova-core/nova_core.rs >>>> index 84f777844592..483e5c1d427b 100644 >>>> --- a/drivers/gpu/nova-core/nova_core.rs >>>> +++ b/drivers/gpu/nova-core/nova_core.rs >>>> @@ -68,6 +68,25 @@ pub(crate) fn debugfs_data<'a>(_dev: &'a device::Device) -> &'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>) -> Result { >>>> + if crate::module_parameters::bind_gsp.value() { >>>> + return Ok(()); >>>> + } >>> >>> This will reject binding via sysfs, which I think should still be allowed >>> despite CONFIG_NOVA_CORE_BIND_GSP. I wonder if we can support such cases just by >>> setting ID table to override_only if the config option is set? >>> >>> If module parameter is set, then we can pci_add_dynid to add a match without >>> override_only being set. >>> >> >> While I think it "should" be allowed, it's not a simple case to just make work, >> >> the current override stuff is vfio only so we'd need to extend the PCI >> override, which I think if this is something we want people can do it >> later, it's over complicating this series, whose main goal is stop >> distros doing stupid things, not enable users to do more stupid >> things. >> > > Fair. I mostly think this as a useful thing for testing. Danilo suggested to me > in testing environment it could simply be achieved by rmmod + modprobe again but > with bind_gsp set, so no objection from me. Of course that still has limitations if you have multiple cards, but it should be good enough for our needs. Having "competing" in-tree drivers is rare enough to not consider it in (driver) core infrastructure.