From: Mukul Joshi <mukul.joshi@amd.com>
To: <amd-gfx@lists.freedesktop.org>
Cc: <Felix.Kuehling@amd.com>, <Harish.Kasiviswanathan@amd.com>,
<philip.yang@amd.com>, Mukul Joshi <mukul.joshi@amd.com>,
Sashiko-bot <sashiko-bot@kernel.org>
Subject: [PATCHv2] drm/amdgpu: reject errored peers in UALink local vPod integrity check
Date: Mon, 30 Nov 2026 14:55:48 -0500 [thread overview]
Message-ID: <20261130195618.524940-1-mukul.joshi@amd.com> (raw)
AMDGPU_UALINK_ACCEL_STATE_ERROR sorts above every configured state, so
a local peer in the error state passes both the "pPod configured" and
"vPod configured" checks in __check_local_vpod_integrity() and is
treated as a healthy vPod member. The local vPod is then activated
around an accelerator that cannot participate.
The error state is also entered when pPod validation fails, in which
case the peer's accel_id is unvalidated firmware data and is used to
index vpod.active_accel_bits without a bounds check.
Handle errored peers explicitly: fail the integrity check if the peer
is a member of this vPod, and skip it otherwise. If the peer's
accel_id is out of range, its membership cannot be determined, so
treat it as a member and fail the check rather than risk activating
the vPod without it.
Fixes: 448a35158bee ("drm/amdgpu: Assign accel state based on ASP config")
Reported-by: Sashiko-bot <sashiko-bot@kernel.org>
Signed-off-by: Mukul Joshi <mukul.joshi@amd.com>
---
v1->v2:
- Ensure invalid accel_id peer fail VPOD activation.
drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
index 0982d8455b0c..3adb12bd9df5 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_ualink.c
@@ -1180,6 +1180,20 @@ static int __check_local_vpod_integrity(struct amdgpu_device *adev)
}
accel_id = peer_info->ppod.accel_id;
+ /* An errored peer's accel_id may have failed validation, in
+ * which case its vPod membership is unknown: treat it as a
+ * member.
+ */
+ if (peer_info->accel_state == AMDGPU_UALINK_ACCEL_STATE_ERROR) {
+ if (accel_id >= AMDGPU_UALINK_ACCEL_MAX ||
+ test_bit(accel_id, info->vpod.active_accel_bits)) {
+ dev_warn(adev->dev,
+ "UALINK: integrity fail: errored peer accel_id=%u is or may be a vpod member\n",
+ accel_id);
+ return -EINVAL;
+ }
+ continue;
+ }
if (!test_bit(accel_id, info->vpod.active_accel_bits))
continue;
/* peer device vpod not configured */
--
2.56.0
next reply other threads:[~2026-11-30 19:56 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-30 19:55 Mukul Joshi [this message]
2026-11-30 20:16 ` [PATCHv2] drm/amdgpu: reject errored peers in UALink local vPod integrity check sashiko-bot
2026-11-30 20:16 ` Felix Kuehling
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=20261130195618.524940-1-mukul.joshi@amd.com \
--to=mukul.joshi@amd.com \
--cc=Felix.Kuehling@amd.com \
--cc=Harish.Kasiviswanathan@amd.com \
--cc=amd-gfx@lists.freedesktop.org \
--cc=philip.yang@amd.com \
--cc=sashiko-bot@kernel.org \
/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.