On Tue, 2024-02-13 at 17:57 +0100, Danilo Krummrich wrote:
+ struct debugfs_blob_wrapper blob_init;+ struct debugfs_blob_wrapper blob_intr;+ struct debugfs_blob_wrapper blob_rm;+ struct debugfs_blob_wrapper blob_pmu;+ struct dentry *debugfs_logging_dir;I think we should not create those from within the nvkm layer, but rather passthem down through nvkm_device_pci_new().
Should they be created in nvkm_device_pci_new() also, even though we have no idea whether GSP is involved at that point?
Lifecycle wise I think we should ensure that removing the Nouveau kernel modulealso cleans up those buffers. Even though keep-gsp-logging is considered unsafe,we shouldn't leak memory.
I agree, but then there needs to be some way to keep these debugfs entries until the driver unloads. I don't know how to do that without creating some ugly global variables.
For instance, can we allocate corresponding buffers in the driver layer, copythings over and keep those buffers until nouveau_drm_exit()? This would alsoavoid exposing those DMA buffers via debugfs.
The whole point behind this patch is to expose the buffers via debugfs. How else should they be exposed?