hc
2023-12-08 01573e231f18eb2d99162747186f59511f56b64d
kernel/arch/arm/include/asm/pgtable-3level.h
....@@ -1,21 +1,9 @@
1
+/* SPDX-License-Identifier: GPL-2.0-only */
12 /*
23 * arch/arm/include/asm/pgtable-3level.h
34 *
45 * Copyright (C) 2011 ARM Ltd.
56 * Author: Catalin Marinas <catalin.marinas@arm.com>
6
- *
7
- * This program is free software; you can redistribute it and/or modify
8
- * it under the terms of the GNU General Public License version 2 as
9
- * published by the Free Software Foundation.
10
- *
11
- * This program is distributed in the hope that it will be useful,
12
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
13
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
- * GNU General Public License for more details.
15
- *
16
- * You should have received a copy of the GNU General Public License
17
- * along with this program; if not, write to the Free Software
18
- * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
197 */
208 #ifndef _ASM_PGTABLE_3LEVEL_H
219 #define _ASM_PGTABLE_3LEVEL_H
....@@ -118,26 +106,6 @@
118106 */
119107 #define L_PGD_SWAPPER (_AT(pgdval_t, 1) << 55) /* swapper_pg_dir entry */
120108
121
-/*
122
- * 2nd stage PTE definitions for LPAE.
123
- */
124
-#define L_PTE_S2_MT_UNCACHED (_AT(pteval_t, 0x0) << 2) /* strongly ordered */
125
-#define L_PTE_S2_MT_WRITETHROUGH (_AT(pteval_t, 0xa) << 2) /* normal inner write-through */
126
-#define L_PTE_S2_MT_WRITEBACK (_AT(pteval_t, 0xf) << 2) /* normal inner write-back */
127
-#define L_PTE_S2_MT_DEV_SHARED (_AT(pteval_t, 0x1) << 2) /* device */
128
-#define L_PTE_S2_MT_MASK (_AT(pteval_t, 0xf) << 2)
129
-
130
-#define L_PTE_S2_RDONLY (_AT(pteval_t, 1) << 6) /* HAP[1] */
131
-#define L_PTE_S2_RDWR (_AT(pteval_t, 3) << 6) /* HAP[2:1] */
132
-
133
-#define L_PMD_S2_RDONLY (_AT(pmdval_t, 1) << 6) /* HAP[1] */
134
-#define L_PMD_S2_RDWR (_AT(pmdval_t, 3) << 6) /* HAP[2:1] */
135
-
136
-/*
137
- * Hyp-mode PL2 PTE definitions for LPAE.
138
- */
139
-#define L_PTE_HYP L_PTE_USER
140
-
141109 #ifndef __ASSEMBLY__
142110
143111 #define pud_none(pud) (!pud_val(pud))
....@@ -148,6 +116,7 @@
148116 #define pmd_sect(pmd) ((pmd_val(pmd) & PMD_TYPE_MASK) == \
149117 PMD_TYPE_SECT)
150118 #define pmd_large(pmd) pmd_sect(pmd)
119
+#define pmd_leaf(pmd) pmd_sect(pmd)
151120
152121 #define pud_clear(pudp) \
153122 do { \
....@@ -164,13 +133,6 @@
164133 static inline pmd_t *pud_page_vaddr(pud_t pud)
165134 {
166135 return __va(pud_val(pud) & PHYS_MASK & (s32)PAGE_MASK);
167
-}
168
-
169
-/* Find an entry in the second-level page table.. */
170
-#define pmd_index(addr) (((addr) >> PMD_SHIFT) & (PTRS_PER_PMD - 1))
171
-static inline pmd_t *pmd_offset(pud_t *pud, unsigned long addr)
172
-{
173
- return (pmd_t *)pud_page_vaddr(*pud) + pmd_index(addr);
174136 }
175137
176138 #define pmd_bad(pmd) (!(pmd_val(pmd) & 2))
....@@ -254,7 +216,7 @@
254216 #define pmdp_establish generic_pmdp_establish
255217
256218 /* represent a notpresent pmd by faulting entry, this is used by pmdp_invalidate */
257
-static inline pmd_t pmd_mknotpresent(pmd_t pmd)
219
+static inline pmd_t pmd_mkinvalid(pmd_t pmd)
258220 {
259221 return __pmd(pmd_val(pmd) & ~L_PMD_SECT_VALID);
260222 }