~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

TOMOYO Linux Cross Reference
Linux/include/linux/page_table_check.h

Version: ~ [ linux-6.11.5 ] ~ [ linux-6.10.14 ] ~ [ linux-6.9.12 ] ~ [ linux-6.8.12 ] ~ [ linux-6.7.12 ] ~ [ linux-6.6.58 ] ~ [ linux-6.5.13 ] ~ [ linux-6.4.16 ] ~ [ linux-6.3.13 ] ~ [ linux-6.2.16 ] ~ [ linux-6.1.114 ] ~ [ linux-6.0.19 ] ~ [ linux-5.19.17 ] ~ [ linux-5.18.19 ] ~ [ linux-5.17.15 ] ~ [ linux-5.16.20 ] ~ [ linux-5.15.169 ] ~ [ linux-5.14.21 ] ~ [ linux-5.13.19 ] ~ [ linux-5.12.19 ] ~ [ linux-5.11.22 ] ~ [ linux-5.10.228 ] ~ [ linux-5.9.16 ] ~ [ linux-5.8.18 ] ~ [ linux-5.7.19 ] ~ [ linux-5.6.19 ] ~ [ linux-5.5.19 ] ~ [ linux-5.4.284 ] ~ [ linux-5.3.18 ] ~ [ linux-5.2.21 ] ~ [ linux-5.1.21 ] ~ [ linux-5.0.21 ] ~ [ linux-4.20.17 ] ~ [ linux-4.19.322 ] ~ [ linux-4.18.20 ] ~ [ linux-4.17.19 ] ~ [ linux-4.16.18 ] ~ [ linux-4.15.18 ] ~ [ linux-4.14.336 ] ~ [ linux-4.13.16 ] ~ [ linux-4.12.14 ] ~ [ linux-4.11.12 ] ~ [ linux-4.10.17 ] ~ [ linux-4.9.337 ] ~ [ linux-4.4.302 ] ~ [ linux-3.10.108 ] ~ [ linux-2.6.32.71 ] ~ [ linux-2.6.0 ] ~ [ linux-2.4.37.11 ] ~ [ unix-v6-master ] ~ [ ccs-tools-1.8.9 ] ~ [ policy-sample ] ~
Architecture: ~ [ i386 ] ~ [ alpha ] ~ [ m68k ] ~ [ mips ] ~ [ ppc ] ~ [ sparc ] ~ [ sparc64 ] ~

  1 /* SPDX-License-Identifier: GPL-2.0 */
  2 
  3 /*
  4  * Copyright (c) 2021, Google LLC.
  5  * Pasha Tatashin <pasha.tatashin@soleen.com>
  6  */
  7 #ifndef __LINUX_PAGE_TABLE_CHECK_H
  8 #define __LINUX_PAGE_TABLE_CHECK_H
  9 
 10 #ifdef CONFIG_PAGE_TABLE_CHECK
 11 #include <linux/jump_label.h>
 12 
 13 extern struct static_key_true page_table_check_disabled;
 14 extern struct page_ext_operations page_table_check_ops;
 15 
 16 void __page_table_check_zero(struct page *page, unsigned int order);
 17 void __page_table_check_pte_clear(struct mm_struct *mm, pte_t pte);
 18 void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd);
 19 void __page_table_check_pud_clear(struct mm_struct *mm, pud_t pud);
 20 void __page_table_check_ptes_set(struct mm_struct *mm, pte_t *ptep, pte_t pte,
 21                 unsigned int nr);
 22 void __page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp, pmd_t pmd);
 23 void __page_table_check_pud_set(struct mm_struct *mm, pud_t *pudp, pud_t pud);
 24 void __page_table_check_pte_clear_range(struct mm_struct *mm,
 25                                         unsigned long addr,
 26                                         pmd_t pmd);
 27 
 28 static inline void page_table_check_alloc(struct page *page, unsigned int order)
 29 {
 30         if (static_branch_likely(&page_table_check_disabled))
 31                 return;
 32 
 33         __page_table_check_zero(page, order);
 34 }
 35 
 36 static inline void page_table_check_free(struct page *page, unsigned int order)
 37 {
 38         if (static_branch_likely(&page_table_check_disabled))
 39                 return;
 40 
 41         __page_table_check_zero(page, order);
 42 }
 43 
 44 static inline void page_table_check_pte_clear(struct mm_struct *mm, pte_t pte)
 45 {
 46         if (static_branch_likely(&page_table_check_disabled))
 47                 return;
 48 
 49         __page_table_check_pte_clear(mm, pte);
 50 }
 51 
 52 static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd)
 53 {
 54         if (static_branch_likely(&page_table_check_disabled))
 55                 return;
 56 
 57         __page_table_check_pmd_clear(mm, pmd);
 58 }
 59 
 60 static inline void page_table_check_pud_clear(struct mm_struct *mm, pud_t pud)
 61 {
 62         if (static_branch_likely(&page_table_check_disabled))
 63                 return;
 64 
 65         __page_table_check_pud_clear(mm, pud);
 66 }
 67 
 68 static inline void page_table_check_ptes_set(struct mm_struct *mm,
 69                 pte_t *ptep, pte_t pte, unsigned int nr)
 70 {
 71         if (static_branch_likely(&page_table_check_disabled))
 72                 return;
 73 
 74         __page_table_check_ptes_set(mm, ptep, pte, nr);
 75 }
 76 
 77 static inline void page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp,
 78                                             pmd_t pmd)
 79 {
 80         if (static_branch_likely(&page_table_check_disabled))
 81                 return;
 82 
 83         __page_table_check_pmd_set(mm, pmdp, pmd);
 84 }
 85 
 86 static inline void page_table_check_pud_set(struct mm_struct *mm, pud_t *pudp,
 87                                             pud_t pud)
 88 {
 89         if (static_branch_likely(&page_table_check_disabled))
 90                 return;
 91 
 92         __page_table_check_pud_set(mm, pudp, pud);
 93 }
 94 
 95 static inline void page_table_check_pte_clear_range(struct mm_struct *mm,
 96                                                     unsigned long addr,
 97                                                     pmd_t pmd)
 98 {
 99         if (static_branch_likely(&page_table_check_disabled))
100                 return;
101 
102         __page_table_check_pte_clear_range(mm, addr, pmd);
103 }
104 
105 #else
106 
107 static inline void page_table_check_alloc(struct page *page, unsigned int order)
108 {
109 }
110 
111 static inline void page_table_check_free(struct page *page, unsigned int order)
112 {
113 }
114 
115 static inline void page_table_check_pte_clear(struct mm_struct *mm, pte_t pte)
116 {
117 }
118 
119 static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd)
120 {
121 }
122 
123 static inline void page_table_check_pud_clear(struct mm_struct *mm, pud_t pud)
124 {
125 }
126 
127 static inline void page_table_check_ptes_set(struct mm_struct *mm,
128                 pte_t *ptep, pte_t pte, unsigned int nr)
129 {
130 }
131 
132 static inline void page_table_check_pmd_set(struct mm_struct *mm, pmd_t *pmdp,
133                                             pmd_t pmd)
134 {
135 }
136 
137 static inline void page_table_check_pud_set(struct mm_struct *mm, pud_t *pudp,
138                                             pud_t pud)
139 {
140 }
141 
142 static inline void page_table_check_pte_clear_range(struct mm_struct *mm,
143                                                     unsigned long addr,
144                                                     pmd_t pmd)
145 {
146 }
147 
148 #endif /* CONFIG_PAGE_TABLE_CHECK */
149 #endif /* __LINUX_PAGE_TABLE_CHECK_H */
150 

~ [ source navigation ] ~ [ diff markup ] ~ [ identifier search ] ~

kernel.org | git.kernel.org | LWN.net | Project Home | SVN repository | Mail admin

Linux® is a registered trademark of Linus Torvalds in the United States and other countries.
TOMOYO® is a registered trademark of NTT DATA CORPORATION.

sflogo.php