drm/xe/xe2: Respond to TRTT faults as unsuccessful page fault

SW is not expected to handle TRTT faults and should report these as
unsuccessful page fault in the reply, such that HW can respond by
raising a CAT error.

Signed-off-by: Brian Welty <brian.welty@intel.com>
Reviewed-by: Matthew Brost <matthew.brost@intel.com>
Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
Brian Welty
2023-11-21 12:10:37 -08:00
committed by Rodrigo Vivi
parent a682b6a42d
commit 594b46ba0c

View File

@@ -34,6 +34,7 @@ struct pagefault {
u8 engine_class;
u8 engine_instance;
u8 fault_unsuccessful;
bool trva_fault;
};
enum access_type {
@@ -138,6 +139,10 @@ static int handle_pagefault(struct xe_gt *gt, struct pagefault *pf)
int ret = 0;
bool atomic;
/* SW isn't expected to handle TRTT faults */
if (pf->trva_fault)
return -EFAULT;
/* ASID to VM */
mutex_lock(&xe->usm.lock);
vm = xa_load(&xe->usm.asid_to_vm, pf->asid);
@@ -282,6 +287,7 @@ static bool get_pagefault(struct pf_queue *pf_queue, struct pagefault *pf)
(pf_queue->data + pf_queue->head);
pf->fault_level = FIELD_GET(PFD_FAULT_LEVEL, desc->dw0);
pf->trva_fault = FIELD_GET(XE2_PFD_TRVA_FAULT, desc->dw0);
pf->engine_class = FIELD_GET(PFD_ENG_CLASS, desc->dw0);
pf->engine_instance = FIELD_GET(PFD_ENG_INSTANCE, desc->dw0);
pf->pdata = FIELD_GET(PFD_PDATA_HI, desc->dw1) <<