Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\gup.c Create Date:2022-07-28 14:35:08
Last Modify:2020-03-12 14:18:49 Copyright©Brick
home page Tree
Annotation kernel can get tool activityDownload SCCTChinese

Name:xup_user_fault() - manually resolve a user page fault*@tsk: the task_struct to use for page fault accounting, or* NULL if faults are not to be recorded

Proto:int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm, unsigned long address, unsigned int fault_flags, bool *unlocked)

Type:int

Parameter:

TypeParameterName
struct task_struct *tsk
struct mm_struct *mm
unsigned longaddress
unsigned intfault_flags
bool *unlocked
959  major = 0
961  address = Architectures that support memory tagging (assigning tags to memory regions,* embedding these tags into addresses that point to these memory regions, and* checking that the memory and the pointer tags match on memory accesses)(address)
963  If unlocked Then fault_flags |= Retry fault if blocking
966  retry :
967  vma = find_extend_vma(mm, address)
968  If Not vma || address < Our start address within vm_mm. Then Return -EFAULT
971  If Not vma_permits_fault(vma, fault_flags) Then Return -EFAULT
974  ret = handle_mm_fault(vma, address, fault_flags)
975  major |= ret & VM_FAULT_MAJOR
976  If ret & VM_FAULT_ERROR Then
977  err = NOTE on FOLL_LONGTERM:* FOLL_LONGTERM indicates that the page will be held for an indefinite time* period _often_ under userspace control
979  If err Then Return err
981  BUG()
984  If ret & VM_FAULT_RETRY Then
985  lock for reading
986  If Not (fault_flags & Second try ) Then
987  * unlocked = true
990  Go to retry
994  If tsk Then
995  If major Then maj_flt++
997  Else min_flt++
1000  Return 0