函数逻辑报告

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

Source Code:mm\gup.c Create Date:2022-07-27 16:01:00
Last Modify:2020-03-12 14:18:49 Copyright©Brick
首页 函数Tree
注解内核,赢得工具下载SCCTEnglish

函数名称: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

函数原型:int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm, unsigned long address, unsigned int fault_flags, bool *unlocked)

返回类型:int

参数:

类型参数名称
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  如果unlockedfault_flags或等于Retry fault if blocking
966  retry :
967  vma等于find_extend_vma(mm, address)
968  如果非vmaaddress小于Our start address within vm_mm. 则返回:负EFAULT
971  如果非vma_permits_fault(vma, fault_flags)则返回:负EFAULT
974  ret等于handle_mm_fault(vma, address, fault_flags)
975  major或等于ret按位与VM_FAULT_MAJOR
976  如果ret按位与VM_FAULT_ERROR
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  如果err则返回:err
981  BUG()
984  如果ret按位与VM_FAULT_RETRY
985  lock for reading
986  如果非fault_flags按位与Second try 的值则
987  * unlocked = true
989  fault_flags或等于Second try
990  转到:retry
994  如果tsk
995  如果majormaj_flt自加
997  否则min_flt自加
1000  返回:0
调用者
名称描述
fault_in_user_writeableault_in_user_writeable() - Fault in user address and verify RW access*@uaddr: pointer to faulting user space address* Slow path to fixup the fault we just took in the atomic write* access to @uaddr