@@ -206,11 +206,13 @@ static int handle_pagefault(struct xe_gt *gt, struct xe_gt_pagefault *pf)
vma = lookup_vma(vm, pf->page_addr);
if (!vma) {
+ pf->address_type = DRM_XE_FAULT_ADDRESS_TYPE_NONE_EXT;
err = -EINVAL;
goto unlock_vm;
}
if (xe_vma_read_only(vma) && pf->access_type != XE_GT_PAGEFAULT_ACCESS_TYPE_READ) {
+ pf->address_type = DRM_XE_FAULT_ADDRESS_TYPE_WRITE_INVALID_EXT;
err = -EPERM;
goto unlock_vm;
}
@@ -284,6 +286,7 @@ static bool get_pagefault(struct pf_queue *pf_queue, struct xe_gt_pagefault *pf)
pf->asid = FIELD_GET(PFD_ASID, desc->dw1);
pf->vfid = FIELD_GET(PFD_VFID, desc->dw2);
pf->access_type = FIELD_GET(PFD_ACCESS_TYPE, desc->dw2);
+ pf->address_type = 0;
pf->fault_type = FIELD_GET(PFD_FAULT_TYPE, desc->dw2);
pf->page_addr = (u64)(FIELD_GET(PFD_VIRTUAL_ADDR_HI, desc->dw3)) <<
PFD_VIRTUAL_ADDR_HI_SHIFT;
@@ -24,6 +24,8 @@ struct xe_gt_pagefault {
* from xe_gt_pagefault_access_type
*/
u8 access_type;
+ /** @address_type: Type of address access that resulted in fault */
+ u8 address_type;
/**
* @fault_type: fault type of this pagefault, as a value
* from xe_gt_pagefault_fault_type
Add a new field to the xe_pagefault struct, address_type, that tracks the type of fault the pagefault incurred. Signed-off-by: Jonathan Cavitt <jonathan.cavitt@intel.com> --- drivers/gpu/drm/xe/xe_gt_pagefault.c | 3 +++ drivers/gpu/drm/xe/xe_gt_pagefault_types.h | 2 ++ 2 files changed, 5 insertions(+)