File tree Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Expand file tree Collapse file tree 1 file changed +8
-0
lines changed Original file line number Diff line number Diff line change 14
14
#define pr_fmt (fmt ) "dart io-pgtable: " fmt
15
15
16
16
#include <linux/atomic.h>
17
+ #include <linux/bitfield.h>
17
18
#include <linux/bitops.h>
18
19
#include <linux/io-pgtable.h>
19
20
#include <linux/kernel.h>
40
41
#define DART_PTES_PER_TABLE (d ) \
41
42
(DART_GRANULE(d) >> ilog2(sizeof(dart_iopte)))
42
43
44
+ #define APPLE_DART_PTE_SUBPAGE_START GENMASK_ULL(63, 52)
45
+ #define APPLE_DART_PTE_SUBPAGE_END GENMASK_ULL(51, 40)
46
+
43
47
#define APPLE_DART1_PADDR_MASK GENMASK_ULL(35, 12)
44
48
45
49
/* Apple DART1 protection bits */
@@ -107,6 +111,10 @@ static int dart_init_pte(struct dart_io_pgtable *data,
107
111
return - EEXIST ;
108
112
}
109
113
114
+ /* subpage protection: always allow access to the entire page */
115
+ pte |= FIELD_PREP (APPLE_DART_PTE_SUBPAGE_START , 0 );
116
+ pte |= FIELD_PREP (APPLE_DART_PTE_SUBPAGE_END , 0xfff );
117
+
110
118
pte |= APPLE_DART1_PTE_PROT_SP_DIS ;
111
119
pte |= APPLE_DART_PTE_VALID ;
112
120
You can’t perform that action at this time.
0 commit comments