mm/page_table_check: remove unused parameter in [__]page_table_check_pmd_clear
[linux-2.6-block.git] / include / linux / page_table_check.h
CommitLineData
df4e817b
PT
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
13extern struct static_key_true page_table_check_disabled;
14extern struct page_ext_operations page_table_check_ops;
15
16void __page_table_check_zero(struct page *page, unsigned int order);
aa232204 17void __page_table_check_pte_clear(struct mm_struct *mm, pte_t pte);
1831414c 18void __page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd);
df4e817b
PT
19void __page_table_check_pud_clear(struct mm_struct *mm, unsigned long addr,
20 pud_t pud);
21void __page_table_check_pte_set(struct mm_struct *mm, unsigned long addr,
22 pte_t *ptep, pte_t pte);
23void __page_table_check_pmd_set(struct mm_struct *mm, unsigned long addr,
24 pmd_t *pmdp, pmd_t pmd);
25void __page_table_check_pud_set(struct mm_struct *mm, unsigned long addr,
26 pud_t *pudp, pud_t pud);
80110bbf
PT
27void __page_table_check_pte_clear_range(struct mm_struct *mm,
28 unsigned long addr,
29 pmd_t pmd);
df4e817b
PT
30
31static inline void page_table_check_alloc(struct page *page, unsigned int order)
32{
33 if (static_branch_likely(&page_table_check_disabled))
34 return;
35
36 __page_table_check_zero(page, order);
37}
38
39static inline void page_table_check_free(struct page *page, unsigned int order)
40{
41 if (static_branch_likely(&page_table_check_disabled))
42 return;
43
44 __page_table_check_zero(page, order);
45}
46
aa232204 47static inline void page_table_check_pte_clear(struct mm_struct *mm, pte_t pte)
df4e817b
PT
48{
49 if (static_branch_likely(&page_table_check_disabled))
50 return;
51
aa232204 52 __page_table_check_pte_clear(mm, pte);
df4e817b
PT
53}
54
1831414c 55static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd)
df4e817b
PT
56{
57 if (static_branch_likely(&page_table_check_disabled))
58 return;
59
1831414c 60 __page_table_check_pmd_clear(mm, pmd);
df4e817b
PT
61}
62
63static inline void page_table_check_pud_clear(struct mm_struct *mm,
64 unsigned long addr, pud_t pud)
65{
66 if (static_branch_likely(&page_table_check_disabled))
67 return;
68
69 __page_table_check_pud_clear(mm, addr, pud);
70}
71
72static inline void page_table_check_pte_set(struct mm_struct *mm,
73 unsigned long addr, pte_t *ptep,
74 pte_t pte)
75{
76 if (static_branch_likely(&page_table_check_disabled))
77 return;
78
79 __page_table_check_pte_set(mm, addr, ptep, pte);
80}
81
82static inline void page_table_check_pmd_set(struct mm_struct *mm,
83 unsigned long addr, pmd_t *pmdp,
84 pmd_t pmd)
85{
86 if (static_branch_likely(&page_table_check_disabled))
87 return;
88
89 __page_table_check_pmd_set(mm, addr, pmdp, pmd);
90}
91
92static inline void page_table_check_pud_set(struct mm_struct *mm,
93 unsigned long addr, pud_t *pudp,
94 pud_t pud)
95{
96 if (static_branch_likely(&page_table_check_disabled))
97 return;
98
99 __page_table_check_pud_set(mm, addr, pudp, pud);
100}
101
80110bbf
PT
102static inline void page_table_check_pte_clear_range(struct mm_struct *mm,
103 unsigned long addr,
104 pmd_t pmd)
105{
106 if (static_branch_likely(&page_table_check_disabled))
107 return;
108
109 __page_table_check_pte_clear_range(mm, addr, pmd);
110}
111
df4e817b
PT
112#else
113
114static inline void page_table_check_alloc(struct page *page, unsigned int order)
115{
116}
117
118static inline void page_table_check_free(struct page *page, unsigned int order)
119{
120}
121
aa232204 122static inline void page_table_check_pte_clear(struct mm_struct *mm, pte_t pte)
df4e817b
PT
123{
124}
125
1831414c 126static inline void page_table_check_pmd_clear(struct mm_struct *mm, pmd_t pmd)
df4e817b
PT
127{
128}
129
130static inline void page_table_check_pud_clear(struct mm_struct *mm,
131 unsigned long addr, pud_t pud)
132{
133}
134
135static inline void page_table_check_pte_set(struct mm_struct *mm,
136 unsigned long addr, pte_t *ptep,
137 pte_t pte)
138{
139}
140
141static inline void page_table_check_pmd_set(struct mm_struct *mm,
142 unsigned long addr, pmd_t *pmdp,
143 pmd_t pmd)
144{
145}
146
147static inline void page_table_check_pud_set(struct mm_struct *mm,
148 unsigned long addr, pud_t *pudp,
149 pud_t pud)
150{
151}
152
80110bbf
PT
153static inline void page_table_check_pte_clear_range(struct mm_struct *mm,
154 unsigned long addr,
155 pmd_t pmd)
156{
157}
158
df4e817b
PT
159#endif /* CONFIG_PAGE_TABLE_CHECK */
160#endif /* __LINUX_PAGE_TABLE_CHECK_H */