Lines Matching full:fault
67 struct fault { struct
425 static void handle_fault_error(struct fault *fault) in handle_fault_error() argument
429 if (!fault->dev_state->inv_ppr_cb) { in handle_fault_error()
430 set_pri_tag_status(fault->state, fault->tag, PPR_INVALID); in handle_fault_error()
434 status = fault->dev_state->inv_ppr_cb(fault->dev_state->pdev, in handle_fault_error()
435 fault->pasid, in handle_fault_error()
436 fault->address, in handle_fault_error()
437 fault->flags); in handle_fault_error()
440 set_pri_tag_status(fault->state, fault->tag, PPR_SUCCESS); in handle_fault_error()
443 set_pri_tag_status(fault->state, fault->tag, PPR_INVALID); in handle_fault_error()
446 set_pri_tag_status(fault->state, fault->tag, PPR_FAILURE); in handle_fault_error()
453 static bool access_error(struct vm_area_struct *vma, struct fault *fault) in access_error() argument
457 if (fault->flags & PPR_FAULT_EXEC) in access_error()
460 if (fault->flags & PPR_FAULT_READ) in access_error()
463 if (fault->flags & PPR_FAULT_WRITE) in access_error()
471 struct fault *fault = container_of(work, struct fault, work); in do_fault() local
478 mm = fault->state->mm; in do_fault()
479 address = fault->address; in do_fault()
481 if (fault->flags & PPR_FAULT_USER) in do_fault()
483 if (fault->flags & PPR_FAULT_WRITE) in do_fault()
494 if (access_error(vma, fault)) in do_fault()
502 /* failed to service fault */ in do_fault()
503 handle_fault_error(fault); in do_fault()
505 finish_pri_tag(fault->dev_state, fault->state, fault->tag); in do_fault()
507 put_pasid_state(fault->state); in do_fault()
509 kfree(fault); in do_fault()
519 struct fault *fault; in ppr_notifier() local
562 fault = kzalloc(sizeof(*fault), GFP_ATOMIC); in ppr_notifier()
563 if (fault == NULL) { in ppr_notifier()
564 /* We are OOM - send success and let the device re-fault */ in ppr_notifier()
569 fault->dev_state = dev_state; in ppr_notifier()
570 fault->address = iommu_fault->address; in ppr_notifier()
571 fault->state = pasid_state; in ppr_notifier()
572 fault->tag = tag; in ppr_notifier()
573 fault->finish = finish; in ppr_notifier()
574 fault->pasid = iommu_fault->pasid; in ppr_notifier()
575 fault->flags = iommu_fault->flags; in ppr_notifier()
576 INIT_WORK(&fault->work, do_fault); in ppr_notifier()
578 queue_work(iommu_wq, &fault->work); in ppr_notifier()