File tree Expand file tree Collapse file tree 9 files changed +10
-40
lines changed Expand file tree Collapse file tree 9 files changed +10
-40
lines changed Original file line number Diff line number Diff line change @@ -48,11 +48,6 @@ static inline bool pte_user(pte_t pte)
48
48
#define _PAGE_CHG_MASK (PTE_RPN_MASK | _PAGE_HASHPTE | _PAGE_DIRTY | \
49
49
_PAGE_ACCESSED | _PAGE_SPECIAL)
50
50
51
- /* Mask of bits returned by pte_pgprot() */
52
- #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
53
- _PAGE_WRITETHRU | _PAGE_USER | _PAGE_ACCESSED | \
54
- _PAGE_RW | _PAGE_DIRTY)
55
-
56
51
/*
57
52
* We define 2 sets of base prot bits, one for basic pages (ie,
58
53
* cacheable kernel and user pages) and one for non cacheable
@@ -396,7 +391,6 @@ static inline int pte_young(pte_t pte) { return !!(pte_val(pte) & _PAGE_ACCESSE
396
391
static inline int pte_special (pte_t pte ) { return !!(pte_val (pte ) & _PAGE_SPECIAL ); }
397
392
static inline int pte_none (pte_t pte ) { return (pte_val (pte ) & ~_PTE_NONE_MASK ) == 0 ; }
398
393
static inline bool pte_exec (pte_t pte ) { return true; }
399
- static inline pgprot_t pte_pgprot (pte_t pte ) { return __pgprot (pte_val (pte ) & PAGE_PROT_BITS ); }
400
394
401
395
static inline int pte_present (pte_t pte )
402
396
{
Original file line number Diff line number Diff line change 128
128
129
129
#define H_PTE_PKEY (H_PTE_PKEY_BIT0 | H_PTE_PKEY_BIT1 | H_PTE_PKEY_BIT2 | \
130
130
H_PTE_PKEY_BIT3 | H_PTE_PKEY_BIT4)
131
- /*
132
- * Mask of bits returned by pte_pgprot()
133
- */
134
- #define PAGE_PROT_BITS (_PAGE_SAO | _PAGE_NON_IDEMPOTENT | _PAGE_TOLERANT | \
135
- H_PAGE_4K_PFN | _PAGE_PRIVILEGED | _PAGE_ACCESSED | \
136
- _PAGE_READ | _PAGE_WRITE | _PAGE_DIRTY | _PAGE_EXEC | \
137
- _PAGE_SOFT_DIRTY | H_PTE_PKEY)
138
131
/*
139
132
* We define 2 sets of base prot bits, one for basic pages (ie,
140
133
* cacheable kernel and user pages) and one for non cacheable
@@ -496,7 +489,6 @@ static inline bool pte_exec(pte_t pte)
496
489
return !!(pte_raw (pte ) & cpu_to_be64 (_PAGE_EXEC ));
497
490
}
498
491
499
- static inline pgprot_t pte_pgprot (pte_t pte ) { return __pgprot (pte_val (pte ) & PAGE_PROT_BITS ); }
500
492
501
493
#ifdef CONFIG_HAVE_ARCH_SOFT_DIRTY
502
494
static inline bool pte_soft_dirty (pte_t pte )
Original file line number Diff line number Diff line change 73
73
/* Until my rework is finished, 40x still needs atomic PTE updates */
74
74
#define PTE_ATOMIC_UPDATES 1
75
75
76
- /* Mask of bits returned by pte_pgprot() */
77
- #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_NO_CACHE | \
78
- _PAGE_WRITETHRU | _PAGE_USER | _PAGE_ACCESSED | \
79
- _PAGE_RW | _PAGE_HWWRITE | _PAGE_DIRTY | _PAGE_EXEC)
80
-
81
76
#define _PAGE_BASE_NC (_PAGE_PRESENT | _PAGE_ACCESSED)
82
77
#define _PAGE_BASE (_PAGE_BASE_NC)
83
78
Original file line number Diff line number Diff line change 93
93
#define _PAGE_KERNEL_RW (_PAGE_DIRTY | _PAGE_RW)
94
94
#define _PAGE_KERNEL_RWX (_PAGE_DIRTY | _PAGE_RW | _PAGE_EXEC)
95
95
96
- /* Mask of bits returned by pte_pgprot() */
97
- #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
98
- _PAGE_WRITETHRU | _PAGE_USER | _PAGE_ACCESSED | \
99
- _PAGE_RW | _PAGE_DIRTY | _PAGE_EXEC)
100
-
101
96
/* TODO: Add large page lowmem mapping support */
102
97
#define _PMD_PRESENT 0
103
98
#define _PMD_PRESENT_MASK (PAGE_MASK)
Original file line number Diff line number Diff line change 55
55
#define _PAGE_KERNEL_RW (_PAGE_SH | _PAGE_DIRTY)
56
56
#define _PAGE_KERNEL_RWX (_PAGE_SH | _PAGE_DIRTY | _PAGE_EXEC)
57
57
58
- /* Mask of bits returned by pte_pgprot() */
59
- #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_NO_CACHE | \
60
- _PAGE_ACCESSED | _PAGE_RO | _PAGE_NA | \
61
- _PAGE_SH | _PAGE_DIRTY | _PAGE_EXEC)
62
-
63
58
#define _PMD_PRESENT 0x0001
64
59
#define _PMD_PRESENT_MASK _PMD_PRESENT
65
60
#define _PMD_BAD 0x0fd0
Original file line number Diff line number Diff line change 39
39
/* No page size encoding in the linux PTE */
40
40
#define _PAGE_PSIZE 0
41
41
42
- /* Mask of bits returned by pte_pgprot() */
43
- #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
44
- _PAGE_WRITETHRU | _PAGE_USER | _PAGE_ACCESSED | \
45
- _PAGE_RW | _PAGE_DIRTY | _PAGE_EXEC)
46
-
47
42
#define _PMD_PRESENT 0
48
43
#define _PMD_PRESENT_MASK (PAGE_MASK)
49
44
#define _PMD_BAD (~PAGE_MASK)
Original file line number Diff line number Diff line change @@ -52,7 +52,6 @@ static inline int pte_none(pte_t pte) { return (pte_val(pte) & ~_PTE_NONE_MASK)
52
52
static inline bool pte_hashpte (pte_t pte ) { return false; }
53
53
static inline bool pte_ci (pte_t pte ) { return pte_val (pte ) & _PAGE_NO_CACHE ; }
54
54
static inline bool pte_exec (pte_t pte ) { return pte_val (pte ) & _PAGE_EXEC ; }
55
- static inline pgprot_t pte_pgprot (pte_t pte ) { return __pgprot (pte_val (pte ) & PAGE_PROT_BITS ); }
56
55
57
56
#ifdef CONFIG_NUMA_BALANCING
58
57
/*
Original file line number Diff line number Diff line change 82
82
#define _PTE_NONE_MASK 0
83
83
#endif
84
84
85
- /* Mask of bits returned by pte_pgprot() */
86
- #define PAGE_PROT_BITS (_PAGE_GUARDED | _PAGE_COHERENT | _PAGE_NO_CACHE | \
87
- _PAGE_WRITETHRU | _PAGE_USER | _PAGE_ACCESSED | \
88
- _PAGE_PRIVILEGED | _PAGE_RW | _PAGE_DIRTY | _PAGE_EXEC)
89
-
90
85
/*
91
86
* We define 2 sets of base prot bits, one for basic pages (ie,
92
87
* cacheable kernel and user pages) and one for non cacheable
Original file line number Diff line number Diff line change @@ -46,6 +46,16 @@ struct mm_struct;
46
46
/* Keep these as a macros to avoid include dependency mess */
47
47
#define pte_page (x ) pfn_to_page(pte_pfn(x))
48
48
#define mk_pte (page , pgprot ) pfn_pte(page_to_pfn(page), (pgprot))
49
+ /*
50
+ * Select all bits except the pfn
51
+ */
52
+ static inline pgprot_t pte_pgprot (pte_t pte )
53
+ {
54
+ unsigned long pte_flags ;
55
+
56
+ pte_flags = pte_val (pte ) & ~PTE_RPN_MASK ;
57
+ return __pgprot (pte_flags );
58
+ }
49
59
50
60
/*
51
61
* ZERO_PAGE is a global shared page that is always zero: used
You can’t perform that action at this time.
0 commit comments