Skip to content

Commit 94cda7a

Browse files
Jonathan-Cavittintel-lab-lkp
authored andcommitted
drm/xe/xe_pagefault: Track address precision per pagefault
Add an address precision field to the pagefault consumer. This captures the fact that pagefaults are reported on a SZ_4K granularity by GuC, meaning the reported pagefault address is only the address of the page where the faulting access occurred rather than the exact address of the fault. This field is necessary in case more reporters are added where the granularity can be different. v2: - Keep u8 values together (Matt Brost) Suggested-by: Matthew Brost <matthew.brost@intel.com> Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com>
1 parent 1714435 commit 94cda7a

3 files changed

Lines changed: 10 additions & 1 deletion

File tree

drivers/gpu/drm/xe/xe_guc_pagefault.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -74,6 +74,7 @@ int xe_guc_pagefault_handler(struct xe_guc *guc, u32 *msg, u32 len)
7474
<< PFD_VIRTUAL_ADDR_HI_SHIFT) |
7575
(FIELD_GET(PFD_VIRTUAL_ADDR_LO, msg[2]) <<
7676
PFD_VIRTUAL_ADDR_LO_SHIFT);
77+
pf.consumer.addr_precision = 12;
7778
pf.consumer.asid = FIELD_GET(PFD_ASID, msg[1]);
7879
pf.consumer.access_type = FIELD_GET(PFD_ACCESS_TYPE, msg[2]);
7980
pf.consumer.fault_type = FIELD_GET(PFD_FAULT_TYPE, msg[2]);

drivers/gpu/drm/xe/xe_pagefault.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -231,6 +231,7 @@ static void xe_pagefault_print(struct xe_pagefault *pf)
231231
{
232232
xe_gt_info(pf->gt, "\n\tASID: %d\n"
233233
"\tFaulted Address: 0x%08x%08x\n"
234+
"\tAddress Precision: %lu\n"
234235
"\tFaultType: %d\n"
235236
"\tAccessType: %d\n"
236237
"\tFaultLevel: %d\n"
@@ -239,6 +240,7 @@ static void xe_pagefault_print(struct xe_pagefault *pf)
239240
pf->consumer.asid,
240241
upper_32_bits(pf->consumer.page_addr),
241242
lower_32_bits(pf->consumer.page_addr),
243+
BIT(pf->consumer.addr_precision),
242244
pf->consumer.fault_type,
243245
pf->consumer.access_type,
244246
pf->consumer.fault_level,

drivers/gpu/drm/xe/xe_pagefault_types.h

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,12 @@ struct xe_pagefault {
6767
u64 page_addr;
6868
/** @consumer.asid: address space ID */
6969
u32 asid;
70+
/**
71+
* @consumer.addr_precision: precision of the page fault address.
72+
* u8 rather than u32 to keep compact - actual precision is
73+
* BIT(consumer.addr_precision). Currently only 12
74+
*/
75+
u8 addr_precision;
7076
/**
7177
* @consumer.access_type: access type, u8 rather than enum to
7278
* keep size compact
@@ -85,7 +91,7 @@ struct xe_pagefault {
8591
/** @consumer.engine_instance: engine instance */
8692
u8 engine_instance;
8793
/** consumer.reserved: reserved bits for future expansion */
88-
u8 reserved[7];
94+
u8 reserved[6];
8995
} consumer;
9096
/**
9197
* @producer: State for the producer (i.e., HW/FW interface). Populated

0 commit comments

Comments
 (0)