Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:__follow_pte_pmd

Proto:static int __follow_pte_pmd(struct mm_struct *mm, unsigned long address, struct mmu_notifier_range *range, pte_t **ptepp, pmd_t **pmdpp, spinlock_t **ptlp)

Type:int

Parameter:

TypeParameterName
struct mm_struct *mm
unsigned longaddress
struct mmu_notifier_range *range
pte_t **ptepp
pmd_t **pmdpp
spinlock_t **ptlp
4291  pgd = a shortcut to get a pgd_t in a given mm(mm, address)
4292  If The "pgd_xxx()" functions here are trivial for a folded two-level* setup: the p4d is never bad, and a p4d always exists (as it's folded* into the pgd entry) || Value for the false possibility is greater at compile time(pgd_bad( * pgd)) Then Go to out
4295  p4d = p4d_offset(pgd, address)
4296  If The "p4d_xxx()" functions here are trivial for a folded two-level* setup: the pud is never bad, and a pud always exists (as it's folded* into the p4d entry) || Value for the false possibility is greater at compile time(p4d_bad( * p4d)) Then Go to out
4299  pud = pud_offset(p4d, address)
4300  If The "pud_xxx()" functions here are trivial for a folded two-level* setup: the pmd is never bad, and a pmd always exists (as it's folded* into the pud entry) || Value for the false possibility is greater at compile time(pud_bad( * pud)) Then Go to out
4303  pmd = pmd_offset(pud, address)
4304  VM_BUG_ON(pmd_trans_huge( * pmd))
4306  If pmd_huge( * pmd) Then
4307  If Not pmdpp Then Go to out
4310  If range Then
4316  ptlp = pmd_lock(mm, pmd)
4317  If pmd_huge( * pmd) Then
4318  pmdpp = pmd
4319  Return 0
4321  spin_unlock( * ptlp)
4322  If range Then mmu_notifier_invalidate_range_end(range)
4326  If pmd_none( * pmd) || Value for the false possibility is greater at compile time(pmd_bad( * pmd)) Then Go to out
4329  If range Then
4330  mmu_notifier_range_init(range, MMU_NOTIFY_CLEAR, 0, NULL, mm, address & PAGE_MASK, (address & PAGE_MASK) + PAGE_SIZE)
4333  mmu_notifier_invalidate_range_start(range)
4335  ptep = pte_offset_map_lock(mm, pmd, address, ptlp)
4336  If Not pte_present( * ptep) Then Go to unlock
4338  ptepp = ptep
4339  Return 0
4340  unlock :
4341  pte_unmap_unlock(ptep, * ptlp)
4342  If range Then mmu_notifier_invalidate_range_end(range)
4344  out :
4345  Return -EINVAL
Caller
NameDescribe
follow_pte
follow_pte_pmd