Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:check_vma_flags

Proto:static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags)

Type:int

Parameter:

TypeParameterName
struct vm_area_struct *vma
unsigned longgup_flags
678  vm_flags = Flags, see mm.h.
679  write = gup_flags & check pte is writable
680  foreign = gup_flags & we are working on non-current tsk/mm
682  If vm_flags & (Memory mapped I/O or similar | Page-ranges managed without "struct page", just pure PFN ) Then Return -EFAULT
685  If gup_flags & don't do file mappings && Not vma_is_anonymous(vma) Then Return -EFAULT
688  If write Then
689  If Not (vm_flags & VM_WRITE) Then
701  If Not is_cow_mapping(vm_flags) Then Return -EFAULT
704  Else if Not (vm_flags & currently active flags ) Then
705  If Not (gup_flags & get_user_pages read/write w/o permission ) Then Return -EFAULT
711  If Not (vm_flags & limits for mprotect() etc ) Then Return -EFAULT
718  If Not arch_vma_access_permitted(vma, write, TSC's on different sockets may be reset asynchronously.* This may cause the TSC ADJUST value on socket 0 to be NOT 0., foreign) Then Return -EFAULT
720  Return 0
Caller
NameDescribe
__get_user_pages__get_user_pages() - pin user pages in memory*@tsk: task_struct of target task*@mm: mm_struct of target mm*@start: starting user address*@nr_pages: number of pages from start to pin*@gup_flags: flags modifying pin behaviour