Re: [PATCH v2 1/2] gpu: nova-core: add initial driver stub

2025-02-06 Thread Danilo Krummrich
Hi Alexandre, On Thu, Feb 06, 2025 at 11:05:37PM +0900, Alexandre Courbot wrote: > > + > > +/// Enum representation of the GPU chipset. > > +#[derive(fmt::Debug)] > > I suspect you will eventually want to also derive Copy and Clone, as > well as PartialEq and Eq (so the assigned values can be use

Re: [PATCH v2 2/2] gpu: nova-core: add initial documentation

2025-02-05 Thread Danilo Krummrich
On Wed, Feb 05, 2025 at 04:56:32PM +0200, Zhi Wang wrote: > On Wed, 5 Feb 2025 15:13:12 +0100 > Miguel Ojeda wrote: > > > On Wed, Feb 5, 2025 at 2:57 PM Zhi Wang wrote: > > > > > > It would be also helpful to make the process explicit. E.g. sharing your > > > command lines used to checking the p

Re: [PATCH v2 2/2] gpu: nova-core: add initial documentation

2025-02-05 Thread Danilo Krummrich
On Wed, Feb 05, 2025 at 03:56:46PM +0200, Zhi Wang wrote: > On Tue, 4 Feb 2025 20:03:12 +0100 > Danilo Krummrich wrote: > > > + > > +Generic register abstraction > > + > > + > > +Work out how register constants and structu

[PATCH v2 2/2] gpu: nova-core: add initial documentation

2025-02-04 Thread Danilo Krummrich
Rust infrastructure required by the project, tasks regarding GSP enablement and firmware abstraction, general GPU driver tasks as well as tasks related to external API design and test infrastructure. Signed-off-by: Danilo Krummrich --- - Add task "Generic register abstraction".

[PATCH v2 1/2] gpu: nova-core: add initial driver stub

2025-02-04 Thread Danilo Krummrich
https://lore.kernel.org/dri-devel/Zfsj0_tb-0-tNrJy@cassiopeiae/T/#u [1] Link: https://lwn.net/Articles/990736/ [2] Link: https://youtu.be/3Igmx28B3BQ?si=sBdSEer4tAPKGpOs [3] Signed-off-by: Danilo Krummrich --- Changes in v2: - Fix module name in Kconfig description. (John) - Expand Kconfig description a bit.

Re: [PATCH 1/2] gpu: nova-core: add initial driver stub

2025-02-04 Thread Danilo Krummrich
On Tue, Feb 04, 2025 at 06:42:46PM +, Timur Tabi wrote: > On Fri, 2025-01-31 at 23:04 +0100, Danilo Krummrich wrote: > > +/// Structure encapsulating the firmware blobs required for the GPU to > > operate. > > +#[allow(dead_code)] > > +pub(crate) struct Firm

Re: [PATCH 2/2] gpu: nova-core: add initial documentation

2025-02-04 Thread Danilo Krummrich
On Tue, Feb 04, 2025 at 06:40:41PM +, Timur Tabi wrote: > On Fri, 2025-01-31 at 23:04 +0100, Danilo Krummrich wrote: > > +Rust abstraction for debugfs APIs. > > + > > +| Reference: Export GSP log buffers > > +| Complexity: Beginner > > Seriously? Well, that seems indeed a bit optimistic. :-)

Re: [PATCH 1/2] gpu: nova-core: add initial driver stub

2025-02-04 Thread Danilo Krummrich
On Mon, Feb 03, 2025 at 03:24:10PM -0500, Joel Fernandes wrote: > Hi Danilo, > > On Fri, Jan 31, 2025 at 11:04:24PM +0100, Danilo Krummrich wrote: > > +#[pin_data] > > +pub(crate) struct NovaCore { > > +#[pin] > > +pub(crate) gpu: Gpu, > > +} > &

Re: [PATCH 0/4] drm/gpuvm: Add support for single-page-filled mappings

2025-02-02 Thread Danilo Krummrich
Hi Lina, On Sun, Feb 02, 2025 at 10:34:49PM +0900, Asahi Lina wrote: > Some hardware requires dummy page mappings to efficiently implement > Vulkan sparse features. These mappings consist of the same physical > memory page, repeated for a large range of address space (e.g. 16GiB). > > Add support

Re: [PATCH 1/2] gpu: nova-core: add initial driver stub

2025-02-01 Thread Danilo Krummrich
On Fri, Jan 31, 2025 at 08:01:00PM -0800, John Hubbard wrote: > On 1/31/25 2:04 PM, Danilo Krummrich wrote: > > Add the initial nova-core driver stub. > > > > nova-core is intended to serve as a common base for nova-drm (the > > corresponding DRM driver) and the vGPU m

Re: [PATCH 1/2] gpu: nova-core: add initial driver stub

2025-02-01 Thread Danilo Krummrich
On Sat, Feb 01, 2025 at 09:33:28AM +0100, Greg KH wrote: > On Fri, Jan 31, 2025 at 11:04:24PM +0100, Danilo Krummrich wrote: > > +impl Gpu { > > +pub(crate) fn new(pdev: &pci::Device, bar: Devres) -> > > Result> { > > +let spec = GpuSpec::new(&

Re: [PATCH 1/2] gpu: nova-core: add initial driver stub

2025-02-01 Thread Danilo Krummrich
On Sat, Feb 01, 2025 at 09:14:48AM +0100, Karol Herbst wrote: > On Fri, Jan 31, 2025 at 11:04 PM Danilo Krummrich wrote: > > +impl pci::Driver for NovaCore { > > +type IdInfo = (); > > +const ID_TABLE: pci::IdTable = &PCI_TABLE; > > + > > +fn probe

[PATCH 1/2] gpu: nova-core: add initial driver stub

2025-01-31 Thread Danilo Krummrich
https://lore.kernel.org/dri-devel/Zfsj0_tb-0-tNrJy@cassiopeiae/T/#u [1] Link: https://lwn.net/Articles/990736/ [2] Link: https://youtu.be/3Igmx28B3BQ?si=sBdSEer4tAPKGpOs [3] Signed-off-by: Danilo Krummrich --- MAINTAINERS| 10 ++ drivers/gpu/Makefile | 1 + drivers/gpu

[PATCH 2/2] gpu: nova-core: add initial documentation

2025-01-31 Thread Danilo Krummrich
Rust infrastructure required by the project, tasks regarding GSP enablement and firmware abstraction, general GPU driver tasks as well as tasks related to external API design and test infrastructure. Signed-off-by: Danilo Krummrich --- Documentation/gpu/drivers.rst | 1

Re: [PATCH v2] drm/sched: Use struct for drm_sched_init() params

2025-01-29 Thread Danilo Krummrich
On Wed, Jan 29, 2025 at 04:18:30PM +0100, Philipp Stanner wrote: > On Tue, 2025-01-28 at 15:56 +0100, Danilo Krummrich wrote: > > On Tue, Jan 28, 2025 at 03:29:27PM +0100, Philipp Stanner wrote: > > > diff --git a/drivers/gpu/drm/nouveau/nouveau_sched.c > > >

Re: [PATCH v2] drm/sched: Use struct for drm_sched_init() params

2025-01-28 Thread Danilo Krummrich
On Tue, Jan 28, 2025 at 03:29:27PM +0100, Philipp Stanner wrote: > drm_sched_init() has a great many parameters and upcoming new > functionality for the scheduler might add even more. Generally, the > great number of parameters reduces readability and has already caused > one missnaming in: > > co

Re: [PATCH v4 00/15] NVKM GSP RPC kernel docs, cleanups and fixes

2025-01-24 Thread Danilo Krummrich
Hi Zhi, On Fri, Jan 24, 2025 at 10:29:43AM -0800, Zhi Wang wrote: > Hi folks: > > Here is another re-spin of handling the large GSP message return. > > Besides the support of the large GSP message, kernel doc and many cleanups > are introduced according to the comments in the previous spin [1].

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Danilo Krummrich
On Thu, Jan 23, 2025 at 10:35:43AM +0100, Philipp Stanner wrote: > On Thu, 2025-01-23 at 10:29 +0100, Danilo Krummrich wrote: > > On Thu, Jan 23, 2025 at 08:33:01AM +0100, Philipp Stanner wrote: > > > On Wed, 2025-01-22 at 18:16 +0100, Boris Brezillon wrote: > > > >

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-23 Thread Danilo Krummrich
On Thu, Jan 23, 2025 at 08:33:01AM +0100, Philipp Stanner wrote: > On Wed, 2025-01-22 at 18:16 +0100, Boris Brezillon wrote: > > On Wed, 22 Jan 2025 15:08:20 +0100 > > Philipp Stanner wrote: > > > > >  int drm_sched_init(struct drm_gpu_scheduler *sched, > > > -    const struct drm_sched_backend_o

Re: [PATCH] drm/sched: Use struct for drm_sched_init() params

2025-01-22 Thread Danilo Krummrich
On Wed, Jan 22, 2025 at 03:08:20PM +0100, Philipp Stanner wrote: > drm_sched_init() has a great many parameters and upcoming new > functionality for the scheduler might add even more. Generally, the > great number of parameters reduces readability and has already caused > one missnaming in: > > co

Re: [RFC 8/8] drm/nouveau: introduce the scrubber on Ada in a kernel doc

2025-01-17 Thread Danilo Krummrich
On Fri, Nov 22, 2024 at 04:57:12AM -0800, Zhi Wang wrote: > Introduce a kernel doc to explain the scrubber on Ada. > > Cc: Milos Tijanic > Signed-off-by: Zhi Wang > --- > drivers/gpu/drm/nouveau/nvkm/subdev/gsp/ad102.c | 14 ++ > 1 file changed, 14 insertions(+) > > diff --git a/dr

Re: [RFC 7/8] drm/nouveau: set max supported vGPU count when SRIOV is supported

2025-01-17 Thread Danilo Krummrich
On Fri, Nov 22, 2024 at 04:57:11AM -0800, Zhi Wang wrote: > Set the max supported vGPU count according to the number of VFs when > SRIOV is supported on Ada. > > Suggested-by: Jason Gunthorpe > Cc: Surath Mitra > Signed-off-by: Zhi Wang > --- > drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h

Re: [RFC 6/8] drm/nouveau: override the WPR2 heap size when SRIOV is supported on Ada

2025-01-17 Thread Danilo Krummrich
On Fri, Nov 22, 2024 at 04:57:10AM -0800, Zhi Wang wrote: > To support the maximum vGPUs on the device that support SRIOV, a larger > WPR2 heap size is required. On Ada with SRIOV supported, the size should > be set to at least 549MB. By setting the WPR2 heap size up to 549MB, the > scrubber ucode

Re: [RFC 5/8] drm/nouveau: support WPR2 heap size override

2025-01-17 Thread Danilo Krummrich
On Fri, Nov 22, 2024 at 04:57:09AM -0800, Zhi Wang wrote: > To support the maximum vGPUs on the device that support SRIOV, a larger > WPR2 heap size is required. > > Support WPR2 heap size override when initializing the WPR2 heap memory > layout. If zero, use the default WRP2 heap size. > > No fu

Re: [RFC 1/8] drm/nouveau: factor out nvkm_gsp_init_fw_heap()

2025-01-17 Thread Danilo Krummrich
On Fri, Nov 22, 2024 at 04:57:05AM -0800, Zhi Wang wrote: > To support the per-SKU GSP WPR2 heap initialization, first, factor out the > common routine for all the SKUs. > > Factor out nvkm_gsp_init_fw_heap(). Adjust some indent to make > checkpatch.pl happy. > > No functional change is intended.

Re: [RFC 3/8] drm/nouveau: load scrubber ucode image when WPR2 heap size > 256MB

2025-01-17 Thread Danilo Krummrich
On Fri, Nov 22, 2024 at 04:57:07AM -0800, Zhi Wang wrote: > When WPR2 heap size > 256MB, the FB memory needs to be scrubbed before > use. > > If not, the GSP firmware hangs when booting. > > Introduce ad102_gsp_init_fw_heap(). Load scrubber ucode image when > WRP2 heap size > 256MB after the FB m

Re: [RFC 4/8] drm/nouveau: scrub the FB memory when scrubber firmware is loaded

2025-01-17 Thread Danilo Krummrich
On Fri, Nov 22, 2024 at 04:57:08AM -0800, Zhi Wang wrote: > When WPR2 heap size > 256MB, the FB memory needs to be scrubbed > before use. > > If not, the GSP firmware hangs when booting. > > If the scrubber firmware presents, execute it to scrub the FB memory > before executing any other ucode im

Re: [RFC 4/8] drm/nouveau: scrub the FB memory when scrubber firmware is loaded

2025-01-17 Thread Danilo Krummrich
On 1/9/25 11:58 PM, Timur Tabi wrote: On Fri, 2024-11-22 at 04:57 -0800, Zhi Wang wrote: +static int +ad102_execute_scrubber(struct nvkm_gsp *gsp) +{ + struct nvkm_falcon_fw fw = {0}; + struct nvkm_subdev *subdev = &gsp->subdev; + struct nvkm_device *device = subdev->device; +

Re: [PATCH] nouveau/fence: handle cross device fences properly. (v3)

2025-01-13 Thread Danilo Krummrich
On 09.01.2025 17:58, Danilo Krummrich wrote: > On Thu, Jan 09, 2025 at 10:55:53AM +1000, Dave Airlie wrote: >> From: Dave Airlie >> >> This is the 3rd iteration of this after talking to Ben and >> Danilo, I think this makes sense now. >> >> The fence

Re: [PATCH] [drm-misc-next] drm/nouveau: fix kernel-doc comments

2025-01-09 Thread Danilo Krummrich
On 1/9/25 12:43 AM, Timur Tabi wrote: Fix some malformed kernel-doc comments that were added in a recent commit. Also, kernel-doc does not support global variables, so change those kernel-doc comments into regular comments. Fixes: 214c9539cf2f ("drm/nouveau: expose GSP-RM logging buffers via de

Re: [PATCH] nouveau/fence: handle cross device fences properly. (v3)

2025-01-09 Thread Danilo Krummrich
On Thu, Jan 09, 2025 at 10:55:53AM +1000, Dave Airlie wrote: > From: Dave Airlie > > This is the 3rd iteration of this after talking to Ben and > Danilo, I think this makes sense now. > > The fence sync logic doesn't handle a fence sync across devices > as it tries to write to a channel offset f

Re: [PATCH] nouveau/fence: handle cross device fences properly.

2025-01-07 Thread Danilo Krummrich
On Wed, Jan 08, 2025 at 11:04:21AM +1000, Dave Airlie wrote: > On Wed, 8 Jan 2025 at 02:02, Danilo Krummrich wrote: > > > > On Tue, Jan 07, 2025 at 03:58:46PM +1000, Dave Airlie wrote: > > > From: Dave Airlie > > > > > > If we have two nouveau con

Re: [PATCH] nouveau/fence: handle cross device fences properly.

2025-01-07 Thread Danilo Krummrich
On Tue, Jan 07, 2025 at 03:58:46PM +1000, Dave Airlie wrote: > From: Dave Airlie > > If we have two nouveau controlled devices and one passes a dma-fence > to the other, when we hit the sync path it can cause the second device > to try and put a sync wait in it's pushbuf for the seqno of the cont

Re: [PATCH RESEND] drm/nouveau/disp: Fix missing backlight control on Macbook 5,1

2025-01-07 Thread Danilo Krummrich
On Thu, Jan 02, 2025 at 12:49:36PM +0100, Takashi Iwai wrote: > Macbook 5,1 with MCP79 lost its backlight control since the recent > change for supporting GFP-RM; it rewrote the whole nv50 backlight > control code and each display engine is supposed to have an entry for > IOR bl callback, but it di

Re: [PATCH v3 0/2] drm/nouveau: remove drm_encoder_slave interface

2025-01-07 Thread Danilo Krummrich
On Mon, Jan 06, 2025 at 01:00:12AM +0200, Dmitry Baryshkov wrote: > The nouveau driver is the only user of the drm_encoder_slave interface. > Demote it from KMS helpers module to the nouveau driver itself, moving > corresponding I2C encoders to be handled by nouveau driver too. > > Ideally those t

Re: [PATCH v1 v1] drm/nouveau: Fix memory leak in nvbios_iccsense_parse

2024-12-16 Thread Danilo Krummrich
un Li Why is there also Duanjun's SOB? If there is a co-author, this should be indicated with a "Co-developed-by" tag. Adding the SOB only is not sufficient, please see [1]. > Signed-off-by: Danilo Krummrich Please don't add my SOB to your commits -- I'll ad

Re: [PATCH v2 2/2] drm/nouveau: vendor in drm_encoder_slave API

2024-12-16 Thread Danilo Krummrich
On Sun, Dec 15, 2024 at 12:19:24PM +0200, Dmitry Baryshkov wrote: > Nouveau driver is the only user of the drm_encoder_slave API. Rework > necessary bits of drm_encoder_slave into the nouveau_i2c_encoder API and > drop drm_encoder_slave.c from the DRM KMS helper. Please fix the CHECK warnings prod

Re: [PATCH v2 1/2] drm/nouveau: incorporate I2C TV encoder drivers

2024-12-16 Thread Danilo Krummrich
On Sun, Dec 15, 2024 at 12:19:23PM +0200, Dmitry Baryshkov wrote: > Chrontel CH7006 and Silicon Image sil164 drivers use drm_encoder_slave > interface which is being used only by the nouveau driver. It doesn't > make sense to keep this interface inside the DRM subsystem. In > preparation to moving

Re: [PATCH v2 0/2] drm/nouveau: remove drm_encoder_slave interface

2024-12-16 Thread Danilo Krummrich
On Mon, Dec 16, 2024 at 02:58:59PM +0200, Dmitry Baryshkov wrote: > On Mon, Dec 16, 2024 at 01:41:56PM +0100, Danilo Krummrich wrote: > > On Mon, Dec 16, 2024 at 02:16:51PM +0200, Laurent Pinchart wrote: > > > On Mon, Dec 16, 2024 at 02:11:41PM +0200, Dmitry Baryshkov wrote: >

Re: [PATCH v2 0/2] drm/nouveau: remove drm_encoder_slave interface

2024-12-16 Thread Danilo Krummrich
On Mon, Dec 16, 2024 at 02:16:51PM +0200, Laurent Pinchart wrote: > On Mon, Dec 16, 2024 at 02:11:41PM +0200, Dmitry Baryshkov wrote: > > On Mon, Dec 16, 2024 at 12:45:15PM +0100, Danilo Krummrich wrote: > > > On Sun, Dec 15, 2024 at 12:19:22PM +0200, Dmitry Baryshkov wrote: &

Re: [PATCH v2 0/2] drm/nouveau: remove drm_encoder_slave interface

2024-12-16 Thread Danilo Krummrich
On Sun, Dec 15, 2024 at 12:19:22PM +0200, Dmitry Baryshkov wrote: > The nouveau driver is the only user of the drm_encoder_slave interface. > Demote it from KMS helpers module to the nouveau driver itself, moving > corresponding I2C encoders to be handled by nouveau driver too. I understand nouvea

Re: [PATCH] drm/nouveau: Fix memory leak in nvbios_iccsense_parse

2024-12-16 Thread Danilo Krummrich
Thanks for the patch, some notes below. On Mon, Dec 16, 2024 at 09:52:46AM +0800, Zhanxin Qi wrote: > The nvbios_iccsense_parse function allocates memory for sensor data > but fails to free it when the function exits, leading to a memory > leak. Add proper cleanup to free the allocated memory. >

Re: [PATCH v3 12/15] nvkm: factor out r535_gsp_msgq_peek()

2024-12-11 Thread Danilo Krummrich
On Thu, Oct 31, 2024 at 01:52:47AM -0700, Zhi Wang wrote: > To receive a GSP message queue element from the GSP status queue, the > driver needs to make sure there are available elements in the queue. > > The previous r535_gsp_msgq_wait() consists of three functions, which is > a little too compli

Re: [PATCH v3 02/15] nvkm: rename "repc" to "gsp_rpc_len" on the GSP message recv path

2024-12-11 Thread Danilo Krummrich
On Thu, Oct 31, 2024 at 01:52:37AM -0700, Zhi Wang wrote: > The name "repc" has different meanings in different contexts. > > To improve the readability, it's better to refine it to a name that > reflects what it actually represents. > > Rename "repc" to "gsp_rpc_len" in the GSP message recv path

Re: [PATCH v3 01/15] nvkm: add a kernel doc to introduce the GSP RPC

2024-12-11 Thread Danilo Krummrich
Hi Zhi, On Thu, Oct 31, 2024 at 01:52:36AM -0700, Zhi Wang wrote: > In order to explain the name clean-ups in GSP RPC routines, a kernel > doc to explain the memory layout and terms is required. > > Add a kernel doc to introduce the GSP RPC. Thanks for adding this -- very much appreciated! > >

Re: [PATCH 1/2] [v2] drm/nouveau: retain device pointer in nvkm_gsp_mem object

2024-12-04 Thread Danilo Krummrich
On 10/30/24 9:29 PM, Timur Tabi wrote: Store the struct device pointer used to allocate the DMA buffer in the nvkm_gsp_mem object. This allows nvkm_gsp_mem_dtor() to release the buffer without needing the nvkm_gsp. This is needed so that we can retain DMA buffers even after the nvkm_gsp object

Re: [PATCH] drm/nouveau: create module debugfs root

2024-11-28 Thread Danilo Krummrich
On 11/25/24 6:00 PM, Danilo Krummrich wrote: On 11/25/24 5:55 PM, Timur Tabi wrote: On Mon, 2024-11-25 at 15:25 +0100, Danilo Krummrich wrote: Typically DRM drivers use the DRM debugfs root entry. However, since Nouveau is heading towards a split into a core and a DRM driver, create a module

Re: [PATCH] nouveau: fw: sync dma after setup is called.

2024-11-25 Thread Danilo Krummrich
On 11/14/24 1:46 AM, Dave Airlie wrote: From: Dave Airlie When this code moved to non-coherent allocator the sync was put too early for some firmwares which called the setup function, move the sync down after the setup function. Reported-by: Diogo Ivo Do you have a link of where this issue

Re: [PATCH] drm/nouveau: create module debugfs root

2024-11-25 Thread Danilo Krummrich
On 11/25/24 5:55 PM, Timur Tabi wrote: On Mon, 2024-11-25 at 15:25 +0100, Danilo Krummrich wrote: Typically DRM drivers use the DRM debugfs root entry. However, since Nouveau is heading towards a split into a core and a DRM driver, create a module specific debugfs root directory. Subsequent

Re: [PATCH 0/3] NVKM GSP RPC fixes

2024-11-25 Thread Danilo Krummrich
On 10/17/24 9:19 AM, Zhi Wang wrote: Hi folks: Here are some fixes of weird bugs I encountered when I was enabling vGPU [1] on core-driver aka NVKM. They are exposed because of the new RPCs required by vGPU. For testing, I tried to run Uniengine Heaven[2] on my RTX 4060 for 8 hours and the GL C

[PATCH] drm/nouveau: create module debugfs root

2024-11-25 Thread Danilo Krummrich
device driver binding). Signed-off-by: Danilo Krummrich --- Unless there are any concerns, I'll pick this patch and rebase Timur's patches on top of it. --- drivers/gpu/drm/nouveau/nouveau_debugfs.c | 16 drivers/gpu/drm/nouveau/nouveau_debugfs.h | 16 d

Re: [PATCH v3 00/15] NVKM GSP RPC kernel docs, cleanups and fixes

2024-11-01 Thread Danilo Krummrich
Hi Zhi, On 10/31/24 9:52 AM, Zhi Wang wrote: Hi folks: Here is the leftover of the previous spin of NVKM GSP RPC fixes, which is handling the return of large GSP message. PATCH 1 and 2 in the previous spin were merged [1], and this spin is based on top of PATCH 1 and PATCH 2 in the previous spi

Re: [PATCH 2/2] [v8] drm/nouveau: expose GSP-RM logging buffers via debugfs

2024-10-29 Thread Danilo Krummrich
On Tue, Oct 29, 2024 at 07:50:06PM +, Timur Tabi wrote: > On Thu, 2024-10-03 at 23:48 +0200, Danilo Krummrich wrote: > > > +#ifdef CONFIG_DEBUG_FS > > > + /* > > > + * Logging buffers in debugfs. The wrapper objects need to remain > > > +

Re: [PATCH 3/3] nvkm: handle the return of large RPC

2024-10-17 Thread Danilo Krummrich
On Thu, Oct 17, 2024 at 07:50:24PM +, Zhi Wang wrote: > On 17/10/2024 14.29, Danilo Krummrich wrote: > > External email: Use caution opening links or attachments > > > > > > Hi Danilo: > > Thanks for the reply. See my comments below. If there is no more

Re: [PATCH 0/3] NVKM GSP RPC fixes

2024-10-17 Thread Danilo Krummrich
On Thu, Oct 17, 2024 at 12:19:19AM -0700, Zhi Wang wrote: > Hi folks: > > Here are some fixes of weird bugs I encountered when I was enabling vGPU [1] > on > core-driver aka NVKM. They are exposed because of the new RPCs required by > vGPU. > > For testing, I tried to run Uniengine Heaven[2] on

Re: [PATCH 3/3] nvkm: handle the return of large RPC

2024-10-17 Thread Danilo Krummrich
On Thu, Oct 17, 2024 at 12:19:22AM -0700, Zhi Wang wrote: > The max RPC size is 16 pages (including the RPC header). To send an RPC > larger than 16 pages, nvkm should split it into multiple RPCs and send > it accordingly. The first of the split RPCs has the expected function > number, while the re

Re: [PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning

2024-10-14 Thread Danilo Krummrich
On Sat, Oct 05, 2024 at 09:04:11AM -0700, Kees Cook wrote: > > > > >On 03/10/24 12:36, Danilo Krummrich wrote: > >> On 9/13/24 12:23 PM, Danilo Krummrich wrote: > > I am reminded that I should check all my MUAs to render the date as > -MM-DD so my brain

Re: [PATCH 3/3] nvkm/gsp: handle the return of large RPC

2024-10-14 Thread Danilo Krummrich
On Sun, Sep 22, 2024 at 06:07:09AM -0700, Zhi Wang wrote: > The max RPC size is 16 pages (including the RPC header). To send an RPC > larger than 16 pages, nvkm should split it into multiple RPCs and send > it accordingly. The first of the split RPCs has the expected function > number, while the re

Re: [PATCH 2/3] nvkm/gsp: correctly calculate the available space of the GSP cmdq buffer

2024-10-14 Thread Danilo Krummrich
On Sun, Oct 13, 2024 at 06:27:32PM +, Zhi Wang wrote: > On 04/10/2024 20.16, Danilo Krummrich wrote: > > External email: Use caution opening links or attachments > > > > > > Hey Danilo. I am just back from my vacation. Sorry for the delay. See my > comments be

Re: [PATCH v4 0/2] drm/nouveau/dmem: Fix Vulnerability and Device Channels configuration

2024-10-08 Thread Danilo Krummrich
On Tue, Oct 08, 2024 at 02:59:41PM +0300, Yonatan Maman wrote: > From: Yonatan Maman > > This patch series addresses two critical issues in the Nouveau driver > related to device channels, error handling, and sensitive data leaks. > > - Vulnerability in migrate_to_ram: The migrate_to_ram functio

Re: [PATCH v3 1/2] nouveau/dmem: Fix privileged error in copy engine channel

2024-10-08 Thread Danilo Krummrich
On Tue, Oct 08, 2024 at 10:31:02AM +0300, Yonatan Maman wrote: > From: Yonatan Maman > > When `nouveau_dmem_copy_one` is called, the following error occurs: > > [272146.675156] nouveau :06:00.0: fifo: PBDMA9: 0004 [HCE_PRIV] > ch 1 0300 3386 > > This indicates that a copy push c

Re: [PATCH v2 1/2] nouveau/dmem: Fix privileged error in copy engine channel

2024-10-07 Thread Danilo Krummrich
On Mon, Oct 07, 2024 at 04:26:59PM +0300, Yonatan Maman wrote: > From: Yonatan Maman > > When `nouveau_dmem_copy_one` is called, the following error occurs: > > [272146.675156] nouveau :06:00.0: fifo: PBDMA9: 0004 [HCE_PRIV] > ch 1 0300 3386 > > This indicates that a copy push c

Re: [PATCH 2/2] nouveau/dmem: Fix memory leak in `migrate_to_ram` upon copy error

2024-10-07 Thread Danilo Krummrich
On Mon, Oct 07, 2024 at 03:28:22PM +0300, Yonatan Maman wrote: > > > On 30/09/2024 14:20, Danilo Krummrich wrote: > > External email: Use caution opening links or attachments > > > > > > On Mon, Sep 23, 2024 at 01:54:58PM +, Yonatan Maman wrote: >

Re: [PATCH 2/3] nvkm/gsp: correctly calculate the available space of the GSP cmdq buffer

2024-10-04 Thread Danilo Krummrich
ing back based on > the result from the waiting. It looks like you hit this one while working on the VFIO stuff too. So, same question here, can we hit this case with "vanilla nouveau"? > > Fixes: 176fdcbddfd28 ("drm/nouveau/gsp/r535: add support for booting GSP-RM"

Re: [PATCH 1/3] nvkm/gsp: correctly advance the read pointer of GSP message queue

2024-10-04 Thread Danilo Krummrich
the end, the read pointer is wrongly advanced by 3 when handling a > two-page GSP message in the rollback case. > > Fix the problems by taking the total size of the message into account > when advancing the read pointer and calculate the read pointer in the end > of the all copies for

Re: [PATCH][next] drm/nouveau/gsp: remove extraneous ; after mutex

2024-10-03 Thread Danilo Krummrich
On 9/17/24 2:08 PM, Colin Ian King wrote: The mutex field has two following semicolons, replace this with just one semicolon. Signed-off-by: Colin Ian King Applied to drm-misc-fixes, thanks! --- drivers/gpu/drm/nouveau/include/nvkm/subdev/gsp.h | 2 +- 1 file changed, 1 insertion(+), 1 d

Re: [PATCH 2/2] [v8] drm/nouveau: expose GSP-RM logging buffers via debugfs

2024-10-03 Thread Danilo Krummrich
On Tue, Sep 10, 2024 at 04:56:16PM -0500, Timur Tabi wrote: > The LOGINIT, LOGINTR, LOGRM, and LOGPMU buffers are circular buffers > that have printf-like logs from GSP-RM and PMU encoded in them. > > LOGINIT, LOGINTR, and LOGRM are allocated by Nouveau and their DMA > addresses are passed to GSP-

Re: [PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning

2024-10-03 Thread Danilo Krummrich
On 10/3/24 8:44 PM, Gustavo A. R. Silva wrote: On 03/10/24 12:36, Danilo Krummrich wrote: On 9/13/24 12:23 PM, Danilo Krummrich wrote: Hi, On 9/13/24 10:09 AM, Gustavo A. R. Silva wrote: Hi all, Friendly ping: who can take this, please? 🙂 Usually, that's me. But I thought you

Re: [PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning

2024-10-03 Thread Danilo Krummrich
On 9/13/24 12:23 PM, Danilo Krummrich wrote: Hi, On 9/13/24 10:09 AM, Gustavo A. R. Silva wrote: Hi all, Friendly ping: who can take this, please? 🙂 Usually, that's me. But I thought you might want to send a v2 based on Kees' comments? Do you plan to follow up on this? I'

Re: [PATCH] drm/nouveau/i2c: rename aux.c and aux.h to auxch.c and auxch.h

2024-10-03 Thread Danilo Krummrich
On 6/3/24 11:15 AM, egyszer...@freemail.hu wrote: From: Benjamin Szőke The goal is to clean-up Linux repository from AUX file names, because the use of such file names is prohibited on other operating systems such as Windows, so the Linux repository cannot be cloned and edited on them. Signed-

Re: [RFC 00/29] Introduce NVIDIA GPU Virtualization (vGPU) Support

2024-09-30 Thread Danilo Krummrich
On Fri, Sep 27, 2024 at 12:27:24PM -0300, Jason Gunthorpe wrote: > On Fri, Sep 27, 2024 at 04:22:32PM +0200, Danilo Krummrich wrote: > > > When you say things like this it comes across as though you are > > > implying there are two tiers to the community. Ie those that set t

Re: [PATCH 2/2] nouveau/dmem: Fix memory leak in `migrate_to_ram` upon copy error

2024-09-30 Thread Danilo Krummrich
On Mon, Sep 23, 2024 at 01:54:58PM +, Yonatan Maman wrote: > A copy push command might fail, causing `migrate_to_ram` to return a > dirty HIGH_USER page to the user. > > This exposes a security vulnerability in the nouveau driver. To prevent > memory leaks in `migrate_to_ram` upon a copy error

Re: [PATCH 1/2] nouveau/dmem: Fix privileged error in copy engine channel

2024-09-30 Thread Danilo Krummrich
Hi Yonatan, On Mon, Sep 23, 2024 at 01:54:56PM +, Yonatan Maman wrote: > When `nouveau_dmem_copy_one` is called, the following error occurs: > > [272146.675156] nouveau :06:00.0: fifo: PBDMA9: 0004 [HCE_PRIV] > ch 1 0300 3386 > > This indicates that a copy push command trigge

Re: [RFC 00/29] Introduce NVIDIA GPU Virtualization (vGPU) Support

2024-09-27 Thread Danilo Krummrich
On Fri, Sep 27, 2024 at 09:51:15AM -0300, Jason Gunthorpe wrote: > On Fri, Sep 27, 2024 at 12:42:56AM +0200, Danilo Krummrich wrote: > > On Thu, Sep 26, 2024 at 11:40:57AM -0300, Jason Gunthorpe wrote: > > > On Thu, Sep 26, 2024 at 02:54:38PM +0200, Greg KH wrote: > > >

Re: [RFC 00/29] Introduce NVIDIA GPU Virtualization (vGPU) Support

2024-09-26 Thread Danilo Krummrich
On Thu, Sep 26, 2024 at 11:40:57AM -0300, Jason Gunthorpe wrote: > On Thu, Sep 26, 2024 at 02:54:38PM +0200, Greg KH wrote: > > > > No, I do object to "we are ignoring the driver being proposed by the > > developers involved for this hardware by adding to the old one instead" > > which it seems li

Re: [RFC 00/29] Introduce NVIDIA GPU Virtualization (vGPU) Support

2024-09-26 Thread Danilo Krummrich
On Thu, Sep 26, 2024 at 11:07:56AM -0700, Andy Ritger wrote: > > I hope and expect the nova and vgpu_mgr efforts to ultimately converge. > > First, for the fw ABI debacle: yes, it is unfortunate that we still don't > have a stable ABI from GSP. We /are/ working on it, though there isn't > anythi

Re: [RFC 00/29] Introduce NVIDIA GPU Virtualization (vGPU) Support

2024-09-26 Thread Danilo Krummrich
on, Sep 23, 2024 at 10:49:07AM +0200, Danilo Krummrich wrote: > > > > > > 2. Proposal for upstream > > > > > > > > > > > > > > > > What is the strategy in the mid / long term with this? > >

Re: [RFC 00/29] Introduce NVIDIA GPU Virtualization (vGPU) Support

2024-09-25 Thread Danilo Krummrich
On Tue, Sep 24, 2024 at 09:53:19PM -0300, Jason Gunthorpe wrote: > On Tue, Sep 24, 2024 at 09:56:58PM +0200, Danilo Krummrich wrote: > > > Currently - and please correct me if I'm wrong - you make it sound to me as > > if > > you're not willing to respect the

Re: [RFC 00/29] Introduce NVIDIA GPU Virtualization (vGPU) Support

2024-09-24 Thread Danilo Krummrich
On Tue, Sep 24, 2024 at 01:41:51PM -0300, Jason Gunthorpe wrote: > On Tue, Sep 24, 2024 at 12:50:55AM +0200, Danilo Krummrich wrote: > > > > From the VFIO side I would like to see something like this merged in > > > nearish future as it would bring a previously out of t

Re: [RFC 00/29] Introduce NVIDIA GPU Virtualization (vGPU) Support

2024-09-23 Thread Danilo Krummrich
On Mon, Sep 23, 2024 at 12:01:40PM -0300, Jason Gunthorpe wrote: > On Mon, Sep 23, 2024 at 10:49:07AM +0200, Danilo Krummrich wrote: > > > 2. Proposal for upstream > > > > > > > What is the strategy in the mid / long term with this? >

Re: [RFC 00/29] Introduce NVIDIA GPU Virtualization (vGPU) Support

2024-09-23 Thread Danilo Krummrich
Hi Zhi, Thanks for the very detailed cover letter. On Sun, Sep 22, 2024 at 05:49:22AM -0700, Zhi Wang wrote: > 1. Background > = > > NVIDIA vGPU[1] software enables powerful GPU performance for workloads > ranging from graphics-rich virtual workstations to data science and AI, > enab

Re: [RFC 00/29] Introduce NVIDIA GPU Virtualization (vGPU) Support

2024-09-23 Thread Danilo Krummrich
On Sun, Sep 22, 2024 at 04:11:21PM +0300, Zhi Wang wrote: > On Sun, 22 Sep 2024 05:49:22 -0700 > Zhi Wang wrote: > > +Ben. > > Forget to add you. My bad. Please also add the driver maintainers! I had to fetch the patchset from the KVM list, since they did not hit the nouveau list (I'm trying

Re: [PATCH][next] drm/nouveau: Avoid -Wflex-array-member-not-at-end warning

2024-09-13 Thread Danilo Krummrich
Hi, On 9/13/24 10:09 AM, Gustavo A. R. Silva wrote: Hi all, Friendly ping: who can take this, please? 🙂 Usually, that's me. But I thought you might want to send a v2 based on Kees' comments? - Danilo Thanks -Gustavo On 21/08/24 22:16, Gustavo A. R. Silva wrote: Use the `DEFINE_RAW_FLEX(

Re: [PATCH v2] drm/nouveau/fb: restore init() for ramgp102

2024-09-10 Thread Danilo Krummrich
On 9/5/24 1:24 AM, Ben Skeggs wrote: init() was removed from ramgp102 when reworking the memory detection, as it was thought that the code was only necessary when the driver performs mclk changes, which nouveau doesn't support on pascal. However, it turns out that we still need to execute this o

Re: [PATCH] drm/nouveau/fb: restore init() for ramgp102

2024-09-05 Thread Danilo Krummrich
Hi Ben, On 9/4/24 1:16 AM, Ben Skeggs wrote: init() was removed from ramgp102 when reworking the memory detection, as it was thought that the code was only necessary when the driver performs mclk changes, which nouveau doesn't support on pascal. However, it turns out that we still need to execu

Re: [PATCH v2 1/8] rust: drm: ioctl: Add DRM ioctl abstraction

2024-09-03 Thread Danilo Krummrich
On Mon, Sep 02, 2024 at 06:15:42PM +0200, Daniel Vetter wrote: > On Wed, Jun 19, 2024 at 01:31:37AM +0200, Danilo Krummrich wrote: > > From: Asahi Lina > > > > DRM drivers need to be able to declare which driver-specific ioctls they > > support. Add an abstraction impl

Re: [PATCH v2 3/8] rust: drm: add driver abstractions

2024-09-03 Thread Danilo Krummrich
On Mon, Sep 02, 2024 at 06:29:06PM +0200, Daniel Vetter wrote: > On Wed, Jun 19, 2024 at 01:31:39AM +0200, Danilo Krummrich wrote: > > Implement the DRM driver abstractions. > > > > The `Driver` trait provides the interface to the actual driver to fill > > in the driver

Re: [PATCH -next v2] drm/nouveau: Use for_each_child_of_node_scoped()

2024-08-30 Thread Danilo Krummrich
On Fri, Aug 30, 2024 at 03:36:54PM +0800, Jinjie Ruan wrote: > Avoids the need for manual cleanup of_node_put() in early exits > from the loop. > > Signed-off-by: Jinjie Ruan Applied to drm-misc-next, thanks!

Re: [PATCH 69/86] drm/nouveau: Run DRM default client setup

2024-08-16 Thread Danilo Krummrich
lable video memory, with a default of 32. Adapt this for the new client interface. Signed-off-by: Thomas Zimmermann Acked-by: Danilo Krummrich Cc: Karol Herbst Cc: Lyude Paul Cc: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_drm.c | 7 +-- 1 file changed, 5 insertions(

Re: [PATCH] nouveau/firmware: using dma non-coherent interfaces for fw loading. (v2)

2024-08-15 Thread Danilo Krummrich
On Fri, Aug 16, 2024 at 06:19:23AM +1000, Dave Airlie wrote: > From: Dave Airlie > > Currently, enabling SG_DEBUG in the kernel will cause nouveau to hit a > BUG() on startup, when the iommu is enabled: > > kernel BUG at include/linux/scatterlist.h:187! > invalid opcode: [#1] PREEMPT SMP NO

Re: [PATCH v2 5/9] drm/nouveau: Implement switcheroo reprobe with drm_client_dev_hotplug()

2024-08-12 Thread Danilo Krummrich
On 8/12/24 2:34 PM, Thomas Zimmermann wrote: Hi Am 12.08.24 um 14:17 schrieb Danilo Krummrich: On 8/12/24 10:28 AM, Thomas Zimmermann wrote: Replace the call to drm_fb_helper_output_poll_changed() with a call to drm_client_dev_hotplug(). It is equivalent in functionality, but uses the DRM

Re: [PATCH v2 5/9] drm/nouveau: Implement switcheroo reprobe with drm_client_dev_hotplug()

2024-08-12 Thread Danilo Krummrich
: Daniel Vetter Acked-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_vga.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_vga.c b/drivers/gpu/drm/nouveau/nouveau_vga.c index ee637f1fe03d..ab4e11dc0b8a 100644 --- a/drivers/gpu

Re: [PATCH v2 4/9] drm/nouveau: Do not set struct drm_mode_config_funcs.output_poll_changed

2024-08-12 Thread Danilo Krummrich
Vetter Acked-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/dispnv50/disp.c | 1 - drivers/gpu/drm/nouveau/nouveau_display.c | 1 - 2 files changed, 2 deletions(-) diff --git a/drivers/gpu/drm/nouveau/dispnv50/disp.c b/drivers/gpu/drm/nouveau/dispnv50/disp.c index e4c8ce6dd40a

Re: [PATCH v2 3/9] drm/nouveau: Do not set struct drm_driver.lastclose

2024-08-12 Thread Danilo Krummrich
Signed-off-by: Thomas Zimmermann Acked-by: Danilo Krummrich --- drivers/gpu/drm/nouveau/nouveau_drm.c | 1 - drivers/gpu/drm/nouveau/nouveau_vga.c | 7 --- drivers/gpu/drm/nouveau/nouveau_vga.h | 1 - 3 files changed, 9 deletions(-) diff --git a/drivers/gpu/drm/nouveau/nouveau_drm.c b

Re: [PATCH 2/2] [v7] drm/nouveau: expose GSP-RM logging buffers via debugfs

2024-08-03 Thread Danilo Krummrich
On Sat, Aug 03, 2024 at 03:23:48AM +, Timur Tabi wrote: > On Sat, 2024-08-03 at 02:00 +0200, Danilo Krummrich wrote: > > > +   /* Each GPU has a subdir based on its device name, so find it */ > > > +   struct drm_device *drm_dev = dev_get_drvdata(dev); >

Re: [PATCH 2/2] [v7] drm/nouveau: expose GSP-RM logging buffers via debugfs

2024-08-02 Thread Danilo Krummrich
On Fri, Aug 02, 2024 at 02:05:17PM -0500, Timur Tabi wrote: I was about to apply this patch, but noticed a bug while smoke testing things. > +/** > + * r535_gsp_libos_debugfs_init - create logging debugfs entries > + * @gsp: gsp pointer > + * > + * Create the debugfs entries. This exposes the log

Re: [PATCH 2/2] [v6] drm/nouveau: expose GSP-RM logging buffers via debugfs

2024-07-31 Thread Danilo Krummrich
On Wed, Jul 31, 2024 at 04:22:10PM +, Timur Tabi wrote: > On Wed, 2024-07-31 at 16:54 +0200, Danilo Krummrich wrote: > > > > > > gsp_logs.shutdown(&gsp_logs) -- are you sure you want this?  This is some > > > weird C++ wanna-be code, IMHO.  I don&#x

Re: [PATCH 2/2] [v6] drm/nouveau: expose GSP-RM logging buffers via debugfs

2024-07-31 Thread Danilo Krummrich
On Tue, Jul 30, 2024 at 09:49:15PM +, Timur Tabi wrote: > > "Driver exit" is a bit of an undefined term, the closest thing is probably > > "driver detach" (from a device). In this case I think you actually mean > > "module > > exit" though. > > Yes, I use driver and module interchangeably, but

Re: [PATCH 2/2] [v6] drm/nouveau: expose GSP-RM logging buffers via debugfs

2024-07-29 Thread Danilo Krummrich
Hi Timur, On Mon, Jul 29, 2024 at 06:07:20PM -0500, Timur Tabi wrote: The patch looks great, just a few more nits below. > The LOGINIT, LOGINTR, LOGRM, and LOGPMU buffers are circular buffers > that have printf-like logs from GSP-RM and PMU encoded in them. > > LOGINIT, LOGINTR, and LOGRM are a

Re: [PATCH 1/2] [v2] drm/nouveau: retain device pointer in nvkm_gsp_mem object

2024-07-29 Thread Danilo Krummrich
On 7/30/24 1:09 AM, Timur Tabi wrote: On Mon, 2024-07-29 at 18:07 -0500, Timur Tabi wrote: Store the struct device pointer used to allocate the DMA buffer in the nvkm_gsp_mem object.  This allows nvkm_gsp_mem_dtor() to release the buffer without needing the nvkm_gsp.  This is needed so that we c

  1   2   3   4   5   6   7   8   >