Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:hmm_vma_handle_pte

Proto:static int hmm_vma_handle_pte(struct mm_walk *walk, unsigned long addr, unsigned long end, pmd_t *pmdp, pte_t *ptep, uint64_t *pfn)

Type:int

Parameter:

TypeParameterName
struct mm_walk *walk
unsigned longaddr
unsigned longend
pmd_t *pmdp
pte_t *ptep
uint64_t *pfn
268  hmm_vma_walk = private
269  range = range
272  pte = ptep
273  orig_pfn = pfn
275  pfn = values[ corresponding CPU page table entry is pte_none()]
276  fault = write_fault = false
278  If pte_none(pte) Then
279  hmm_pte_need_fault(hmm_vma_walk, orig_pfn, 0, & fault, & write_fault)
281  If fault || write_fault Then Go to fault
283  Return 0
286  If Not pte_present(pte) Then
287  entry = Convert the arch-dependent pte representation of a swp_entry_t into an* arch-independent swp_entry_t.
289  If Not non_swap_entry(entry) Then
293  If fault || write_fault Then Go to fault
295  Return 0
309  If fault || write_fault Then Go to fault
313  pfn |= cpu_flags
314  Return 0
317  If is_migration_entry(entry) Then
318  If fault || write_fault Then
319  pte_unmap(ptep)
320  last = addr
322  Return -EBUSY
324  Return 0
328  pfn = values[ corresponding CPU page table entry points to poisoned memory]
329  Return -EFAULT
330  Else
331  cpu_flags = pte_to_hmm_pfn_flags(range, pte)
332  hmm_pte_need_fault(hmm_vma_walk, orig_pfn, cpu_flags, & fault, & write_fault)
336  If fault || write_fault Then Go to fault
339  If pte_devmap(pte) Then
340  pgmap = get_dev_pagemap(pte_pfn(pte), pgmap)
342  If Value for the false possibility is greater at compile time(!pgmap) Then Return -EBUSY
344  Else if IS_ENABLED(CONFIG_FOO) evaluates to 1 if CONFIG_FOO is set to 'y' or 'm',* 0 otherwise.(CONFIG_ARCH_HAS_PTE_SPECIAL) && pte_special(pte) Then
345  If Not is_zero_pfn(pte_pfn(pte)) Then
347  Return -EFAULT
355  pfn = 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
356  Return 0
358  fault :
359  If pgmap Then
360  put_dev_pagemap(pgmap)
361  pgmap = NULL
363  pte_unmap(ptep)
365  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
Caller
NameDescribe
hmm_vma_walk_pmd