From: sashiko-bot@kernel.org
To: "Michael J. Ruhl" <michael.j.ruhl@intel.com>,
intel-xe@lists.freedesktop.org
Subject: Re: [PATCH v13 01/16] drm/xe/vsec: Do not register BMG PMT for VF
Date: Mon, 02 Nov 2026 22:23:51 +0000 [thread overview]
Message-ID: <sashiko-outbox-194278@kernel.org> (raw)
In-Reply-To: <20261102221314.119028-19-michael.j.ruhl@intel.com>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] drm/xe/vsec: NULL pointer dereference in xe_pmt_telem_read() in survivability mode
--
commit ce97359d953d35ffff16565daa34557b5236e227
Author: Michael J. Ruhl <michael.j.ruhl@intel.com>
drm/xe/vsec: Do not register BMG PMT for VF
This commit skips VSEC PMT registration on Battlemage SR-IOV VF devices,
adds a VF assertion to xe_pmt_telem_read(), and removes the NULL check on
xe->soc_remapper.set_telem_region.
> diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
> index a9baf0bfe572c..178f22db40461 100644
> --- a/drivers/gpu/drm/xe/xe_vsec.c
> +++ b/drivers/gpu/drm/xe/xe_vsec.c
> @@ -149,6 +149,8 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
> u32 offset;
> int ret;
>
> + xe_assert(xe, !IS_SRIOV_VF(xe));
> +
> ret = xe_guid_decode(guid, &mem_region, &offset);
> if (ret)
> return ret;
> @@ -157,9 +159,6 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
>
> guard(mutex)(&xe->pmt.lock);
>
> - if (!xe->soc_remapper.set_telem_region)
> - return -ENODEV;
> -
[Severity: High]
Can removing the xe->soc_remapper.set_telem_region check here cause a NULL
function pointer dereference in xe_pmt_telem_read() when a Battlemage PF
enters boot survivability mode?
When boot survivability mode is enabled during xe_device_probe_early(),
enable_boot_survivability_mode() initializes VSEC and registers the PMT
callbacks:
drivers/gpu/drm/xe/xe_survivability_mode.c:enable_boot_survivability_mode() {
...
xe_heci_gsc_init(xe);
xe_vsec_init(xe);
...
}
Then __xe_pci_probe() returns early before calling xe_device_probe():
drivers/gpu/drm/xe/xe_pci.c:__xe_pci_probe() {
...
err = xe_device_probe_early(xe);
if (xe_survivability_mode_is_boot_enabled(xe))
return 0;
...
err = xe_device_probe(xe);
}
Because xe_soc_remapper_init(xe) is only called inside xe_device_probe(),
xe->soc_remapper.set_telem_region remains NULL in boot survivability mode.
Meanwhile, local_pci_probe() holds a runtime PM reference, so
xe_pm_runtime_get_if_active(xe) returns true. If userspace reads the
exposed PMT telemetry or crashlog sysfs attributes, xe_pmt_telem_read()
will call xe->soc_remapper.set_telem_region(xe, mem_region) when it is
NULL.
It looks like a later patch in the series, commit 6e126caaac7b
("drm/xe/vsec: Support survivability mode for CRI"), adds a call to
xe_soc_remapper_init(xe) in enable_boot_survivability_mode(), but at this
point in the series (and if that change is not backported together with
this one), reading PMT sysfs files in boot survivability mode will crash.
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261102221314.119028-18-michael.j.ruhl@intel.com?part=1
next prev parent reply other threads:[~2026-11-02 22:24 UTC|newest]
Thread overview: 29+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-02 22:13 [PATCH v13 00/16] Crescent Island PMT support Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 01/16] drm/xe/vsec: Do not register BMG PMT for VF Michael J. Ruhl
2026-11-02 22:23 ` sashiko-bot [this message]
2026-11-04 22:27 ` Ruhl, Michael J
2026-11-02 22:13 ` [PATCH v13 02/16] drm/xe/vsec: Correct locking order Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 03/16] drm/xe/vsec: Use correct pm state get Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 04/16] drm/xe/vsec: Add DOC text for VSEC Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 05/16] drm/xe/vsec: Support possible hotplug exit Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 06/16] drm/xe/vsec: Refactor BattleMage PMT defines Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 07/16] drm/xe/vsec: Update VSEC probe order Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 08/16] drm/xe/vsec: Add base_offset to allow for more flexibilty Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 09/16] drm/xe/vsec: Support Crescent Island PMT Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 10/16] drm/xe/vsec: Crescent Island PMT decode Michael J. Ruhl
2026-11-02 22:13 ` [PATCH v13 11/16] drm/xe/vsec: Crescent Island PMT callbacks Michael J. Ruhl
2026-11-02 22:38 ` sashiko-bot
2026-11-02 22:13 ` [PATCH v13 12/16] drm/xe/vsec: Support late bind fw information Michael J. Ruhl
2026-11-02 22:46 ` sashiko-bot
2026-11-02 22:13 ` [PATCH v13 13/16] drm/xe/vsec: Add PMT GUID internal access Michael J. Ruhl
2026-11-02 22:39 ` sashiko-bot
2026-11-02 22:13 ` [PATCH v13 14/16] drm/xe/vsec: Update PMT " Michael J. Ruhl
2026-11-02 22:35 ` sashiko-bot
2026-11-02 22:13 ` [PATCH v13 15/16] drm/xe/vsec: Refactor platform check Michael J. Ruhl
2026-11-02 22:46 ` sashiko-bot
2026-11-02 22:13 ` [PATCH v13 16/16] drm/xe/vsec: Support survivability mode for CRI Michael J. Ruhl
2026-11-02 22:39 ` sashiko-bot
2026-11-02 22:49 ` ✗ CI.checkpatch: warning for Crescent Island PMT support (rev15) Patchwork
2026-11-02 22:51 ` ✓ CI.KUnit: success " Patchwork
2026-11-02 23:23 ` ✓ Xe.CI.BAT: " Patchwork
2026-11-03 1:00 ` ✓ Xe.CI.FULL: " Patchwork
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=sashiko-outbox-194278@kernel.org \
--to=sashiko-bot@kernel.org \
--cc=intel-xe@lists.freedesktop.org \
--cc=michael.j.ruhl@intel.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.