mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-10 20:48:12 +00:00
drm/xe: Add mnemonic error reason to page fault diagnostics
xe_pagefault_print() was firing without indicating why servicing of a fault failed, making it hard to distinguish benign races (e.g. a VM's file descriptor closing mid-fault) from real bugs. Add enum xe_pagefault_error, uniquely identifying the high-level point at which xe_pagefault_service(), xe_pagefault_handle_vma(), and xe_svm_handle_pagefault() fail. Since consumer.page_addr is always page (4K) aligned, steal the reserved low byte to carry this code without growing struct xe_pagefault. Add xe_pagefault_set_error() / xe_pagefault_get_error() to encode/decode it, and xe_pagefault_addr() as the single accessor for the real (masked) faulted address; update all real address consumers (xe_pagefault_match(), cache alignment, xe_vm_add_fault_entry_pf()) to go through it instead of reading consumer.page_addr directly. xe_pagefault_set_start_addr() now preserves any already-recorded error bits rather than clobbering them. xe_pagefault_print() decodes the error via a new xe_pagefault_error_to_str() and reports it in an added "Error:" line. xe_pagefault_asid_to_vm() now distinguishes an ASID with no VM at all (XE_PAGEFAULT_ERROR_VM_NOT_FOUND, e.g. the owning file descriptor was already closed) from a VM found but not in fault mode (XE_PAGEFAULT_ERROR_VM_NOT_IN_FAULT_MODE). Signed-off-by: Matthew Brost <matthew.brost@intel.com> Assisted-by: GitHub_Copilot:claude-sonnet-5 Reviewed-by: Himal Prasad Ghimiray <himal.prasad.ghimiray@intel.com> Link: https://patch.msgid.link/20260917203850.321385-1-matthew.brost@intel.com Signed-off-by: Rodrigo Vivi <rodrigo.vivi@intel.com>
This commit is contained in:
parent
af14e37053
commit
fd831e3af1
5 changed files with 250 additions and 25 deletions
Loading…
Add table
Add a link
Reference in a new issue