All of lore.kernel.org
 help / color / mirror / Atom feed
From: sashiko-bot@kernel.org
To: "Mohamed Ahmed" <mohamedahmedegypt2001@gmail.com>
Cc: dri-devel@lists.freedesktop.org
Subject: Re: [PATCH 4/7] nouveau/gsp: use per-version DP_CONFIG_STREAM params on r570 firmware
Date: Sat, 15 Aug 2026 00:13:13 +0000	[thread overview]
Message-ID: <20260815001313.A747B1F000E9@smtp.kernel.org> (raw)
In-Reply-To: <20260814235705.59132-5-mohamedahmedegypt2001@gmail.com>

Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:

Pre-existing issues:
- [High] Integer underflow when computing MST.slotEnd for disabled outputs, leading to a massive slotEnd value (0xFFFFFFFF).
--

--- Patch [4]: [PATCH 4/7] nouveau/gsp: use per-version DP_CONFIG_STREAM params on r570 firmware ---
commit d855125b895d27bafd2aaed0c330ae6eae007aef
Author: Mohamed Ahmed <mohamedahmedegypt2001@gmail.com>

nouveau/gsp: use per-version DP_CONFIG_STREAM params on r570 firmware

This commit separates the DP_CONFIG_STREAM_PARAMS structure and its related
functions into r535 and r570 variants. This handles the structure shrinking
that occurred in the 570 firmware version.

> diff --git a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/disp.c b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/disp.c
> index a96e31c2d80b2..61f82e15ff398 100644
> --- a/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/disp.c
> +++ b/drivers/gpu/drm/nouveau/nvkm/subdev/gsp/rm/r570/disp.c
[ ... ]
> @@ -74,6 +75,67 @@ r570_disp_chan_set_pushbuf(struct nvkm_disp *disp, s32 oclass, int inst, struct
>  	return nvkm_gsp_rm_ctrl_wr(&gsp->internal.device.subdevice, ctrl);
>  }
>  
> +static void
> +r570_dp_vcpi(struct nvkm_ior *sor, int head, u8 slot, u8 slot_nr, u16 pbn, u16 aligned_pbn)
> +{
> +	struct nvkm_disp *disp = sor->disp;
> +	NV0073_CTRL_CMD_DP_CONFIG_STREAM_PARAMS *ctrl;
[ ... ]
> +	ctrl->MST.slotStart = slot;
> +	ctrl->MST.slotEnd = slot + slot_nr - 1;

[Severity: High]
This isn't a bug introduced by this patch, but this preexisting issue gets
copied into the new r570_dp_vcpi() function from the r535 code.

When an MST output is disabled, nv50_msto_prepare() (in dispnv50/disp.c)
calls nvif_outp_dp_mst_vcpi() with num_slots=0. This propagates here, setting
slot_nr to 0.

With slot_nr = 0, does the expression "slot + slot_nr - 1" evaluate to -1?
Since MST.slotEnd is an NvU32, this would underflow to 0xFFFFFFFF, passing
a maximal bound for a time slot range to the GSP firmware. 

Could this potentially cause out-of-bounds accesses or hangs in the firmware?
Should this logic be updated to handle slot_nr = 0 safely before it evaluates
to -1 and underflows?

> +	ctrl->MST.PBN = pbn;

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20260814235705.59132-1-mohamedahmedegypt2001@gmail.com?part=4

  reply	other threads:[~2026-08-15  0:13 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-14 23:56 [PATCH 0/7] nouveau: assorted display fixes (GB20x, r570 DP_CONFIG_STREAM, HF-EEODB EDIDs) Mohamed Ahmed
2026-08-14 23:56 ` Mohamed Ahmed
2026-08-14 23:56 ` [PATCH 1/7] nouveau/disp: add GB20x HDMI vendor infoframe writer Mohamed Ahmed
2026-08-14 23:56   ` Mohamed Ahmed
2026-08-15  0:08   ` sashiko-bot
2026-08-14 23:57 ` [PATCH 2/7] nouveau/gsp: fix HDMI vendor infoframes on GB20x Mohamed Ahmed
2026-08-14 23:57   ` Mohamed Ahmed
2026-08-15  0:08   ` sashiko-bot
2026-08-14 23:57 ` [PATCH 3/7] nouveau/gsp: fix HDMI GCP AVMute register offsets " Mohamed Ahmed
2026-08-14 23:57   ` Mohamed Ahmed
2026-08-14 23:57 ` [PATCH 4/7] nouveau/gsp: use per-version DP_CONFIG_STREAM params on r570 firmware Mohamed Ahmed
2026-08-14 23:57   ` Mohamed Ahmed
2026-08-15  0:13   ` sashiko-bot [this message]
2026-08-14 23:57 ` [PATCH 5/7] nouveau/gsp: fix vblank interrupts on GB20x Mohamed Ahmed
2026-08-14 23:57   ` Mohamed Ahmed
2026-08-15  0:08   ` sashiko-bot
2026-08-14 23:57 ` [PATCH 6/7] nouveau/dispnv50: program pixel clocks above 2.147GHz " Mohamed Ahmed
2026-08-14 23:57   ` Mohamed Ahmed
2026-08-14 23:57 ` [PATCH 7/7] nouveau: honor HF-EEODB EDIDs by converting to struct drm_edid Mohamed Ahmed
2026-08-14 23:57   ` Mohamed Ahmed
2026-08-15  0:08   ` sashiko-bot

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260815001313.A747B1F000E9@smtp.kernel.org \
    --to=sashiko-bot@kernel.org \
    --cc=dri-devel@lists.freedesktop.org \
    --cc=mohamedahmedegypt2001@gmail.com \
    --cc=sashiko-reviews@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.