Skip to content

Commit 9b0d551

Browse files
committed
Merge tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs
Pull misc non-vfs updates from Al Viro: "Assorted dead code removal around asm/pgtable.h" * tag 'pull-misc' of git://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs: alpha: unobfuscate _PAGE_P() definition kill FIRST_USER_PGD_NR alpha: get rid of the remnants of BAD_PAGE and friends SET_PAGE_DIR() users had been gone since 2.3.12pre1 PAGE_PTR() had been last used outside of arch/* in 1.1.94 csky: remove BS check for FAULT_FLAG_ALLOW_RETRY
2 parents 33fc69a + f037fd7 commit 9b0d551

7 files changed

Lines changed: 2 additions & 81 deletions

File tree

arch/alpha/include/asm/pgtable.h

Lines changed: 1 addition & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ struct vm_area_struct;
107107

108108
#define _PAGE_NORMAL(x) __pgprot(_PAGE_VALID | __ACCESS_BITS | (x))
109109

110-
#define _PAGE_P(x) _PAGE_NORMAL((x) | (((x) & _PAGE_FOW)?0:_PAGE_FOW))
110+
#define _PAGE_P(x) _PAGE_NORMAL((x) | _PAGE_FOW)
111111
#define _PAGE_S(x) _PAGE_NORMAL(x)
112112

113113
/*
@@ -126,34 +126,11 @@ struct vm_area_struct;
126126
#define pgprot_noncached(prot) (prot)
127127

128128
/*
129-
* BAD_PAGETABLE is used when we need a bogus page-table, while
130-
* BAD_PAGE is used for a bogus page.
131-
*
132129
* ZERO_PAGE is a global shared page that is always zero: used
133130
* for zero-mapped memory areas etc..
134131
*/
135-
extern pte_t __bad_page(void);
136-
extern pmd_t * __bad_pagetable(void);
137-
138-
extern unsigned long __zero_page(void);
139-
140-
#define BAD_PAGETABLE __bad_pagetable()
141-
#define BAD_PAGE __bad_page()
142132
#define ZERO_PAGE(vaddr) (virt_to_page(ZERO_PGE))
143133

144-
/* number of bits that fit into a memory pointer */
145-
#define BITS_PER_PTR (8*sizeof(unsigned long))
146-
147-
/* to align the pointer to a pointer address */
148-
#define PTR_MASK (~(sizeof(void*)-1))
149-
150-
/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
151-
#define SIZEOF_PTR_LOG2 3
152-
153-
/* to find an entry in a page-table */
154-
#define PAGE_PTR(address) \
155-
((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
156-
157134
/*
158135
* On certain platforms whose physical address space can overlap KSEG,
159136
* namely EV6 and above, we must re-twiddle the physaddr to restore the

arch/alpha/mm/init.c

Lines changed: 0 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -60,33 +60,6 @@ pgd_alloc(struct mm_struct *mm)
6060
}
6161

6262

63-
/*
64-
* BAD_PAGE is the page that is used for page faults when linux
65-
* is out-of-memory. Older versions of linux just did a
66-
* do_exit(), but using this instead means there is less risk
67-
* for a process dying in kernel mode, possibly leaving an inode
68-
* unused etc..
69-
*
70-
* BAD_PAGETABLE is the accompanying page-table: it is initialized
71-
* to point to BAD_PAGE entries.
72-
*
73-
* ZERO_PAGE is a special page that is used for zero-initialized
74-
* data and COW.
75-
*/
76-
pmd_t *
77-
__bad_pagetable(void)
78-
{
79-
memset(absolute_pointer(EMPTY_PGT), 0, PAGE_SIZE);
80-
return (pmd_t *) EMPTY_PGT;
81-
}
82-
83-
pte_t
84-
__bad_page(void)
85-
{
86-
memset(absolute_pointer(EMPTY_PGE), 0, PAGE_SIZE);
87-
return pte_mkdirty(mk_pte(virt_to_page(EMPTY_PGE), PAGE_SHARED));
88-
}
89-
9063
static inline unsigned long
9164
load_PCB(struct pcb_struct *pcb)
9265
{

arch/csky/mm/fault.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ asmlinkage void do_page_fault(struct pt_regs *regs)
277277
if (fault & VM_FAULT_COMPLETED)
278278
return;
279279

280-
if (unlikely((fault & VM_FAULT_RETRY) && (flags & FAULT_FLAG_ALLOW_RETRY))) {
280+
if (unlikely(fault & VM_FAULT_RETRY)) {
281281
flags |= FAULT_FLAG_TRIED;
282282

283283
/*

arch/m68k/include/asm/pgtable_mm.h

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -119,16 +119,6 @@ extern void *empty_zero_page;
119119
*/
120120
#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
121121

122-
/* number of bits that fit into a memory pointer */
123-
#define BITS_PER_PTR (8*sizeof(unsigned long))
124-
125-
/* to align the pointer to a pointer address */
126-
#define PTR_MASK (~(sizeof(void*)-1))
127-
128-
/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
129-
/* 64-bit machines, beware! SRB. */
130-
#define SIZEOF_PTR_LOG2 2
131-
132122
extern void kernel_set_cachemode(void *addr, unsigned long size, int cmode);
133123

134124
/*

arch/microblaze/include/asm/pgtable.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,6 @@ extern pte_t *va_to_pte(unsigned long address);
9999
#define PTRS_PER_PGD (1 << (32 - PGDIR_SHIFT))
100100

101101
#define USER_PTRS_PER_PGD (TASK_SIZE / PGDIR_SIZE)
102-
#define FIRST_USER_PGD_NR 0
103102

104103
#define USER_PGD_PTRS (PAGE_OFFSET >> PGDIR_SHIFT)
105104
#define KERNEL_PGD_PTRS (PTRS_PER_PGD-USER_PGD_PTRS)

arch/openrisc/include/asm/pgtable.h

Lines changed: 0 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -183,23 +183,6 @@ extern void paging_init(void);
183183
extern unsigned long empty_zero_page[2048];
184184
#define ZERO_PAGE(vaddr) (virt_to_page(empty_zero_page))
185185

186-
/* number of bits that fit into a memory pointer */
187-
#define BITS_PER_PTR (8*sizeof(unsigned long))
188-
189-
/* to align the pointer to a pointer address */
190-
#define PTR_MASK (~(sizeof(void *)-1))
191-
192-
/* sizeof(void*)==1<<SIZEOF_PTR_LOG2 */
193-
/* 64-bit machines, beware! SRB. */
194-
#define SIZEOF_PTR_LOG2 2
195-
196-
/* to find an entry in a page-table */
197-
#define PAGE_PTR(address) \
198-
((unsigned long)(address)>>(PAGE_SHIFT-SIZEOF_PTR_LOG2)&PTR_MASK&~PAGE_MASK)
199-
200-
/* to set the page-dir */
201-
#define SET_PAGE_DIR(tsk, pgdir)
202-
203186
#define pte_none(x) (!pte_val(x))
204187
#define pte_present(x) (pte_val(x) & _PAGE_PRESENT)
205188
#define pte_clear(mm, addr, xp) do { pte_val(*(xp)) = 0; } while (0)

arch/xtensa/include/asm/pgtable.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,6 @@
5858
#define PTRS_PER_PTE_SHIFT 10
5959
#define PTRS_PER_PGD 1024
6060
#define USER_PTRS_PER_PGD (TASK_SIZE/PGDIR_SIZE)
61-
#define FIRST_USER_PGD_NR (FIRST_USER_ADDRESS >> PGDIR_SHIFT)
6261

6362
#ifdef CONFIG_MMU
6463
/*

0 commit comments

Comments
 (0)