* [PATCH v16 01/17] drm/xe/vsec: VSEC requires soc-remapper
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
@ 2026-11-16 15:06 ` Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 02/17] drm/xe/vsec: Do not register BMG PMT for VF Michael J. Ruhl
` (15 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:06 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
Survivability mode includes xe_vsec_init(). VSEC requires
the soc remapper to be initialized.
Add the correct init to allow correct VSEC behavior.
Fixes: 32eab46a6160 ("drm/xe/soc_remapper: Use SoC remapper helper from VSEC code")
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_survivability_mode.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/gpu/drm/xe/xe_survivability_mode.c b/drivers/gpu/drm/xe/xe_survivability_mode.c
index 91a0680e449b..10f9de4eb03b 100644
--- a/drivers/gpu/drm/xe/xe_survivability_mode.c
+++ b/drivers/gpu/drm/xe/xe_survivability_mode.c
@@ -21,6 +21,7 @@
#include "xe_nvm.h"
#include "xe_pcode_api.h"
#include "xe_printk.h"
+#include "xe_soc_remapper.h"
#include "xe_vsec.h"
#include "xe_wedge.h"
@@ -354,6 +355,7 @@ static int enable_boot_survivability_mode(struct pci_dev *pdev)
xe_heci_gsc_init(xe);
+ xe_soc_remapper_init(xe);
xe_vsec_init(xe);
if (survivability->fdo_mode) {
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 02/17] drm/xe/vsec: Do not register BMG PMT for VF
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 01/17] drm/xe/vsec: VSEC requires soc-remapper Michael J. Ruhl
@ 2026-11-16 15:06 ` Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 03/17] drm/xe/vsec: Correct locking order Michael J. Ruhl
` (14 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:06 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
BMG PMT is not supported for VF nodes.
If IS_SRIOV_VF() is true, do NOT register with PMT.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_vsec.c | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index a9baf0bfe572..178f22db4046 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;
-
/* indicate that we are not at an appropriate power level */
if (!xe_pm_runtime_get_if_active(xe))
return -ENODATA;
@@ -186,6 +185,9 @@ static enum xe_vsec get_platform_info(struct xe_device *xe)
if (xe->info.platform > XE_BATTLEMAGE)
return XE_VSEC_UNKNOWN;
+ if (IS_SRIOV_VF(xe) && xe->info.platform == XE_BATTLEMAGE)
+ return XE_VSEC_UNKNOWN;
+
return vsec_platforms[xe->info.platform];
}
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 03/17] drm/xe/vsec: Correct locking order
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 01/17] drm/xe/vsec: VSEC requires soc-remapper Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 02/17] drm/xe/vsec: Do not register BMG PMT for VF Michael J. Ruhl
@ 2026-11-16 15:06 ` Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 04/17] drm/xe/vsec: Use correct pm state get Michael J. Ruhl
` (13 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:06 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
Xe locking order is power state first, and then local locks.
Reorder locking for correct usage.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_vsec.c | 11 ++++++-----
1 file changed, 6 insertions(+), 5 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index 178f22db4046..d93c042cf25b 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -157,16 +157,17 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
telem_addr += offset + user_offset;
- guard(mutex)(&xe->pmt.lock);
-
/* indicate that we are not at an appropriate power level */
if (!xe_pm_runtime_get_if_active(xe))
return -ENODATA;
- /* set SoC re-mapper index register based on GUID memory region */
- xe->soc_remapper.set_telem_region(xe, mem_region);
+ scoped_guard(mutex, &xe->pmt.lock) {
+ /* set SoC re-mapper index register based on GUID memory region */
+ xe->soc_remapper.set_telem_region(xe, mem_region);
+
+ memcpy_fromio(data, telem_addr, count);
+ }
- memcpy_fromio(data, telem_addr, count);
xe_pm_runtime_put(xe);
return count;
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 04/17] drm/xe/vsec: Use correct pm state get
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (2 preceding siblings ...)
2026-11-16 15:06 ` [PATCH v16 03/17] drm/xe/vsec: Correct locking order Michael J. Ruhl
@ 2026-11-16 15:06 ` Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 05/17] drm/xe/vsec: Add DOC text for VSEC Michael J. Ruhl
` (12 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:06 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
Crashlog needs to be collected at all times. The current pm check
assumes telemetry only.
Update read path to enable device for crashlog instances.
Include check of the WATCHER CAP_TYPE for completeness.
WATCHER is a possible type and needs to be accounted for, but is not
supported.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Fixes: 0c45e76fcc62 ("drm/xe/vsec: Support BMG devices")
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_vsec.c | 16 +++++++++++++---
1 file changed, 13 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index d93c042cf25b..38081dacd307 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -145,6 +145,7 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
{
struct xe_device *xe = kdev_to_xe_device(dev);
void __iomem *telem_addr = xe->mmio.regs + BMG_TELEMETRY_OFFSET;
+ u32 cap_type = FIELD_GET(GUID_CAP_TYPE, guid);
u32 mem_region;
u32 offset;
int ret;
@@ -157,9 +158,18 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
telem_addr += offset + user_offset;
- /* indicate that we are not at an appropriate power level */
- if (!xe_pm_runtime_get_if_active(xe))
- return -ENODATA;
+ /* Always allow crashlog. Telemetry, only when powered */
+ switch (cap_type) {
+ case CRASHLOG:
+ xe_pm_runtime_get(xe);
+ break;
+ case TELEMETRY:
+ if (!xe_pm_runtime_get_if_active(xe))
+ return -ENODATA;
+ break;
+ case WATCHER:
+ return -EINVAL;
+ }
scoped_guard(mutex, &xe->pmt.lock) {
/* set SoC re-mapper index register based on GUID memory region */
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 05/17] drm/xe/vsec: Add DOC text for VSEC
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (3 preceding siblings ...)
2026-11-16 15:06 ` [PATCH v16 04/17] drm/xe/vsec: Use correct pm state get Michael J. Ruhl
@ 2026-11-16 15:06 ` Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 06/17] drm/xe/vsec: Support possible hotplug exit Michael J. Ruhl
` (11 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:06 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
Add the necessary files and text to use the DOC system.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
Documentation/gpu/xe/index.rst | 1 +
Documentation/gpu/xe/xe_vsec.rst | 14 ++++++++++++++
drivers/gpu/drm/xe/xe_vsec.c | 24 ++++++++++++++++++++++++
3 files changed, 39 insertions(+)
create mode 100644 Documentation/gpu/xe/xe_vsec.rst
diff --git a/Documentation/gpu/xe/index.rst b/Documentation/gpu/xe/index.rst
index 497a0a4b12f6..de829aecf8f1 100644
--- a/Documentation/gpu/xe/index.rst
+++ b/Documentation/gpu/xe/index.rst
@@ -37,3 +37,4 @@ The display, or :ref:`drm-kms`, support for drm/xe is provided by
xe_gt_stats
xe_sigid
xe_pci_error
+ xe_vsec
diff --git a/Documentation/gpu/xe/xe_vsec.rst b/Documentation/gpu/xe/xe_vsec.rst
new file mode 100644
index 000000000000..1a87548489ea
--- /dev/null
+++ b/Documentation/gpu/xe/xe_vsec.rst
@@ -0,0 +1,14 @@
+.. SPDX-License-Identifier: (GPL-2.0+ OR MIT)
+
+=====
+VSEC
+=====
+
+.. kernel-doc:: drivers/gpu/drm/xe/xe_vsec.c
+ :doc: VSEC
+
+Internal API
+============
+
+.. kernel-doc:: drivers/gpu/drm/xe/xe_vsec.c
+ :internal:
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index 38081dacd307..082b25b017db 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -19,6 +19,17 @@
#include "regs/xe_pmt.h"
+/**
+ * DOC: VSEC
+ *
+ * Some GPUs support the PMT feature. For those that do, this API provides
+ * probe, discovery and usage (control and access) for GPUs that have PMT.
+ *
+ * PMT is usually accessed through a PCI function. However, that is not always
+ * available, so the PMT intel_vsec_register() function can be used to set up
+ * PMT usage.
+ */
+
/* PMT GUID value for BMG devices. NOTE: this is NOT a PCI id */
#define BMG_DEVICE_ID 0xE2F8
@@ -140,6 +151,19 @@ static int xe_guid_decode(u32 guid, int *index, u32 *offset)
return 0;
}
+/**
+ * xe_pmt_telem_read - Given a device and a PMT GUID, read data into a buffer
+ * @dev: valid Xe device
+ * @guid: PMT GUID (from the PMT discovery struct)
+ * @data: buffer to place data in
+ * @user_offset: a user offset relative to the beginning of the data to read
+ * @count: bytes to read
+ *
+ * Return:
+ * * -ENODATA for incorrect power state
+ * * -EINVAL for unsupported PMT feature
+ * * count number of bytes read on success
+ */
int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offset,
u32 count)
{
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 06/17] drm/xe/vsec: Support possible hotplug exit
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (4 preceding siblings ...)
2026-11-16 15:06 ` [PATCH v16 05/17] drm/xe/vsec: Add DOC text for VSEC Michael J. Ruhl
@ 2026-11-16 15:06 ` Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 07/17] drm/xe/vsec: Refactor BattleMage PMT defines Michael J. Ruhl
` (10 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:06 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
DRM has an API that will verify that a device is valid in the hotplug
context.
Verify device is valid before access in the VSEC callback API.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_vsec.c | 29 +++++++++++++++++++++++------
1 file changed, 23 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index 082b25b017db..c0e06b2aeca6 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -10,6 +10,8 @@
#include <linux/pci.h>
#include <linux/types.h>
+#include <drm/drm_drv.h>
+
#include "xe_device.h"
#include "xe_device_types.h"
#include "xe_mmio.h"
@@ -159,7 +161,12 @@ static int xe_guid_decode(u32 guid, int *index, u32 *offset)
* @user_offset: a user offset relative to the beginning of the data to read
* @count: bytes to read
*
+ * This is a callback API. I.e this can be accessed external to the XE driver
+ * (PMT driver scope). Because of this, DRM hotplug needs to be verified
+ * (drm_dev_enter()).
+ *
* Return:
+ * * -ENODEV device is not available (hotplug)
* * -ENODATA for incorrect power state
* * -EINVAL for unsupported PMT feature
* * count number of bytes read on success
@@ -172,13 +179,17 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
u32 cap_type = FIELD_GET(GUID_CAP_TYPE, guid);
u32 mem_region;
u32 offset;
- int ret;
+ int ret = 0;
+ int idx;
xe_assert(xe, !IS_SRIOV_VF(xe));
+ if (!drm_dev_enter(&xe->drm, &idx))
+ return -ENODEV;
+
ret = xe_guid_decode(guid, &mem_region, &offset);
if (ret)
- return ret;
+ goto dev_exit;
telem_addr += offset + user_offset;
@@ -188,11 +199,14 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
xe_pm_runtime_get(xe);
break;
case TELEMETRY:
- if (!xe_pm_runtime_get_if_active(xe))
- return -ENODATA;
+ if (!xe_pm_runtime_get_if_active(xe)) {
+ ret = -ENODATA;
+ goto dev_exit;
+ }
break;
case WATCHER:
- return -EINVAL;
+ ret = -EINVAL;
+ goto dev_exit;
}
scoped_guard(mutex, &xe->pmt.lock) {
@@ -204,7 +218,10 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
xe_pm_runtime_put(xe);
- return count;
+dev_exit:
+ drm_dev_exit(idx);
+
+ return ret == 0 ? count : ret;
}
static struct pmt_callbacks xe_pmt_cb = {
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 07/17] drm/xe/vsec: Refactor BattleMage PMT defines
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (5 preceding siblings ...)
2026-11-16 15:06 ` [PATCH v16 06/17] drm/xe/vsec: Support possible hotplug exit Michael J. Ruhl
@ 2026-11-16 15:06 ` Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 08/17] drm/xe/vsec: Update VSEC probe order Michael J. Ruhl
` (9 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:06 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
Rename generic defines to be BMG specific.
Define several magic numbers.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_vsec.c | 29 +++++++++++++++++------------
1 file changed, 17 insertions(+), 12 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index c0e06b2aeca6..ebe56c85bc05 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -90,10 +90,15 @@ static struct intel_vsec_platform_info xe_vsec_info[] = {
#define GUID_CAP_TYPE GENMASK(29, 28)
#define GUID_RECORD_ID GENMASK(31, 30)
-#define PUNIT_TELEMETRY_OFFSET 0x0200
-#define PUNIT_WATCHER_OFFSET 0x14A0
-#define OOBMSM_0_WATCHER_OFFSET 0x18D8
-#define OOBMSM_1_TELEMETRY_OFFSET 0x1000
+#define BMG_IDX_TELEM_PUNIT 0x00
+#define BMG_IDX_TELEM_OOBMSM 0x01
+#define BMG_IDX_CRASHLOG_PUNIT 0x02
+#define BMG_IDX_CRASHLOG_OOBMSM 0x04
+
+#define BMG_PUNIT_TELEMETRY_OFFSET 0x0200
+#define BMG_PUNIT_WATCHER_OFFSET 0x14A0
+#define BMG_OOBMSM_0_WATCHER_OFFSET 0x18D8
+#define BMG_OOBMSM_1_TELEMETRY_OFFSET 0x1000
enum record_id {
PUNIT,
@@ -122,29 +127,29 @@ static int xe_guid_decode(u32 guid, int *index, u32 *offset)
*offset = 0;
if (cap_type == CRASHLOG) {
- *index = record_id == PUNIT ? 2 : 4;
+ *index = record_id == PUNIT ? BMG_IDX_CRASHLOG_PUNIT : BMG_IDX_CRASHLOG_OOBMSM;
return 0;
}
switch (record_id) {
case PUNIT:
- *index = 0;
+ *index = BMG_IDX_TELEM_PUNIT;
if (cap_type == TELEMETRY)
- *offset = PUNIT_TELEMETRY_OFFSET;
+ *offset = BMG_PUNIT_TELEMETRY_OFFSET;
else
- *offset = PUNIT_WATCHER_OFFSET;
+ *offset = BMG_PUNIT_WATCHER_OFFSET;
break;
case OOBMSM_0:
- *index = 1;
+ *index = BMG_IDX_TELEM_OOBMSM;
if (cap_type == WATCHER)
- *offset = OOBMSM_0_WATCHER_OFFSET;
+ *offset = BMG_OOBMSM_0_WATCHER_OFFSET;
break;
case OOBMSM_1:
- *index = 1;
+ *index = BMG_IDX_TELEM_OOBMSM;
if (cap_type == TELEMETRY)
- *offset = OOBMSM_1_TELEMETRY_OFFSET;
+ *offset = BMG_OOBMSM_1_TELEMETRY_OFFSET;
break;
default:
return -EINVAL;
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 08/17] drm/xe/vsec: Update VSEC probe order
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (6 preceding siblings ...)
2026-11-16 15:06 ` [PATCH v16 07/17] drm/xe/vsec: Refactor BattleMage PMT defines Michael J. Ruhl
@ 2026-11-16 15:06 ` Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 09/17] drm/xe/vsec: Add base_offset to allow for more flexibilty Michael J. Ruhl
` (8 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:06 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
Both debugfs and hwmon access the PMT data area before PMT is
initialized.
Hardwired offset usage allows this to work by accident.
Upcoming changes will break this usage.
Re-order the probe steps to initialize VSEC before the other
features are initialized.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_device.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index 6911c2ac39f8..c3cd98244d4c 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -1083,6 +1083,8 @@ int xe_device_probe(struct xe_device *xe)
if (err)
goto err_unregister_display;
+ xe_vsec_init(xe);
+
xe_debugfs_register(xe);
err = xe_hwmon_register(xe);
@@ -1096,8 +1098,6 @@ int xe_device_probe(struct xe_device *xe)
for_each_gt(gt, xe, id)
xe_gt_sanitize_freq(gt);
- xe_vsec_init(xe);
-
err = xe_sriov_init_late(xe);
if (err)
goto err_unregister_display;
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 09/17] drm/xe/vsec: Add base_offset to allow for more flexibilty
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (7 preceding siblings ...)
2026-11-16 15:06 ` [PATCH v16 08/17] drm/xe/vsec: Update VSEC probe order Michael J. Ruhl
@ 2026-11-16 15:06 ` Michael J. Ruhl
2026-11-16 15:06 ` [PATCH v16 10/17] drm/xe/vsec: Support Crescent Island PMT Michael J. Ruhl
` (7 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:06 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
Current pmt_telem_read() usage is a fixed (for BMG) offset.
In order to support other devices this must be settable.
Add a base offset for more flexibility.
Add a check to verify that it has been set before allowing
device access.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_device_types.h | 2 ++
drivers/gpu/drm/xe/xe_vsec.c | 9 ++++++++-
2 files changed, 10 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 8f2a31949073..28b1669a14d8 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -485,6 +485,8 @@ struct xe_device {
struct {
/** @pmt.lock: protect access for telemetry data */
struct mutex lock;
+ /** @pmt.base_offset: device specific base offset */
+ u64 base_offset;
} pmt;
/** @soc_remapper: SoC remapper object */
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index ebe56c85bc05..04aec1e5c15c 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -172,6 +172,7 @@ static int xe_guid_decode(u32 guid, int *index, u32 *offset)
*
* Return:
* * -ENODEV device is not available (hotplug)
+ * * -EAGAIN base_offset has not been set, so init path has not yet been done.
* * -ENODATA for incorrect power state
* * -EINVAL for unsupported PMT feature
* * count number of bytes read on success
@@ -180,8 +181,8 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
u32 count)
{
struct xe_device *xe = kdev_to_xe_device(dev);
- void __iomem *telem_addr = xe->mmio.regs + BMG_TELEMETRY_OFFSET;
u32 cap_type = FIELD_GET(GUID_CAP_TYPE, guid);
+ void __iomem *telem_addr = xe->mmio.regs + xe->pmt.base_offset;
u32 mem_region;
u32 offset;
int ret = 0;
@@ -192,6 +193,11 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
if (!drm_dev_enter(&xe->drm, &idx))
return -ENODEV;
+ if (!xe->pmt.base_offset) {
+ ret = -EAGAIN;
+ goto dev_exit;
+ }
+
ret = xe_guid_decode(guid, &mem_region, &offset);
if (ret)
goto dev_exit;
@@ -269,6 +275,7 @@ void xe_vsec_init(struct xe_device *xe)
switch (platform) {
case XE_VSEC_BMG:
+ xe->pmt.base_offset = BMG_TELEMETRY_OFFSET;
info->priv_data = &xe_pmt_cb;
break;
default:
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 10/17] drm/xe/vsec: Support Crescent Island PMT
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (8 preceding siblings ...)
2026-11-16 15:06 ` [PATCH v16 09/17] drm/xe/vsec: Add base_offset to allow for more flexibilty Michael J. Ruhl
@ 2026-11-16 15:06 ` Michael J. Ruhl
2026-11-16 15:07 ` [PATCH v16 11/17] drm/xe/vsec: Crescent Island PMT decode Michael J. Ruhl
` (6 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:06 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
Crescent Island (CRI) supports PMT telemetry and crashlog.
Add Crescent Island (CRI) discovery structure (DVSEC) information to
allow for Xe registration.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/regs/xe_pmt.h | 8 +++--
drivers/gpu/drm/xe/xe_vsec.c | 51 +++++++++++++++++++++++++++++---
2 files changed, 53 insertions(+), 6 deletions(-)
diff --git a/drivers/gpu/drm/xe/regs/xe_pmt.h b/drivers/gpu/drm/xe/regs/xe_pmt.h
index a62ab05c6b4c..2f6658395587 100644
--- a/drivers/gpu/drm/xe/regs/xe_pmt.h
+++ b/drivers/gpu/drm/xe/regs/xe_pmt.h
@@ -17,8 +17,12 @@
#define PUNIT_VERSION_OFFSET 0xA0
-#define BMG_TELEMETRY_BASE_OFFSET 0xE0000
-#define BMG_TELEMETRY_OFFSET (SOC_BASE + BMG_TELEMETRY_BASE_OFFSET)
+#define XE_PMT_BASE_OFFSET 0xE0000
+
+#define BMG_TELEMETRY_OFFSET (SOC_BASE + XE_PMT_BASE_OFFSET)
+
+/* for CRI discovery and telemetry are in an indexed window */
+#define CRI_PMT_OFFSET (SOC_BASE + XE_PMT_BASE_OFFSET)
#define BMG_MODS_RESIDENCY_OFFSET (0x4D0)
#define BMG_G2_RESIDENCY_OFFSET (0x530)
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index 04aec1e5c15c..4ecc2d9f3f38 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -8,6 +8,7 @@
#include <linux/module.h>
#include <linux/mutex.h>
#include <linux/pci.h>
+#include <linux/sizes.h>
#include <linux/types.h>
#include <drm/drm_drv.h>
@@ -32,12 +33,23 @@
* PMT usage.
*/
-/* PMT GUID value for BMG devices. NOTE: this is NOT a PCI id */
+/* PMT GUID value for BMG and CRI devices. NOTE: this is NOT a PCI id */
#define BMG_DEVICE_ID 0xE2F8
+#define CRI_DEVICE_ID 0xE2FA
+
+/*
+ * sizeof(Crashlog Type1 Version2) = 0x18 (24) bytes
+ * For BMG and CRI PUNIT and OOBMSMS crashlogs are consecutive.
+ */
+#define BMG_CRASHLOG_PUNIT_DISC_OFFSET (0x60)
+#define BMG_CRASHLOG_OOBMSM_DISC_OFFSET (BMG_CRASHLOG_PUNIT_DISC_OFFSET + 0x18)
+
+#define CRI_CRASHLOG_PUNIT_DISC_OFFSET (0x80)
+#define CRI_CRASHLOG_OOBMSM_DISC_OFFSET (CRI_CRASHLOG_PUNIT_DISC_OFFSET + 0x18)
static struct intel_vsec_header bmg_telemetry = {
.rev = 1,
- .length = 0x10,
+ .length = SZ_16,
.id = VSEC_ID_TELEMETRY,
.num_entries = 2,
.entry_size = 4,
@@ -47,12 +59,12 @@ static struct intel_vsec_header bmg_telemetry = {
static struct intel_vsec_header bmg_crashlog = {
.rev = 1,
- .length = 0x10,
+ .length = SZ_16,
.id = VSEC_ID_CRASHLOG,
.num_entries = 2,
.entry_size = 6,
.tbir = 0,
- .offset = BMG_DISCOVERY_OFFSET + 0x60,
+ .offset = BMG_DISCOVERY_OFFSET + BMG_CRASHLOG_PUNIT_DISC_OFFSET,
};
static struct intel_vsec_header *bmg_capabilities[] = {
@@ -61,9 +73,36 @@ static struct intel_vsec_header *bmg_capabilities[] = {
NULL
};
+static struct intel_vsec_header cri_telemetry = {
+ .rev = 1,
+ .length = SZ_16,
+ .id = VSEC_ID_TELEMETRY,
+ .num_entries = 3,
+ .entry_size = 4,
+ .tbir = 0,
+ .offset = CRI_PMT_OFFSET,
+};
+
+static struct intel_vsec_header cri_crashlog = {
+ .rev = 1,
+ .length = SZ_16,
+ .id = VSEC_ID_CRASHLOG,
+ .num_entries = 2,
+ .entry_size = 6,
+ .tbir = 0,
+ .offset = CRI_PMT_OFFSET + CRI_CRASHLOG_PUNIT_DISC_OFFSET,
+};
+
+static struct intel_vsec_header *cri_capabilities[] = {
+ &cri_telemetry,
+ &cri_crashlog,
+ NULL
+};
+
enum xe_vsec {
XE_VSEC_UNKNOWN = 0,
XE_VSEC_BMG,
+ XE_VSEC_CRI,
};
static struct intel_vsec_platform_info xe_vsec_info[] = {
@@ -71,6 +110,10 @@ static struct intel_vsec_platform_info xe_vsec_info[] = {
.caps = VSEC_CAP_TELEMETRY | VSEC_CAP_CRASHLOG,
.headers = bmg_capabilities,
},
+ [XE_VSEC_CRI] = {
+ .caps = VSEC_CAP_TELEMETRY | VSEC_CAP_CRASHLOG,
+ .headers = cri_capabilities,
+ },
{ }
};
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 11/17] drm/xe/vsec: Crescent Island PMT decode
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (9 preceding siblings ...)
2026-11-16 15:06 ` [PATCH v16 10/17] drm/xe/vsec: Support Crescent Island PMT Michael J. Ruhl
@ 2026-11-16 15:07 ` Michael J. Ruhl
2026-11-16 15:07 ` [PATCH v16 12/17] drm/xe/vsec: Crescent Island PMT callbacks Michael J. Ruhl
` (5 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:07 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
Crescent Island (CRI) has different index and offset values for
accessing the PMT data area.
Update the decode path to support the CRI device.
Update the data read callback so to support the CRI usage.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_vsec.c | 100 +++++++++++++++++++++++++++++++----
1 file changed, 90 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index 4ecc2d9f3f38..a814d7151eea 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -120,19 +120,25 @@ static struct intel_vsec_platform_info xe_vsec_info[] = {
/*
* The GUID will have the following bits to decode:
* [0:3] - {Telemetry space iteration number (0,1,..)}
- * [4:7] - Segment (SEGMENT_INDEPENDENT-0, Client-1, Server-2)
+ * [4:7] - BMG Segment (SEGMENT_INDEPENDENT-0, Client-1, Server-2)
+ * [4:5] - CRI Segment (SEGMENT_INDEPENDENT-0, Client-1, Server-2)
+ * [6:7] - CRI Instance
* [8:11] - SOC_SKU
* [12:27] – Device ID – changes for each down bin SKU’s
* [28:29] - Capability Type (Crashlog-0, Telemetry Aggregator-1, Watcher-2)
* [30:31] - Record-ID (0-PUNIT, 1-OOBMSM_0, 2-OOBMSM_1)
*/
#define GUID_TELEM_ITERATION GENMASK(3, 0)
-#define GUID_SEGMENT GENMASK(7, 4)
#define GUID_SOC_SKU GENMASK(11, 8)
#define GUID_DEVICE_ID GENMASK(27, 12)
#define GUID_CAP_TYPE GENMASK(29, 28)
#define GUID_RECORD_ID GENMASK(31, 30)
+#define BMG_GUID_SEGMENT GENMASK(7, 4)
+
+#define CRI_GUID_SEGMENT GENMASK(5, 4)
+#define CRI_GUID_INSTANCE GENMASK(7, 6)
+
#define BMG_IDX_TELEM_PUNIT 0x00
#define BMG_IDX_TELEM_OOBMSM 0x01
#define BMG_IDX_CRASHLOG_PUNIT 0x02
@@ -143,6 +149,18 @@ static struct intel_vsec_platform_info xe_vsec_info[] = {
#define BMG_OOBMSM_0_WATCHER_OFFSET 0x18D8
#define BMG_OOBMSM_1_TELEMETRY_OFFSET 0x1000
+#define CRI_IDX_TELEM_DISCOVERY 0x00
+#define CRI_IDX_TELEM_PUNIT 0x01
+#define CRI_IDX_TELEM_OOBMSM 0x02
+#define CRI_IDX_CRASHLOG_PUNIT 0x03
+#define CRI_IDX_WATCHER_OOBMSM 0x03 /* PUNIT and OOBMSM share this index */
+#define CRI_IDX_CRASHLOG_OOBMSM 0x04
+
+#define CRI_PUNIT_WATCHER_OFFSET 0x08A0
+#define CRI_OOBMSM_WATCHER_OFFSET 0x0CF8
+#define CRI_OOBMSM_GFSP_TELEMETRY_OFFSET 0x1600
+#define CRI_PUNIT_CRASHLOG_OFFSET 0x0E60
+
enum record_id {
PUNIT,
OOBMSM_0,
@@ -155,17 +173,10 @@ enum capability {
WATCHER,
};
-static int xe_guid_decode(u32 guid, int *index, u32 *offset)
+static int bmg_guid_decode(u32 guid, int *index, u32 *offset)
{
u32 record_id = FIELD_GET(GUID_RECORD_ID, guid);
u32 cap_type = FIELD_GET(GUID_CAP_TYPE, guid);
- u32 device_id = FIELD_GET(GUID_DEVICE_ID, guid);
-
- if (device_id != BMG_DEVICE_ID)
- return -ENODEV;
-
- if (cap_type > WATCHER)
- return -EINVAL;
*offset = 0;
@@ -201,6 +212,75 @@ static int xe_guid_decode(u32 guid, int *index, u32 *offset)
return 0;
}
+static int cri_guid_decode(u32 guid, int *index, u32 *offset)
+{
+ u32 record_id = FIELD_GET(GUID_RECORD_ID, guid);
+ u32 cap_type = FIELD_GET(GUID_CAP_TYPE, guid);
+ u32 instance = FIELD_GET(CRI_GUID_INSTANCE, guid);
+
+ *offset = 0;
+
+ if (cap_type == CRASHLOG) {
+ if (record_id == PUNIT) {
+ *index = CRI_IDX_CRASHLOG_PUNIT;
+ *offset = CRI_PUNIT_CRASHLOG_OFFSET;
+ } else {
+ *index = CRI_IDX_CRASHLOG_OOBMSM;
+ }
+ return 0;
+ }
+
+ switch (record_id) {
+ case PUNIT:
+ *index = CRI_IDX_TELEM_PUNIT;
+ if (cap_type == WATCHER)
+ *offset = CRI_PUNIT_WATCHER_OFFSET;
+ break;
+
+ case OOBMSM_0:
+ *index = CRI_IDX_TELEM_OOBMSM;
+ switch (instance) {
+ case 0:
+ if (cap_type == WATCHER) {
+ *index = CRI_IDX_WATCHER_OOBMSM;
+ *offset = CRI_OOBMSM_WATCHER_OFFSET;
+ }
+ break;
+
+ case 1:
+ if (cap_type == TELEMETRY)
+ *offset = CRI_OOBMSM_GFSP_TELEMETRY_OFFSET;
+ break;
+
+ default:
+ return -EINVAL;
+ }
+ break;
+
+ default:
+ return -EINVAL;
+ }
+
+ return 0;
+}
+
+static int xe_guid_decode(u32 guid, int *index, u32 *offset)
+{
+ u32 cap_type = FIELD_GET(GUID_CAP_TYPE, guid);
+ u32 device_id = FIELD_GET(GUID_DEVICE_ID, guid);
+
+ if (cap_type > WATCHER)
+ return -EINVAL;
+
+ if (device_id == BMG_DEVICE_ID)
+ return bmg_guid_decode(guid, index, offset);
+
+ if (device_id == CRI_DEVICE_ID)
+ return cri_guid_decode(guid, index, offset);
+
+ return -ENODEV;
+}
+
/**
* xe_pmt_telem_read - Given a device and a PMT GUID, read data into a buffer
* @dev: valid Xe device
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 12/17] drm/xe/vsec: Crescent Island PMT callbacks
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (10 preceding siblings ...)
2026-11-16 15:07 ` [PATCH v16 11/17] drm/xe/vsec: Crescent Island PMT decode Michael J. Ruhl
@ 2026-11-16 15:07 ` Michael J. Ruhl
2026-11-16 15:07 ` [PATCH v16 13/17] drm/xe/vsec: Support late bind fw information Michael J. Ruhl
` (4 subsequent siblings)
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:07 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
CRI PMT support requires callbacks to access the discovery status and
control areas. Access is a common MMIO area that requires an index to
be set before access is allowed.
Introduce the necessary callbacks to get the status and control
information for CRI PMT usage.
Add the glue logic to register the CRI PMT functionality.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_vsec.c | 114 +++++++++++++++++++++++++++++++++--
1 file changed, 110 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index a814d7151eea..4ca41a5ef502 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -344,10 +344,15 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
}
scoped_guard(mutex, &xe->pmt.lock) {
+ u32 device_id = FIELD_GET(GUID_DEVICE_ID, guid);
+
/* set SoC re-mapper index register based on GUID memory region */
xe->soc_remapper.set_telem_region(xe, mem_region);
memcpy_fromio(data, telem_addr, count);
+
+ if (device_id == CRI_DEVICE_ID)
+ xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
}
xe_pm_runtime_put(xe);
@@ -358,20 +363,114 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
return ret == 0 ? count : ret;
}
-static struct pmt_callbacks xe_pmt_cb = {
+/**
+ * xe_pmt_read_reg() - read a crashlog register
+ * @dev: the xe device that registered the callback
+ * @guid: PMT guid of the crashlog instance
+ * @reg: data read from the PMT data structure
+ * @offset: which data to read from the PMT data structure
+ *
+ * Read the requested PMT register based on the pcie device and guid. The
+ * supported struct is the Crashlog Type1 Version2.
+ *
+ * Currently this is for CRI only.
+ *
+ * Return:
+ * * -ENODEV device is not available (hotplug)
+ * * -EINVAL invalid guid
+ * * 0 success
+ */
+static int xe_pmt_read_reg(struct device *dev, u32 guid, u32 *reg, u32 offset)
+{
+ struct xe_device *xe = kdev_to_xe_device(dev);
+ void __iomem *disc_addr = xe->mmio.regs + xe->pmt.base_offset;
+ int ret = 0;
+ u32 inst;
+ int idx;
+
+ if (FIELD_GET(GUID_DEVICE_ID, guid) != CRI_DEVICE_ID ||
+ FIELD_GET(GUID_CAP_TYPE, guid) != CRASHLOG)
+ return -EINVAL;
+
+ if (!drm_dev_enter(&xe->drm, &idx))
+ return -ENODEV;
+
+ inst = FIELD_GET(GUID_RECORD_ID, guid) == PUNIT ?
+ CRI_CRASHLOG_PUNIT_DISC_OFFSET : CRI_CRASHLOG_OOBMSM_DISC_OFFSET;
+ disc_addr += inst + offset;
+
+ xe_pm_runtime_get(xe);
+
+ scoped_guard(mutex, &xe->pmt.lock) {
+ xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
+
+ *reg = readl(disc_addr);
+ }
+
+ xe_pm_runtime_put(xe);
+
+ drm_dev_exit(idx);
+
+ return ret;
+}
+
+static int xe_pmt_write_reg(struct device *dev, u32 guid, u32 reg, u32 offset)
+{
+ struct xe_device *xe = kdev_to_xe_device(dev);
+ void __iomem *disc_addr = xe->mmio.regs + xe->pmt.base_offset;
+ int ret = 0;
+ u32 inst;
+ int idx;
+
+ if (FIELD_GET(GUID_DEVICE_ID, guid) != CRI_DEVICE_ID ||
+ FIELD_GET(GUID_CAP_TYPE, guid) != CRASHLOG)
+ return -EINVAL;
+
+ if (!drm_dev_enter(&xe->drm, &idx))
+ return -ENODEV;
+
+ inst = FIELD_GET(GUID_RECORD_ID, guid) == PUNIT ?
+ CRI_CRASHLOG_PUNIT_DISC_OFFSET : CRI_CRASHLOG_OOBMSM_DISC_OFFSET;
+ disc_addr += inst + offset;
+
+ xe_pm_runtime_get(xe);
+
+ scoped_guard(mutex, &xe->pmt.lock) {
+ xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
+
+ writel(reg, disc_addr);
+ }
+
+ xe_pm_runtime_put(xe);
+
+ drm_dev_exit(idx);
+
+ return ret;
+}
+
+static struct pmt_callbacks xe_bmg_pmt_cb = {
+ .read_telem = xe_pmt_telem_read,
+};
+
+static struct pmt_callbacks xe_cri_pmt_cb = {
.read_telem = xe_pmt_telem_read,
+ .read_reg = xe_pmt_read_reg,
+ .write_reg = xe_pmt_write_reg,
};
static const int vsec_platforms[] = {
[XE_BATTLEMAGE] = XE_VSEC_BMG,
+ [XE_CRESCENTISLAND] = XE_VSEC_CRI,
};
static enum xe_vsec get_platform_info(struct xe_device *xe)
{
- if (xe->info.platform > XE_BATTLEMAGE)
+ if (xe->info.platform > XE_CRESCENTISLAND)
return XE_VSEC_UNKNOWN;
- if (IS_SRIOV_VF(xe) && xe->info.platform == XE_BATTLEMAGE)
+ if (IS_SRIOV_VF(xe) &&
+ (xe->info.platform == XE_BATTLEMAGE ||
+ xe->info.platform == XE_CRESCENTISLAND))
return XE_VSEC_UNKNOWN;
return vsec_platforms[xe->info.platform];
@@ -399,8 +498,15 @@ void xe_vsec_init(struct xe_device *xe)
switch (platform) {
case XE_VSEC_BMG:
xe->pmt.base_offset = BMG_TELEMETRY_OFFSET;
- info->priv_data = &xe_pmt_cb;
+ info->priv_data = &xe_bmg_pmt_cb;
break;
+
+ case XE_VSEC_CRI:
+ xe->pmt.base_offset = CRI_PMT_OFFSET;
+ info->priv_data = &xe_cri_pmt_cb;
+ xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
+ break;
+
default:
break;
}
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 13/17] drm/xe/vsec: Support late bind fw information
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (11 preceding siblings ...)
2026-11-16 15:07 ` [PATCH v16 12/17] drm/xe/vsec: Crescent Island PMT callbacks Michael J. Ruhl
@ 2026-11-16 15:07 ` Michael J. Ruhl
2026-11-16 15:39 ` sashiko-bot
2026-11-16 15:07 ` [PATCH v16 14/17] drm/xe/vsec: Add PMT GUID internal access Michael J. Ruhl
` (3 subsequent siblings)
16 siblings, 1 reply; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:07 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
CRI FW is loaded on power on. Because of this, access to the FW cannot
be done until it is running.
Update the XE PMT probe and access to check for late bind devices,
verify, and wait for the appropriate FW state before probe or access.
Reviewed-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_device.c | 3 +
drivers/gpu/drm/xe/xe_device_types.h | 5 ++
drivers/gpu/drm/xe/xe_vsec.c | 126 ++++++++++++++++++++++++++-
drivers/gpu/drm/xe/xe_vsec.h | 1 +
4 files changed, 134 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_device.c b/drivers/gpu/drm/xe/xe_device.c
index c3cd98244d4c..76e401ae5878 100644
--- a/drivers/gpu/drm/xe/xe_device.c
+++ b/drivers/gpu/drm/xe/xe_device.c
@@ -1111,6 +1111,7 @@ int xe_device_probe(struct xe_device *xe)
return 0;
err_unregister_display:
+ xe_vsec_remove(xe);
xe_display_unregister(xe);
drm_dev_unregister(&xe->drm);
@@ -1119,6 +1120,8 @@ int xe_device_probe(struct xe_device *xe)
void xe_device_remove(struct xe_device *xe)
{
+ xe_vsec_remove(xe);
+
xe_display_unregister(xe);
drm_dev_unplug(&xe->drm);
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index 28b1669a14d8..d1bdd3a872a8 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -7,6 +7,7 @@
#define _XE_DEVICE_TYPES_H_
#include <linux/pci.h>
+#include <linux/workqueue.h>
#include <drm/drm_device.h>
#include <drm/drm_file.h>
@@ -487,6 +488,10 @@ struct xe_device {
struct mutex lock;
/** @pmt.base_offset: device specific base offset */
u64 base_offset;
+ /** @pmt.work: support late-bind probe */
+ struct delayed_work work;
+ /** @pmt.retry_count: late-bind probe retry */
+ u32 retry_count;
} pmt;
/** @soc_remapper: SoC remapper object */
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index 4ca41a5ef502..fe3d8338cfc9 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -3,6 +3,7 @@
#include <linux/bitfield.h>
#include <linux/bits.h>
#include <linux/cleanup.h>
+#include <linux/delay.h>
#include <linux/errno.h>
#include <linux/intel_vsec.h>
#include <linux/module.h>
@@ -18,6 +19,7 @@
#include "xe_mmio.h"
#include "xe_platform_types.h"
#include "xe_pm.h"
+#include "xe_sysctrl.h"
#include "xe_vsec.h"
#include "regs/xe_pmt.h"
@@ -173,6 +175,14 @@ enum capability {
WATCHER,
};
+/*
+ * Late bind will delay 100msec for up to 20 seconds
+ */
+#define VSEC_LATE_BIND_DELAY_MSEC 100
+#define VSEC_LATE_BIND_RETRY 200
+
+static void cri_late_bind_probe(struct xe_device *xe);
+
static int bmg_guid_decode(u32 guid, int *index, u32 *offset)
{
u32 record_id = FIELD_GET(GUID_RECORD_ID, guid);
@@ -281,6 +291,53 @@ static int xe_guid_decode(u32 guid, int *index, u32 *offset)
return -ENODEV;
}
+static void cri_late_bind_probe_work(struct work_struct *work)
+{
+ struct xe_device *xe = container_of(work, struct xe_device, pmt.work.work);
+
+ if (xe_sysctrl_is_oobmsm_fw_ready(xe)) {
+ cri_late_bind_probe(xe);
+ xe_pm_runtime_put(xe);
+ return;
+ }
+
+ xe->pmt.retry_count++;
+
+ /* wait up to 20 seconds */
+ if (xe->pmt.retry_count == VSEC_LATE_BIND_RETRY) {
+ drm_warn(&xe->drm, "PMT probe: Late Binding failed to complete\n");
+ xe_pm_runtime_put(xe);
+ return;
+ }
+
+ if (!queue_delayed_work(system_freezable_wq, &xe->pmt.work,
+ msecs_to_jiffies(VSEC_LATE_BIND_DELAY_MSEC)))
+ xe_pm_runtime_put(xe);
+}
+
+static bool wait_for_fw(struct xe_device *xe)
+{
+ int retries = VSEC_LATE_BIND_RETRY; /* wait up to 20 secs */
+
+ if (xe->info.platform != XE_CRESCENTISLAND)
+ return true;
+
+ while (retries--) {
+ if (xe_sysctrl_is_oobmsm_fw_ready(xe))
+ return true;
+
+ msleep(VSEC_LATE_BIND_DELAY_MSEC);
+ if (signal_pending(current)) {
+ drm_warn(&xe->drm, "Late Binding interrupted\n");
+ return false;
+ }
+ }
+
+ drm_warn(&xe->drm, "Late Binding failed to complete\n");
+
+ return false;
+}
+
/**
* xe_pmt_telem_read - Given a device and a PMT GUID, read data into a buffer
* @dev: valid Xe device
@@ -343,6 +400,11 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
goto dev_exit;
}
+ if (!wait_for_fw(xe)) {
+ ret = -ENODATA;
+ goto runtime_exit;
+ }
+
scoped_guard(mutex, &xe->pmt.lock) {
u32 device_id = FIELD_GET(GUID_DEVICE_ID, guid);
@@ -355,6 +417,7 @@ int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offse
xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
}
+runtime_exit:
xe_pm_runtime_put(xe);
dev_exit:
@@ -400,6 +463,10 @@ static int xe_pmt_read_reg(struct device *dev, u32 guid, u32 *reg, u32 offset)
disc_addr += inst + offset;
xe_pm_runtime_get(xe);
+ if (!wait_for_fw(xe)) {
+ ret = -ENODATA;
+ goto runtime_exit;
+ }
scoped_guard(mutex, &xe->pmt.lock) {
xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
@@ -407,6 +474,7 @@ static int xe_pmt_read_reg(struct device *dev, u32 guid, u32 *reg, u32 offset)
*reg = readl(disc_addr);
}
+runtime_exit:
xe_pm_runtime_put(xe);
drm_dev_exit(idx);
@@ -434,6 +502,10 @@ static int xe_pmt_write_reg(struct device *dev, u32 guid, u32 reg, u32 offset)
disc_addr += inst + offset;
xe_pm_runtime_get(xe);
+ if (!wait_for_fw(xe)) {
+ ret = -ENODATA;
+ goto runtime_exit;
+ }
scoped_guard(mutex, &xe->pmt.lock) {
xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
@@ -441,6 +513,7 @@ static int xe_pmt_write_reg(struct device *dev, u32 guid, u32 reg, u32 offset)
writel(reg, disc_addr);
}
+runtime_exit:
xe_pm_runtime_put(xe);
drm_dev_exit(idx);
@@ -476,6 +549,28 @@ static enum xe_vsec get_platform_info(struct xe_device *xe)
return vsec_platforms[xe->info.platform];
}
+static void cri_late_bind_probe(struct xe_device *xe)
+{
+ struct intel_vsec_platform_info *info;
+ struct device *dev = xe->drm.dev;
+ enum xe_vsec platform;
+
+ platform = get_platform_info(xe);
+ if (platform != XE_VSEC_CRI)
+ return;
+
+ info = &xe_vsec_info[platform];
+ if (!info->headers)
+ return;
+
+ guard(mutex)(&xe->pmt.lock);
+
+ info->priv_data = &xe_cri_pmt_cb;
+ xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
+
+ intel_vsec_register(dev, info);
+}
+
/**
* xe_vsec_init - Initialize resources and add intel_vsec auxiliary
* interface
@@ -503,12 +598,24 @@ void xe_vsec_init(struct xe_device *xe)
case XE_VSEC_CRI:
xe->pmt.base_offset = CRI_PMT_OFFSET;
+
+ xe->pmt.retry_count = 0;
+ INIT_DELAYED_WORK(&xe->pmt.work, cri_late_bind_probe_work);
+
+ xe_pm_runtime_get_noresume(xe);
+ if (!xe_sysctrl_is_oobmsm_fw_ready(xe)) {
+ queue_delayed_work(system_freezable_wq, &xe->pmt.work,
+ msecs_to_jiffies(VSEC_LATE_BIND_DELAY_MSEC));
+ return;
+ }
+
info->priv_data = &xe_cri_pmt_cb;
xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
break;
default:
- break;
+ drm_err(&xe->drm, "Unsupported platform: %u\n", platform);
+ return;
}
/*
@@ -516,5 +623,22 @@ void xe_vsec_init(struct xe_device *xe)
* resources.
*/
intel_vsec_register(dev, info);
+
+ if (platform == XE_VSEC_CRI)
+ xe_pm_runtime_put(xe);
+}
+
+/**
+ * xe_vsec_remove - cleanup any outstanding resources
+ * @xe: valid xe instance
+ */
+void xe_vsec_remove(struct xe_device *xe)
+{
+ /* Cleanup on Crescent Isle */
+ if (xe->info.platform == XE_CRESCENTISLAND &&
+ xe->pmt.base_offset == CRI_PMT_OFFSET &&
+ disable_delayed_work_sync(&xe->pmt.work))
+ xe_pm_runtime_put(xe);
+
}
MODULE_IMPORT_NS("INTEL_VSEC");
diff --git a/drivers/gpu/drm/xe/xe_vsec.h b/drivers/gpu/drm/xe/xe_vsec.h
index a25b4e6e681b..e925dba4158b 100644
--- a/drivers/gpu/drm/xe/xe_vsec.h
+++ b/drivers/gpu/drm/xe/xe_vsec.h
@@ -10,6 +10,7 @@ struct device;
struct xe_device;
void xe_vsec_init(struct xe_device *xe);
+void xe_vsec_remove(struct xe_device *xe);
int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offset, u32 count);
#endif
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH v16 13/17] drm/xe/vsec: Support late bind fw information
2026-11-16 15:07 ` [PATCH v16 13/17] drm/xe/vsec: Support late bind fw information Michael J. Ruhl
@ 2026-11-16 15:39 ` sashiko-bot
0 siblings, 0 replies; 20+ messages in thread
From: sashiko-bot @ 2026-11-16 15:39 UTC (permalink / raw)
To: Michael J. Ruhl, intel-xe
Thank you for your contribution! Sashiko AI review found 2 potential
issues to consider:
- [Medium] drm/xe/vsec: lock inversion holding pmt.lock in
cri_late_bind_probe()
- [Medium] drm/xe/vsec: missing pmt.lock during CRI discovery in
xe_vsec_init()
--
commit 32874c6df8ff2b93eb16e544520f64211460d328
Author: Michael J. Ruhl <michael.j.ruhl@intel.com>
drm/xe/vsec: Support late bind fw information
This commit adds delayed-work polling and synchronous readiness waits so
Crescent Island PMT registration and telemetry or crashlog accesses wait
for the OOBMSM firmware to finish initializing.
> diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
> index 4ca41a5ef5027..fe3d8338cfc98 100644
> --- a/drivers/gpu/drm/xe/xe_vsec.c
> +++ b/drivers/gpu/drm/xe/xe_vsec.c
[ ... ]
> @@ -476,6 +549,28 @@ static enum xe_vsec get_platform_info(struct xe_device *xe)
> return vsec_platforms[xe->info.platform];
> }
>
> +static void cri_late_bind_probe(struct xe_device *xe)
> +{
> + struct intel_vsec_platform_info *info;
> + struct device *dev = xe->drm.dev;
> + enum xe_vsec platform;
> +
> + platform = get_platform_info(xe);
> + if (platform != XE_VSEC_CRI)
> + return;
> +
> + info = &xe_vsec_info[platform];
> + if (!info->headers)
> + return;
> +
> + guard(mutex)(&xe->pmt.lock);
> +
> + info->priv_data = &xe_cri_pmt_cb;
> + xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
> +
> + intel_vsec_register(dev, info);
> +}
[Severity: Medium]
Does holding xe->pmt.lock across intel_vsec_register() introduce a circular
locking dependency and potential ABBA deadlock with PMT sysfs attributes?
intel_vsec_register() adds the auxiliary device under device_lock(&auxdev->dev)
and synchronously runs pmt_telem_probe(), which acquires ep_lock and creates
sysfs attributes for each discovery entry. Reading those attributes enters
intel_pmt_read() -> xe_pmt_telem_read() under the kernfs active reference
(kn->dep_map) and takes xe->pmt.lock, while unbinding or rolling back on a
later entry's probe failure drains kn->dep_map under &auxdev->dev.mutex and
ep_lock:
CPU0 CPU1
---- ----
lock(&xe->pmt.lock)
lock(&auxdev->dev.mutex)
lock(&ep_lock)
lock(kn->dep_map)
lock(&xe->pmt.lock)
lock(kn->dep_map)
*** DEADLOCK ***
CPU0: cri_late_bind_probe() -> intel_vsec_register() -> ... ->
pmt_telem_probe() -> pmt_telem_remove() -> sysfs_remove_bin_file()
CPU1: kernfs_fop_read_iter() -> intel_pmt_read() -> xe_pmt_telem_read()
>
> /**
> * xe_vsec_init - Initialize resources and add intel_vsec auxiliary
> * interface
> @@ -503,12 +598,24 @@ void xe_vsec_init(struct xe_device *xe)
>
> case XE_VSEC_CRI:
> xe->pmt.base_offset = CRI_PMT_OFFSET;
> +
> + xe->pmt.retry_count = 0;
> + INIT_DELAYED_WORK(&xe->pmt.work, cri_late_bind_probe_work);
> +
> + xe_pm_runtime_get_noresume(xe);
> + if (!xe_sysctrl_is_oobmsm_fw_ready(xe)) {
> + queue_delayed_work(system_freezable_wq, &xe->pmt.work,
> + msecs_to_jiffies(VSEC_LATE_BIND_DELAY_MSEC));
> + return;
> + }
> +
> info->priv_data = &xe_cri_pmt_cb;
> xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
> break;
>
> default:
> - break;
> + drm_err(&xe->drm, "Unsupported platform: %u\n", platform);
> + return;
> }
>
> /*
> @@ -516,5 +623,22 @@ void xe_vsec_init(struct xe_device *xe)
> * resources.
> */
> intel_vsec_register(dev, info);
[Severity: Medium]
Can a concurrent telemetry read corrupt the SoC remapper index while
intel_vsec_register() is still reading Crescent Island discovery headers?
When OOBMSM firmware is already ready in xe_vsec_init(), CRI_IDX_TELEM_DISCOVERY
is programmed and intel_vsec_register() is called without serialization
against xe_pmt_telem_read(). Because intel_vsec_register() registers three
cri_telemetry entries followed by two cri_crashlog entries, a reader can
open the first telemetry sysfs file as soon as entry 0 is created and
switch the remapper index away from CRI_IDX_TELEM_DISCOVERY while the
remaining headers are still being read from CRI_PMT_OFFSET:
CPU0 CPU1
xe_vsec_init()
set_telem_region(...,
CRI_IDX_TELEM_DISCOVERY)
intel_vsec_register()
pmt_telem_probe()
intel_pmt_dev_create(entry 0)
xe_pmt_telem_read()
lock(&xe->pmt.lock)
set_telem_region(..., mem_region)
intel_pmt_dev_create(entry 1)
pmt_get_headers()
readl(disc_vaddr) <-- reads wrong remapper region
memcpy_fromio(...)
set_telem_region(...,
CRI_IDX_TELEM_DISCOVERY)
unlock(&xe->pmt.lock)
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116150649.368686-19-michael.j.ruhl@intel.com?part=13
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH v16 14/17] drm/xe/vsec: Add PMT GUID internal access
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (12 preceding siblings ...)
2026-11-16 15:07 ` [PATCH v16 13/17] drm/xe/vsec: Support late bind fw information Michael J. Ruhl
@ 2026-11-16 15:07 ` Michael J. Ruhl
2026-11-16 15:31 ` sashiko-bot
2026-11-16 15:07 ` [PATCH v16 15/17] drm/xe/vsec: Update PMT " Michael J. Ruhl
` (2 subsequent siblings)
16 siblings, 1 reply; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:07 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
Xe accesses the PMT infrastructure directly. The current usage is
supported ONLY by BMG devices.
CRI has further requirements for access.
Add the platform id to the GUID register define and use that for the
register access.
Add an API to allow access the GUID based on the platform.
Reviewed-by: Karthik Poosa <karthik.poosa@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/regs/xe_pmt.h | 4 +-
drivers/gpu/drm/xe/xe_debugfs.c | 2 +-
drivers/gpu/drm/xe/xe_device_types.h | 2 +
drivers/gpu/drm/xe/xe_hwmon.c | 2 +-
drivers/gpu/drm/xe/xe_pcode.c | 2 +-
drivers/gpu/drm/xe/xe_vsec.c | 55 ++++++++++++++++++++++++++++
drivers/gpu/drm/xe/xe_vsec.h | 1 +
7 files changed, 64 insertions(+), 4 deletions(-)
diff --git a/drivers/gpu/drm/xe/regs/xe_pmt.h b/drivers/gpu/drm/xe/regs/xe_pmt.h
index 2f6658395587..fb5b5a8648ba 100644
--- a/drivers/gpu/drm/xe/regs/xe_pmt.h
+++ b/drivers/gpu/drm/xe/regs/xe_pmt.h
@@ -10,7 +10,7 @@
#define BMG_PMT_BASE_OFFSET 0xDB000
#define BMG_DISCOVERY_OFFSET (SOC_BASE + BMG_PMT_BASE_OFFSET)
-#define PUNIT_TELEMETRY_GUID XE_REG(BMG_DISCOVERY_OFFSET + 0x4)
+#define BMG_PUNIT_TELEMETRY_GUID XE_REG(BMG_DISCOVERY_OFFSET + 0x4)
#define BMG_ENERGY_STATUS_PMT_OFFSET (0x30)
#define ENERGY_PKG REG_GENMASK64(31, 0)
#define ENERGY_CARD REG_GENMASK64(63, 32)
@@ -24,6 +24,8 @@
/* for CRI discovery and telemetry are in an indexed window */
#define CRI_PMT_OFFSET (SOC_BASE + XE_PMT_BASE_OFFSET)
+#define CRI_PUNIT_TELEMETRY_GUID XE_REG(CRI_PMT_OFFSET + 0x4)
+
#define BMG_MODS_RESIDENCY_OFFSET (0x4D0)
#define BMG_G2_RESIDENCY_OFFSET (0x530)
#define BMG_G6_RESIDENCY_OFFSET (0x538)
diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
index e59d4964d811..8a470fe967d5 100644
--- a/drivers/gpu/drm/xe/xe_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_debugfs.c
@@ -154,7 +154,7 @@ static void read_residency_counter(struct xe_device *xe, struct xe_mmio *mmio,
int ret;
ret = xe_pmt_telem_read(xe->drm.dev,
- xe_mmio_read32(mmio, PUNIT_TELEMETRY_GUID),
+ xe_mmio_read32(mmio, BMG_PUNIT_TELEMETRY_GUID),
&residency, offset, sizeof(residency));
if (ret != sizeof(residency)) {
drm_warn(&xe->drm, "%s counter failed to read, ret %d\n", name, ret);
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index d1bdd3a872a8..be6feaff4baa 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -492,6 +492,8 @@ struct xe_device {
struct delayed_work work;
/** @pmt.retry_count: late-bind probe retry */
u32 retry_count;
+ /** @pmt.punit_guid_cache: cache of the PUNIT GUID */
+ u32 punit_guid_cache;
} pmt;
/** @soc_remapper: SoC remapper object */
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index defe8aaca7c1..d9636eca0133 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -605,7 +605,7 @@ xe_hwmon_energy_get(struct xe_hwmon *hwmon, int channel, long *energy)
u64 pmt_val;
ret = xe_pmt_telem_read(hwmon->xe->drm.dev,
- xe_mmio_read32(mmio, PUNIT_TELEMETRY_GUID),
+ xe_mmio_read32(mmio, BMG_PUNIT_TELEMETRY_GUID),
&pmt_val, BMG_ENERGY_STATUS_PMT_OFFSET, sizeof(pmt_val));
if (ret != sizeof(pmt_val)) {
drm_warn(&hwmon->xe->drm, "energy read from pmt failed, ret %d\n", ret);
diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
index 266deecbb100..8c901e54f384 100644
--- a/drivers/gpu/drm/xe/xe_pcode.c
+++ b/drivers/gpu/drm/xe/xe_pcode.c
@@ -369,7 +369,7 @@ int xe_get_pcode_version(struct xe_device *xe, struct xe_pcode_version *version)
guard(xe_pm_runtime)(xe);
ret = xe_pmt_telem_read(xe->drm.dev,
- xe_mmio_read32(xe_root_tile_mmio(xe), PUNIT_TELEMETRY_GUID),
+ xe_mmio_read32(xe_root_tile_mmio(xe), BMG_PUNIT_TELEMETRY_GUID),
(u64 *)version, PUNIT_VERSION_OFFSET, sizeof(*version));
if (ret != sizeof(*version)) {
xe_warn(xe, "pcode version read from PMT failed, ret %pe\n", ERR_PTR(ret));
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index fe3d8338cfc9..7695bd6b6bc8 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -571,6 +571,61 @@ static void cri_late_bind_probe(struct xe_device *xe)
intel_vsec_register(dev, info);
}
+/**
+ * xe_vsec_get_guid - Get and cache the PUNIT guid value
+ * @xe: valid xe device
+ * @guid: returned guid
+ *
+ * Return:
+ * * -ENODATA device is not active
+ * * -EINVAL unsupported platform
+ * * 0 success
+ */
+int xe_vsec_get_guid(struct xe_device *xe, u32 *guid)
+{
+ struct xe_mmio *mmio = xe_root_tile_mmio(xe);
+ int ret = 0;
+
+ xe_assert(xe, !IS_SRIOV_VF(xe));
+
+ if (!xe_pm_runtime_get_if_active(xe))
+ return -ENODATA;
+
+ mutex_lock(&xe->pmt.lock);
+
+ if (xe->pmt.punit_guid_cache) {
+ *guid = xe->pmt.punit_guid_cache;
+ goto unlock;
+ }
+
+ switch (xe->info.platform) {
+ case XE_BATTLEMAGE:
+ *guid = xe_mmio_read32(mmio, BMG_PUNIT_TELEMETRY_GUID);
+ break;
+
+ case XE_CRESCENTISLAND:
+ xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
+ *guid = xe_mmio_read32(mmio, CRI_PUNIT_TELEMETRY_GUID);
+ break;
+
+ default:
+ *guid = 0;
+ drm_err(&xe->drm, "Unsupported platform: %u\n", xe->info.platform);
+ ret = -EINVAL;
+ break;
+ }
+
+ /* the GUID is static, read once and cache for all requests */
+ if (*guid)
+ xe->pmt.punit_guid_cache = *guid;
+
+unlock:
+ mutex_unlock(&xe->pmt.lock);
+ xe_pm_runtime_put(xe);
+
+ return ret;
+}
+
/**
* xe_vsec_init - Initialize resources and add intel_vsec auxiliary
* interface
diff --git a/drivers/gpu/drm/xe/xe_vsec.h b/drivers/gpu/drm/xe/xe_vsec.h
index e925dba4158b..88e6f6a9e4dd 100644
--- a/drivers/gpu/drm/xe/xe_vsec.h
+++ b/drivers/gpu/drm/xe/xe_vsec.h
@@ -11,6 +11,7 @@ struct xe_device;
void xe_vsec_init(struct xe_device *xe);
void xe_vsec_remove(struct xe_device *xe);
+int xe_vsec_get_guid(struct xe_device *xe, u32 *guid);
int xe_pmt_telem_read(struct device *dev, u32 guid, u64 *data, loff_t user_offset, u32 count);
#endif
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* Re: [PATCH v16 14/17] drm/xe/vsec: Add PMT GUID internal access
2026-11-16 15:07 ` [PATCH v16 14/17] drm/xe/vsec: Add PMT GUID internal access Michael J. Ruhl
@ 2026-11-16 15:31 ` sashiko-bot
0 siblings, 0 replies; 20+ messages in thread
From: sashiko-bot @ 2026-11-16 15:31 UTC (permalink / raw)
To: Michael J. Ruhl, intel-xe
Thank you for your contribution! Sashiko AI review found 1 potential
issue to consider:
- [Medium] drm/xe/vsec: missing wait_for_fw() and invalid GUID handling
in xe_vsec_get_guid()
--
commit 632d26eff21d3d09eabbe9a46ad322beb8f8346c
Author: Michael J. Ruhl <michael.j.ruhl@intel.com>
drm/xe/vsec: Add PMT GUID internal access
This commit renames theBattlemage telemetry guid macro to include the
platform prefix, defines the Crescent Island telemetry guid register, and
adds xe_vsec_get_guid() to read and cache the punit guid per platform.
> diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
> index fe3d8338cfc98..7695bd6b6bc87 100644
> --- a/drivers/gpu/drm/xe/xe_vsec.c
> +++ b/drivers/gpu/drm/xe/xe_vsec.c
> @@ -571,6 +571,61 @@ static void cri_late_bind_probe(struct xe_device *xe)
> intel_vsec_register(dev, info);
> }
>
> +/**
> + * xe_vsec_get_guid - Get and cache the PUNIT guid value
> + * @xe: valid xe device
> + * @guid: returned guid
> + *
> + * Return:
> + * * -ENODATA device is not active
> + * * -EINVAL unsupported platform
> + * * 0 success
> + */
> +int xe_vsec_get_guid(struct xe_device *xe, u32 *guid)
> +{
> + struct xe_mmio *mmio = xe_root_tile_mmio(xe);
> + int ret = 0;
> +
> + xe_assert(xe, !IS_SRIOV_VF(xe));
> +
> + if (!xe_pm_runtime_get_if_active(xe))
> + return -ENODATA;
> +
> + mutex_lock(&xe->pmt.lock);
> +
> + if (xe->pmt.punit_guid_cache) {
> + *guid = xe->pmt.punit_guid_cache;
> + goto unlock;
> + }
> +
> + switch (xe->info.platform) {
> + case XE_BATTLEMAGE:
> + *guid = xe_mmio_read32(mmio, BMG_PUNIT_TELEMETRY_GUID);
> + break;
> +
> + case XE_CRESCENTISLAND:
> + xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
> + *guid = xe_mmio_read32(mmio, CRI_PUNIT_TELEMETRY_GUID);
> + break;
> +
> + default:
> + *guid = 0;
> + drm_err(&xe->drm, "Unsupported platform: %u\n", xe->info.platform);
> + ret = -EINVAL;
> + break;
> + }
> +
> + /* the GUID is static, read once and cache for all requests */
> + if (*guid)
> + xe->pmt.punit_guid_cache = *guid;
> +
> +unlock:
> + mutex_unlock(&xe->pmt.lock);
> + xe_pm_runtime_put(xe);
> +
> + return ret;
> +}
[Severity: Medium]
Does xe_vsec_get_guid() need to call wait_for_fw(xe) before reading the
discovery table on Crescent Island?
As introduced in commit "drm/xe/vsec: Support late bind fw information",
the discovery window on Crescent Island is populated asynchronously on
power-on by late-bound firmware, so xe_pmt_telem_read(), xe_pmt_read_reg()
and xe_pmt_write_reg() all check wait_for_fw(xe) before taking xe->pmt.lock
and accessing the discovery or telemetry regions. During probe and the
late-bind polling window, xe_pm_runtime_get_if_active() succeeds while the
firmware is not yet ready, so xe_vsec_get_guid() reads an uninitialized
discovery window.
Also, if the register read returns 0, xe_vsec_get_guid() skips caching it
but still returns 0 (success) with *guid set to 0, whereas if an
uninitialized or failed read returns a non-zero bogus value such as
0xffffffff, xe->pmt.punit_guid_cache caches it for the lifetime of the
device and causes all subsequent telemetry reads to fail in
xe_guid_decode().
--
Sashiko AI review · https://sashiko.dev/#/patchset/20261116150649.368686-19-michael.j.ruhl@intel.com?part=14
^ permalink raw reply [flat|nested] 20+ messages in thread
* [PATCH v16 15/17] drm/xe/vsec: Update PMT internal access
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (13 preceding siblings ...)
2026-11-16 15:07 ` [PATCH v16 14/17] drm/xe/vsec: Add PMT GUID internal access Michael J. Ruhl
@ 2026-11-16 15:07 ` Michael J. Ruhl
2026-11-16 15:07 ` [PATCH v16 16/17] drm/xe/vsec: Refactor platform check Michael J. Ruhl
2026-11-16 15:07 ` [PATCH v16 17/17] drm/xe/vsec: Support survivability mode for CRI Michael J. Ruhl
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:07 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
Current PMT internal access assumes BMG devices.
Use the new PMT GUID API to read the device specific guid.
Minor cleanup for a newly unused parameter (mmio).
Reviewed-by: Karthik Poosa <karthik.poosa@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_debugfs.c | 26 ++++++++++++++------------
drivers/gpu/drm/xe/xe_hwmon.c | 10 ++++++++--
drivers/gpu/drm/xe/xe_pcode.c | 10 ++++++++--
3 files changed, 30 insertions(+), 16 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
index 8a470fe967d5..b56e4aad4069 100644
--- a/drivers/gpu/drm/xe/xe_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_debugfs.c
@@ -5,6 +5,7 @@
#include "xe_debugfs.h"
+#include <linux/array_size.h>
#include <linux/bits.h>
#include <linux/debugfs.h>
#include <linux/fault-inject.h>
@@ -19,7 +20,6 @@
#include "xe_gt.h"
#include "xe_gt_debugfs.h"
#include "xe_hw_engine.h"
-#include "xe_mmio.h"
#include "xe_pagefault.h"
#include "xe_pcode.h"
#include "xe_pm.h"
@@ -147,15 +147,20 @@ static void xe_fault_inject_debugfs_register(struct xe_device *xe,
}
}
-static void read_residency_counter(struct xe_device *xe, struct xe_mmio *mmio,
- u32 offset, const char *name, struct drm_printer *p)
+static void read_residency_counter(struct xe_device *xe, u32 offset, const char *name,
+ struct drm_printer *p)
{
u64 residency = 0;
+ u32 guid;
int ret;
- ret = xe_pmt_telem_read(xe->drm.dev,
- xe_mmio_read32(mmio, BMG_PUNIT_TELEMETRY_GUID),
- &residency, offset, sizeof(residency));
+ ret = xe_vsec_get_guid(xe, &guid);
+ if (ret) {
+ drm_warn(&xe->drm, "PMT device is not available: %d\n", ret);
+ return;
+ }
+
+ ret = xe_pmt_telem_read(xe->drm.dev, guid, &residency, offset, sizeof(residency));
if (ret != sizeof(residency)) {
drm_warn(&xe->drm, "%s counter failed to read, ret %d\n", name, ret);
return;
@@ -294,13 +299,12 @@ static int pcode_info(struct seq_file *m, void *data)
static int dgfx_pkg_residencies_show(struct seq_file *m, void *data)
{
struct xe_device *xe;
- struct xe_mmio *mmio;
struct drm_printer p;
xe = node_to_xe(m->private);
p = drm_seq_file_printer(m);
guard(xe_pm_runtime)(xe);
- mmio = xe_root_tile_mmio(xe);
+
static const struct {
u32 offset;
const char *name;
@@ -314,7 +318,7 @@ static int dgfx_pkg_residencies_show(struct seq_file *m, void *data)
};
for (int i = 0; i < ARRAY_SIZE(residencies); i++)
- read_residency_counter(xe, mmio, residencies[i].offset, residencies[i].name, &p);
+ read_residency_counter(xe, residencies[i].offset, residencies[i].name, &p);
return 0;
}
@@ -322,13 +326,11 @@ static int dgfx_pkg_residencies_show(struct seq_file *m, void *data)
static int dgfx_pcie_link_residencies_show(struct seq_file *m, void *data)
{
struct xe_device *xe;
- struct xe_mmio *mmio;
struct drm_printer p;
xe = node_to_xe(m->private);
p = drm_seq_file_printer(m);
guard(xe_pm_runtime)(xe);
- mmio = xe_root_tile_mmio(xe);
static const struct {
u32 offset;
@@ -340,7 +342,7 @@ static int dgfx_pcie_link_residencies_show(struct seq_file *m, void *data)
};
for (int i = 0; i < ARRAY_SIZE(residencies); i++)
- read_residency_counter(xe, mmio, residencies[i].offset, residencies[i].name, &p);
+ read_residency_counter(xe, residencies[i].offset, residencies[i].name, &p);
return 0;
}
diff --git a/drivers/gpu/drm/xe/xe_hwmon.c b/drivers/gpu/drm/xe/xe_hwmon.c
index d9636eca0133..55e0f961df4c 100644
--- a/drivers/gpu/drm/xe/xe_hwmon.c
+++ b/drivers/gpu/drm/xe/xe_hwmon.c
@@ -603,9 +603,15 @@ xe_hwmon_energy_get(struct xe_hwmon *hwmon, int channel, long *energy)
if (hwmon->xe->info.platform == XE_BATTLEMAGE) {
u64 pmt_val;
+ u32 guid;
- ret = xe_pmt_telem_read(hwmon->xe->drm.dev,
- xe_mmio_read32(mmio, BMG_PUNIT_TELEMETRY_GUID),
+ ret = xe_vsec_get_guid(hwmon->xe, &guid);
+ if (ret) {
+ drm_warn(&hwmon->xe->drm, "PMT device is not available: %d\n", ret);
+ *energy = 0;
+ return ret;
+ }
+ ret = xe_pmt_telem_read(hwmon->xe->drm.dev, guid,
&pmt_val, BMG_ENERGY_STATUS_PMT_OFFSET, sizeof(pmt_val));
if (ret != sizeof(pmt_val)) {
drm_warn(&hwmon->xe->drm, "energy read from pmt failed, ret %d\n", ret);
diff --git a/drivers/gpu/drm/xe/xe_pcode.c b/drivers/gpu/drm/xe/xe_pcode.c
index 8c901e54f384..fa9f45d565cb 100644
--- a/drivers/gpu/drm/xe/xe_pcode.c
+++ b/drivers/gpu/drm/xe/xe_pcode.c
@@ -365,11 +365,17 @@ ALLOW_ERROR_INJECTION(xe_pcode_probe_early, ERRNO); /* See xe_pci_probe */
int xe_get_pcode_version(struct xe_device *xe, struct xe_pcode_version *version)
{
int ret = 0;
+ u32 guid;
guard(xe_pm_runtime)(xe);
- ret = xe_pmt_telem_read(xe->drm.dev,
- xe_mmio_read32(xe_root_tile_mmio(xe), BMG_PUNIT_TELEMETRY_GUID),
+ ret = xe_vsec_get_guid(xe, &guid);
+ if (ret) {
+ xe_warn(xe, "PMT device is not available: %d\n", ret);
+ return ret;
+ }
+
+ ret = xe_pmt_telem_read(xe->drm.dev, guid,
(u64 *)version, PUNIT_VERSION_OFFSET, sizeof(*version));
if (ret != sizeof(*version)) {
xe_warn(xe, "pcode version read from PMT failed, ret %pe\n", ERR_PTR(ret));
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 16/17] drm/xe/vsec: Refactor platform check
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (14 preceding siblings ...)
2026-11-16 15:07 ` [PATCH v16 15/17] drm/xe/vsec: Update PMT " Michael J. Ruhl
@ 2026-11-16 15:07 ` Michael J. Ruhl
2026-11-16 15:07 ` [PATCH v16 17/17] drm/xe/vsec: Support survivability mode for CRI Michael J. Ruhl
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:07 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
For debugfs, residencies and pcode_info are available on the BMG and
CRI (!SRIOV_VF) platforms.
Refactor to have one code path for adding the debugfs entries.
Reviewed-by: Karthik Poosa <karthik.poosa@intel.com>
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_debugfs.c | 19 +++++++++----------
1 file changed, 9 insertions(+), 10 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_debugfs.c b/drivers/gpu/drm/xe/xe_debugfs.c
index b56e4aad4069..5a82f8eab2c6 100644
--- a/drivers/gpu/drm/xe/xe_debugfs.c
+++ b/drivers/gpu/drm/xe/xe_debugfs.c
@@ -702,23 +702,22 @@ void xe_debugfs_register(struct xe_device *xe)
ARRAY_SIZE(debugfs_list),
root, minor);
- if (xe->info.platform == XE_BATTLEMAGE && !IS_SRIOV_VF(xe)) {
- drm_debugfs_create_files(debugfs_residencies,
- ARRAY_SIZE(debugfs_residencies),
- root, minor);
- }
-
/*
- * Pcode version read from PMT is currently only supported on CRI and BMG platforms in PF
- * mode, as both platforms support the necessary telemetry read mechanism and have a fixed
- * PUNIT_VERSION_OFFSET.
+ * Residencies and Pcode version read from PMT is currently only supported on CRI and BMG
+ * platforms in PF mode. Both platforms support the necessary telemetry read mechanism
+ * and have a fixed offsets for the required data.
* Attempting this access on other platforms must be verified before enabling support.
*/
if (!IS_SRIOV_VF(xe) &&
- (xe->info.platform == XE_CRESCENTISLAND || xe->info.platform == XE_BATTLEMAGE))
+ (xe->info.platform == XE_CRESCENTISLAND || xe->info.platform == XE_BATTLEMAGE)) {
+ drm_debugfs_create_files(debugfs_residencies,
+ ARRAY_SIZE(debugfs_residencies),
+ root, minor);
+
drm_debugfs_create_files(pcode_info_debugfs,
ARRAY_SIZE(pcode_info_debugfs),
root, minor);
+ }
debugfs_create_file("forcewake_all", 0400, root, xe,
&forcewake_all_fops);
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread* [PATCH v16 17/17] drm/xe/vsec: Support survivability mode for CRI
2026-11-16 15:06 [PATCH v16 00/17] Crescent Island PMT support Michael J. Ruhl
` (15 preceding siblings ...)
2026-11-16 15:07 ` [PATCH v16 16/17] drm/xe/vsec: Refactor platform check Michael J. Ruhl
@ 2026-11-16 15:07 ` Michael J. Ruhl
16 siblings, 0 replies; 20+ messages in thread
From: Michael J. Ruhl @ 2026-11-16 15:07 UTC (permalink / raw)
To: intel-xe, matthew.brost, rodrigo.vivi, thomas.hellstrom, airlied,
simona, david.e.box, anoop.c.vijay, badal.nilawar,
matthew.d.roper, james.ausmus
For survivability mode, CRI can only support access to the
PUNIT CRASHLOG PMT function.
Create a special config to support survivability mode.
Signed-off-by: Michael J. Ruhl <michael.j.ruhl@intel.com>
---
drivers/gpu/drm/xe/xe_device_types.h | 2 ++
drivers/gpu/drm/xe/xe_vsec.c | 34 +++++++++++++++++++++++++++-
2 files changed, 35 insertions(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/xe/xe_device_types.h b/drivers/gpu/drm/xe/xe_device_types.h
index be6feaff4baa..ae5426717eb4 100644
--- a/drivers/gpu/drm/xe/xe_device_types.h
+++ b/drivers/gpu/drm/xe/xe_device_types.h
@@ -494,6 +494,8 @@ struct xe_device {
u32 retry_count;
/** @pmt.punit_guid_cache: cache of the PUNIT GUID */
u32 punit_guid_cache;
+ /** @pmt.survivability_mode: cache of survivability mode state */
+ bool survivability_mode;
} pmt;
/** @soc_remapper: SoC remapper object */
diff --git a/drivers/gpu/drm/xe/xe_vsec.c b/drivers/gpu/drm/xe/xe_vsec.c
index 7695bd6b6bc8..8327b6a6b3df 100644
--- a/drivers/gpu/drm/xe/xe_vsec.c
+++ b/drivers/gpu/drm/xe/xe_vsec.c
@@ -19,6 +19,7 @@
#include "xe_mmio.h"
#include "xe_platform_types.h"
#include "xe_pm.h"
+#include "xe_survivability_mode.h"
#include "xe_sysctrl.h"
#include "xe_vsec.h"
@@ -101,10 +102,26 @@ static struct intel_vsec_header *cri_capabilities[] = {
NULL
};
+static struct intel_vsec_header cri_survivability_crashlog = {
+ .rev = 1,
+ .length = SZ_16,
+ .id = VSEC_ID_CRASHLOG,
+ .num_entries = 1,
+ .entry_size = 6,
+ .tbir = 0,
+ .offset = CRI_PMT_OFFSET + CRI_CRASHLOG_PUNIT_DISC_OFFSET,
+};
+
+static struct intel_vsec_header *cri_survivability_capabilities[] = {
+ &cri_survivability_crashlog,
+ NULL
+};
+
enum xe_vsec {
XE_VSEC_UNKNOWN = 0,
XE_VSEC_BMG,
XE_VSEC_CRI,
+ XE_VSEC_CRI_SURVIVABILITY,
};
static struct intel_vsec_platform_info xe_vsec_info[] = {
@@ -116,6 +133,10 @@ static struct intel_vsec_platform_info xe_vsec_info[] = {
.caps = VSEC_CAP_TELEMETRY | VSEC_CAP_CRASHLOG,
.headers = cri_capabilities,
},
+ [XE_VSEC_CRI_SURVIVABILITY] = {
+ .caps = VSEC_CAP_CRASHLOG,
+ .headers = cri_survivability_capabilities,
+ },
{ }
};
@@ -319,7 +340,7 @@ static bool wait_for_fw(struct xe_device *xe)
{
int retries = VSEC_LATE_BIND_RETRY; /* wait up to 20 secs */
- if (xe->info.platform != XE_CRESCENTISLAND)
+ if (xe->info.platform != XE_CRESCENTISLAND || xe->pmt.survivability_mode)
return true;
while (retries--) {
@@ -546,6 +567,10 @@ static enum xe_vsec get_platform_info(struct xe_device *xe)
xe->info.platform == XE_CRESCENTISLAND))
return XE_VSEC_UNKNOWN;
+ if (xe_survivability_mode_is_boot_enabled(xe) &&
+ xe->info.platform == XE_CRESCENTISLAND)
+ return XE_VSEC_CRI_SURVIVABILITY;
+
return vsec_platforms[xe->info.platform];
}
@@ -668,6 +693,13 @@ void xe_vsec_init(struct xe_device *xe)
xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
break;
+ case XE_VSEC_CRI_SURVIVABILITY:
+ xe->pmt.base_offset = CRI_PMT_OFFSET;
+ xe->pmt.survivability_mode = true;
+ info->priv_data = &xe_cri_pmt_cb;
+ xe->soc_remapper.set_telem_region(xe, CRI_IDX_TELEM_DISCOVERY);
+ break;
+
default:
drm_err(&xe->drm, "Unsupported platform: %u\n", platform);
return;
--
2.43.0
^ permalink raw reply related [flat|nested] 20+ messages in thread