Lines Matching full:fault

67 struct fault {  struct
428 static void handle_fault_error(struct fault *fault) in handle_fault_error() argument
432 if (!fault->dev_state->inv_ppr_cb) { in handle_fault_error()
433 set_pri_tag_status(fault->state, fault->tag, PPR_INVALID); in handle_fault_error()
437 status = fault->dev_state->inv_ppr_cb(fault->dev_state->pdev, in handle_fault_error()
438 fault->pasid, in handle_fault_error()
439 fault->address, in handle_fault_error()
440 fault->flags); in handle_fault_error()
443 set_pri_tag_status(fault->state, fault->tag, PPR_SUCCESS); in handle_fault_error()
446 set_pri_tag_status(fault->state, fault->tag, PPR_INVALID); in handle_fault_error()
449 set_pri_tag_status(fault->state, fault->tag, PPR_FAILURE); in handle_fault_error()
456 static bool access_error(struct vm_area_struct *vma, struct fault *fault) in access_error() argument
460 if (fault->flags & PPR_FAULT_EXEC) in access_error()
463 if (fault->flags & PPR_FAULT_READ) in access_error()
466 if (fault->flags & PPR_FAULT_WRITE) in access_error()
474 struct fault *fault = container_of(work, struct fault, work); in do_fault() local
481 mm = fault->state->mm; in do_fault()
482 address = fault->address; in do_fault()
484 if (fault->flags & PPR_FAULT_USER) in do_fault()
486 if (fault->flags & PPR_FAULT_WRITE) in do_fault()
497 if (access_error(vma, fault)) in do_fault()
505 /* failed to service fault */ in do_fault()
506 handle_fault_error(fault); in do_fault()
508 finish_pri_tag(fault->dev_state, fault->state, fault->tag); in do_fault()
510 put_pasid_state(fault->state); in do_fault()
512 kfree(fault); in do_fault()
522 struct fault *fault; in ppr_notifier() local
565 fault = kzalloc(sizeof(*fault), GFP_ATOMIC); in ppr_notifier()
566 if (fault == NULL) { in ppr_notifier()
567 /* We are OOM - send success and let the device re-fault */ in ppr_notifier()
572 fault->dev_state = dev_state; in ppr_notifier()
573 fault->address = iommu_fault->address; in ppr_notifier()
574 fault->state = pasid_state; in ppr_notifier()
575 fault->tag = tag; in ppr_notifier()
576 fault->finish = finish; in ppr_notifier()
577 fault->pasid = iommu_fault->pasid; in ppr_notifier()
578 fault->flags = iommu_fault->flags; in ppr_notifier()
579 INIT_WORK(&fault->work, do_fault); in ppr_notifier()
581 queue_work(iommu_wq, &fault->work); in ppr_notifier()