Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:hmm_vma_walk_hugetlb_entry

Proto:static int hmm_vma_walk_hugetlb_entry(pte_t *pte, unsigned long hmask, unsigned long start, unsigned long end, struct mm_walk *walk)

Type:int

Parameter:

TypeParameterName
pte_t *pte
unsigned longhmask
unsigned longstart
unsigned longend
struct mm_walk *walk
546  addr = start
547  hmm_vma_walk = private
548  range = range
549  vma = vma
554  ret = 0
556  ptl = huge_pte_lock(hstate_vma(vma), mm, pte)
557  entry = huge_ptep_get(pte)
559  i = start - start >> PAGE_SHIFT determines the page size
560  orig_pfn = pfns[i]
561  pfns[i] = values[ corresponding CPU page table entry is pte_none()]
562  cpu_flags = pte_to_hmm_pfn_flags(range, entry)
563  fault = write_fault = false
564  hmm_pte_need_fault(hmm_vma_walk, orig_pfn, cpu_flags, & fault, & write_fault)
566  If fault || write_fault Then
567  ret = -ENOENT
568  Go to unlock
571  pfn = pte_pfn(entry) + ((start & ~hmask) >> PAGE_SHIFT determines the page size )
572  When addr < end cycle pfns[i] = hmm_device_entry_from_pfn() - create a valid device entry value from pfn*@range: range use to encode HMM pfn value*@pfn: pfn value for which to create the device entry* Return: valid device entry for the pfn | cpu_flags
575  last = end
577  unlock :
578  spin_unlock(ptl)
580  If ret == -ENOENT Then Return hmm_vma_walk_hole_() - handle a range lacking valid pmd or pte(s)*@addr: range virtual start address (inclusive)*@end: range virtual end address (exclusive)*@fault: should we fault or not ?*@write_fault: write fault ?*@walk: mm_walk structure* Return: 0
583  Return ret