Thank you for your contribution! Sashiko AI review found 1 potential issue(s) 
to consider:
- [Medium] Newly added `logmnoc` and `logkrnl` logging buffers are allocated 
and passed to GSP-RM, but they are not exported to debugfs or retained on 
failure, making them entirely inaccessible to userspace.
--

--- Patch [3]: [PATCH 3/6] nouveau/gsp: add logging entries for r570 ---
commit bbe0f1142019c1da5450d6ce1f59020ffc413ec2
Author: Dave Airlie <[email protected]>

nouveau/gsp: add logging entries for r570

r570 adds logmnoc and logkrnl. logkrnl is only used for libos3, so
add a flag to pick libos2 out and not init on that.

> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c 
> b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c
> index 64011430f4c0a..d9786830153da 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/gsp.c
[ ... ]
> @@ -255,15 +256,27 @@ r570_gsp_libos_init(struct nvkm_gsp *gsp)
>       if (ret)
>               return ret;
>  
> +     ret = gsp_fill_libos_entry(gsp, &args[3], 0x10000, &gsp->logmnoc, 
> "LOGMNOC");
> +     if (ret)
> +             return ret;
> +
> +     idx = 4;
> +     if (!gsp->rm->wpr->is_libos2) {
> +             ret = gsp_fill_libos_entry(gsp, &args[idx], 0x10000, 
> &gsp->logkrnl, "LOGKRNL");
> +             if (ret)
> +                     return ret;
> +             idx++;
> +     }
> +
>       ret = r535_gsp_rmargs_init(gsp, false);
>       if (ret)
>               return ret;
>  
> -     args[3].id8  = r535_gsp_libos_id8("RMARGS");
> -     args[3].pa   = gsp->rmargs.addr;
> -     args[3].size = gsp->rmargs.size;
> -     args[3].kind = LIBOS_MEMORY_REGION_CONTIGUOUS;
> -     args[3].loc  = LIBOS_MEMORY_REGION_LOC_SYSMEM;
> +     args[idx].id8  = r535_gsp_libos_id8("RMARGS");
> +     args[idx].pa   = gsp->rmargs.addr;
> +     args[idx].size = gsp->rmargs.size;
> +     args[idx].kind = LIBOS_MEMORY_REGION_CONTIGUOUS;
> +     args[idx].loc  = LIBOS_MEMORY_REGION_LOC_SYSMEM;
>  
>  #ifdef CONFIG_DEBUG_FS
>       r535_gsp_libos_debugfs_init(gsp);

[Severity: Medium]
Are these new logging buffers missing debugfs integration?

Looking at r535_gsp_libos_debugfs_init(), it doesn't appear to be updated
to expose the newly allocated logmnoc and logkrnl buffers to userspace.

Additionally, will these logs be retained on initialization failure if
r535_gsp_retain_logging() is also not updated to handle them?

-- 
Sashiko AI review ยท 
https://sashiko.dev/#/patchset/[email protected]?part=3

Reply via email to