Function report

Linux Kernel

v5.5.9

Brick Technologies Co., Ltd

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

Name:This function is called to print an error when a bad pte* is found. For example, we might have a PFN-mapped pte in* a region that doesn't allow it.* The calling function must still handle the error.

Proto:static void print_bad_pte(struct vm_area_struct *vma, unsigned long addr, pte_t pte, struct page *page)

Type:void

Parameter:

TypeParameterName
struct vm_area_struct *vma
unsigned longaddr
pte_tpte
struct page *page
502  pgd = a shortcut to get a pgd_t in a given mm(The address space we belong to. , addr)
503  p4d = p4d_offset(pgd, addr)
504  pud = pud_offset(p4d, addr)
505  pmd = pmd_offset(pud, addr)
516  If nr_shown == 60 Then
517  If time_before(jiffies, resume) Then
518  nr_unshown++
519  Return
521  If nr_unshown Then
522  pr_alert("BUG: Bad page map: %lu messages suppressed\n", nr_unshown)
524  nr_unshown = 0
526  nr_shown = 0
528  If nr_shown++ == 0 Then resume = jiffies + 60 * HZ
531  mapping = File we map to (can be NULL). ? f_mapping : NULL
532  index = linear_page_index(vma, addr)
534  pr_alert("BUG: Bad page map in process %s pte:%08llx pmd:%08llx\n", comm, (longlong)pte_val(pte), (longlong)pmd_val( * pmd))
537  If page Then dump_page(page, "bad pte")
539  pr_alert("addr:%px vm_flags:%08lx anon_vma:%px mapping:%px index:%lx\n", (void * )addr, Flags, see mm.h. , Serialized by page_table_lock , mapping, index)
541  pr_alert("file:%pD fault:%ps mmap:%ps readpage:%ps\n", File we map to (can be NULL). , Function pointers to deal with this struct. ? fault : NULL, File we map to (can be NULL). ? mmap : NULL, mapping ? readpage : NULL)
546  dump_stack()
547  add_taint: add a taint flag if not already set.*@flag: one of the TAINT_* constants.*@lockdep_ok: whether lock debugging is still OK.* If something bad has gone wrong, you'll want @lockdebug_ok = false, but for
Caller
NameDescribe
vm_normal_pagevm_normal_page -- This function gets the "struct page" associated with a pte.* "Special" mappings do not wish to be associated with a "struct page" (either* it doesn't exist, or it exists but they don't want to touch it). In this
zap_pte_range
do_swap_pageWe enter with non-exclusive mmap_sem (to exclude vma changes,* but allow concurrent faults), and pte mapped but not yet locked.* We return with pte unmapped and unlocked.* We return with the mmap_sem locked or unlocked in the same cases