* [PATCH v2 0/2] drm/xe/pagefault: Add SRCID to pagefault reporting
@ 2026-06-03 15:08 Jonathan Cavitt
2026-06-03 15:08 ` [PATCH v2 1/2] drm/xe/pagefault: Add SRCID to pagefault struct Jonathan Cavitt
2026-06-03 15:08 ` [PATCH v2 2/2] drm/xe/vm: Add srcid to xe_vm_get_property_ioctl fault report Jonathan Cavitt
0 siblings, 2 replies; 3+ messages in thread
From: Jonathan Cavitt @ 2026-06-03 15:08 UTC (permalink / raw)
To: dri-devel
Cc: saurabhg.gupta, alex.zuo, jonathan.cavitt, mripard, airlied,
simona, linux-kernel, intel-xe, Rodrigo.vivi, matthew.brost,
maarten.lankhorst, thomas.hellstrom, tzimmermann
Add SRCID to the xe_pagefault struct, which reports the ID of the
faulting hardware unit. This will be passed on to the
xe_vm_get_property_ioctl for reading per-vm faults and will assist in
diagnosing pagefaults.
v2:
- Readd pad check, as the pad in the ioctl struct was not changed
(jcavitt)
Jonathan Cavitt (2):
drm/xe/pagefault: Add SRCID to pagefault struct
drm/xe/vm: Add srcid to xe_vm_get_property_ioctl fault report
drivers/gpu/drm/xe/xe_guc_pagefault.c | 1 +
drivers/gpu/drm/xe/xe_pagefault.c | 6 ++++--
drivers/gpu/drm/xe/xe_pagefault_types.h | 4 +++-
drivers/gpu/drm/xe/xe_vm.c | 8 ++++++++
drivers/gpu/drm/xe/xe_vm_types.h | 2 ++
include/uapi/drm/xe_drm.h | 4 ++--
6 files changed, 20 insertions(+), 5 deletions(-)
--
2.53.0
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH v2 1/2] drm/xe/pagefault: Add SRCID to pagefault struct
2026-06-03 15:08 [PATCH v2 0/2] drm/xe/pagefault: Add SRCID to pagefault reporting Jonathan Cavitt
@ 2026-06-03 15:08 ` Jonathan Cavitt
2026-06-03 15:08 ` [PATCH v2 2/2] drm/xe/vm: Add srcid to xe_vm_get_property_ioctl fault report Jonathan Cavitt
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cavitt @ 2026-06-03 15:08 UTC (permalink / raw)
To: dri-devel
Cc: saurabhg.gupta, alex.zuo, jonathan.cavitt, mripard, airlied,
simona, linux-kernel, intel-xe, Rodrigo.vivi, matthew.brost,
maarten.lankhorst, thomas.hellstrom, tzimmermann
Add SRCID information to pagefault struct for the purpose of reporting
the hardware unit that resulted in the pagefault.
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Simona Vetter <simona@ffwll.ch>
---
drivers/gpu/drm/xe/xe_guc_pagefault.c | 1 +
drivers/gpu/drm/xe/xe_pagefault.c | 6 ++++--
drivers/gpu/drm/xe/xe_pagefault_types.h | 4 +++-
3 files changed, 8 insertions(+), 3 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_guc_pagefault.c b/drivers/gpu/drm/xe/xe_guc_pagefault.c
index 607e32392f46..17cb7f359261 100644
--- a/drivers/gpu/drm/xe/xe_guc_pagefault.c
+++ b/drivers/gpu/drm/xe/xe_guc_pagefault.c
@@ -91,6 +91,7 @@ int xe_guc_pagefault_handler(struct xe_guc *guc, u32 *msg, u32 len)
FIELD_GET(PFD_FAULT_TYPE, msg[2]));
pf.consumer.engine_class = FIELD_GET(PFD_ENG_CLASS, msg[0]);
pf.consumer.engine_instance = FIELD_GET(PFD_ENG_INSTANCE, msg[0]);
+ pf.consumer.srcid = FIELD_GET(PFD_SRC_ID, msg[0]);
pf.producer.private = guc;
pf.producer.ops = &guc_pagefault_ops;
diff --git a/drivers/gpu/drm/xe/xe_pagefault.c b/drivers/gpu/drm/xe/xe_pagefault.c
index dd3c068e1a39..42b682ba5f9b 100644
--- a/drivers/gpu/drm/xe/xe_pagefault.c
+++ b/drivers/gpu/drm/xe/xe_pagefault.c
@@ -248,7 +248,8 @@ static void xe_pagefault_print(struct xe_pagefault *pf)
"\tAccessType: %lu\n"
"\tFaultLevel: %lu\n"
"\tEngineClass: %d %s\n"
- "\tEngineInstance: %d\n",
+ "\tEngineInstance: %d\n"
+ "\tSRCID: 0x%02x\n",
pf->consumer.asid,
upper_32_bits(pf->consumer.page_addr),
lower_32_bits(pf->consumer.page_addr),
@@ -260,7 +261,8 @@ static void xe_pagefault_print(struct xe_pagefault *pf)
pf->consumer.fault_type_level),
pf->consumer.engine_class,
xe_hw_engine_class_to_str(pf->consumer.engine_class),
- pf->consumer.engine_instance);
+ pf->consumer.engine_instance,
+ pf->consumer.srcid);
}
static void xe_pagefault_save_to_vm(struct xe_device *xe, struct xe_pagefault *pf)
diff --git a/drivers/gpu/drm/xe/xe_pagefault_types.h b/drivers/gpu/drm/xe/xe_pagefault_types.h
index c4ee625b93dd..60cc269aeea3 100644
--- a/drivers/gpu/drm/xe/xe_pagefault_types.h
+++ b/drivers/gpu/drm/xe/xe_pagefault_types.h
@@ -86,8 +86,10 @@ struct xe_pagefault {
u8 engine_class;
/** @consumer.engine_instance: engine instance */
u8 engine_instance;
+ /** @consumer.srcid: ID of hardware unit producing fault */
+ u8 srcid;
/** @consumer.reserved: reserved bits for future expansion */
- u64 reserved;
+ u8 reserved[7];
} consumer;
/**
* @producer: State for the producer (i.e., HW/FW interface). Populated
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
* [PATCH v2 2/2] drm/xe/vm: Add srcid to xe_vm_get_property_ioctl fault report
2026-06-03 15:08 [PATCH v2 0/2] drm/xe/pagefault: Add SRCID to pagefault reporting Jonathan Cavitt
2026-06-03 15:08 ` [PATCH v2 1/2] drm/xe/pagefault: Add SRCID to pagefault struct Jonathan Cavitt
@ 2026-06-03 15:08 ` Jonathan Cavitt
1 sibling, 0 replies; 3+ messages in thread
From: Jonathan Cavitt @ 2026-06-03 15:08 UTC (permalink / raw)
To: dri-devel
Cc: saurabhg.gupta, alex.zuo, jonathan.cavitt, mripard, airlied,
simona, linux-kernel, intel-xe, Rodrigo.vivi, matthew.brost,
maarten.lankhorst, thomas.hellstrom, tzimmermann
Add the SRCID of the faulting hardware unit to the return of the
xe_vm_get_property_ioctl fault report.
v2:
- Readd pad check, as the pad in the ioctl struct was not changed
(jcavitt)
Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
Cc: Matthew Brost <matthew.brost@intel.com>
Cc: Thomas Hellström <thomas.hellstrom@linux.intel.com>
Cc: Rodrigo Vivi <rodrigo.vivi@intel.com>
Cc: David Airlie <airlied@gmail.com>
Cc: Simona Vetter <simona@ffwll.ch>
Cc: Maarten Lankhorst <maarten.lankhorst@linux.intel.com>
Cc: Maxime Ripard <mripard@kernel.org>
Cc: Thomas Zimmermann <tzimmermann@suse.de>
---
drivers/gpu/drm/xe/xe_vm.c | 8 ++++++++
drivers/gpu/drm/xe/xe_vm_types.h | 2 ++
include/uapi/drm/xe_drm.h | 4 ++--
3 files changed, 12 insertions(+), 2 deletions(-)
diff --git a/drivers/gpu/drm/xe/xe_vm.c b/drivers/gpu/drm/xe/xe_vm.c
index 080c2fff0e95..7e084c05f10e 100644
--- a/drivers/gpu/drm/xe/xe_vm.c
+++ b/drivers/gpu/drm/xe/xe_vm.c
@@ -636,6 +636,7 @@ void xe_vm_add_fault_entry_pf(struct xe_vm *vm, struct xe_pagefault *pf)
pf->consumer.fault_type_level);
e->fault_level = FIELD_GET(XE_PAGEFAULT_LEVEL_MASK,
pf->consumer.fault_type_level);
+ e->srcid = pf->consumer.srcid;
list_add_tail(&e->list, &vm->faults.list);
vm->faults.len++;
@@ -4108,6 +4109,11 @@ static u8 xe_to_user_fault_level(u8 fault_level)
return fault_level;
}
+static u8 xe_to_user_srcid(u8 srcid)
+{
+ return srcid;
+}
+
static int fill_faults(struct xe_vm *vm,
struct drm_xe_vm_get_property *args)
{
@@ -4135,6 +4141,8 @@ static int fill_faults(struct xe_vm *vm,
fault_entry.fault_type = xe_to_user_fault_type(entry->fault_type);
fault_entry.fault_level = xe_to_user_fault_level(entry->fault_level);
+ fault_entry.srcid = xe_to_user_srcid(entry->srcid);
+
memcpy(&fault_list[i], &fault_entry, entry_size);
i++;
diff --git a/drivers/gpu/drm/xe/xe_vm_types.h b/drivers/gpu/drm/xe/xe_vm_types.h
index 635ed29b9a69..e8aea75341cc 100644
--- a/drivers/gpu/drm/xe/xe_vm_types.h
+++ b/drivers/gpu/drm/xe/xe_vm_types.h
@@ -196,6 +196,7 @@ struct xe_device;
* @access_type: type of address access that resulted in fault
* @fault_type: type of fault reported
* @fault_level: fault level of the fault
+ * @srcid: ID of the faulting hardware unit
*/
struct xe_vm_fault_entry {
struct list_head list;
@@ -204,6 +205,7 @@ struct xe_vm_fault_entry {
u8 access_type;
u8 fault_type;
u8 fault_level;
+ u8 srcid;
};
struct xe_vm {
diff --git a/include/uapi/drm/xe_drm.h b/include/uapi/drm/xe_drm.h
index 48e9f1fdb78d..2b45b691a032 100644
--- a/include/uapi/drm/xe_drm.h
+++ b/include/uapi/drm/xe_drm.h
@@ -1294,8 +1294,8 @@ struct xe_vm_fault {
#define FAULT_LEVEL_PML4 3
#define FAULT_LEVEL_PML5 4
__u8 fault_level;
- /** @pad: MBZ */
- __u8 pad;
+ /** @srcid: ID of the faulting hardware unit */
+ __u8 srcid;
/** @reserved: MBZ */
__u64 reserved[4];
};
--
2.53.0
^ permalink raw reply related [flat|nested] 3+ messages in thread
end of thread, other threads:[~2026-06-03 15:08 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-06-03 15:08 [PATCH v2 0/2] drm/xe/pagefault: Add SRCID to pagefault reporting Jonathan Cavitt
2026-06-03 15:08 ` [PATCH v2 1/2] drm/xe/pagefault: Add SRCID to pagefault struct Jonathan Cavitt
2026-06-03 15:08 ` [PATCH v2 2/2] drm/xe/vm: Add srcid to xe_vm_get_property_ioctl fault report Jonathan Cavitt
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox