Skip to content

Commit 987a087

Browse files
committed
Merge git://git.kernel.org:/pub/scm/linux/kernel/git/davem/sparc
Pull sparc updates from David Miller: "Just some more random bits from Al, including a conversion over to generic extables" * git://git.kernel.org:/pub/scm/linux/kernel/git/davem/sparc: sparc32: take ->thread.flags out sparc32: get rid of fake_swapper_regs sparc64: get rid of fake_swapper_regs sparc32: switch to generic extables sparc32: switch copy_user.S away from range exception table entries sparc32: get rid of range exception table entries in checksum_32.S sparc32: switch __bzero() away from range exception table entries sparc32: kill lookup_fault() sparc32: don't bother with lookup_fault() in __bzero()
2 parents 144c79e + cf64c2a commit 987a087

File tree

21 files changed

+198
-647
lines changed

21 files changed

+198
-647
lines changed

arch/sparc/include/asm/elf_64.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@
88

99
#include <asm/ptrace.h>
1010
#include <asm/processor.h>
11-
#include <asm/extable_64.h>
1211
#include <asm/spitfire.h>
1312
#include <asm/adi.h>
1413

arch/sparc/include/asm/extable_64.h renamed to arch/sparc/include/asm/extable.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
2-
#ifndef __ASM_EXTABLE64_H
3-
#define __ASM_EXTABLE64_H
2+
#ifndef __ASM_EXTABLE_H
3+
#define __ASM_EXTABLE_H
44
/*
55
* The exception table consists of pairs of addresses: the first is the
66
* address of an instruction that is allowed to fault, and the second is

arch/sparc/include/asm/processor_32.h

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,16 +50,12 @@ struct thread_struct {
5050
unsigned long fsr;
5151
unsigned long fpqdepth;
5252
struct fpq fpqueue[16];
53-
unsigned long flags;
5453
mm_segment_t current_ds;
5554
};
5655

57-
#define SPARC_FLAG_KTHREAD 0x1 /* task is a kernel thread */
58-
#define SPARC_FLAG_UNALIGNED 0x2 /* is allowed to do unaligned accesses */
59-
6056
#define INIT_THREAD { \
61-
.flags = SPARC_FLAG_KTHREAD, \
6257
.current_ds = KERNEL_DS, \
58+
.kregs = (struct pt_regs *)(init_stack+THREAD_SIZE)-1 \
6359
}
6460

6561
/* Do necessary setup to start up a newly executed thread. */

arch/sparc/include/asm/thread_info_64.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -118,6 +118,7 @@ struct thread_info {
118118
.task = &tsk, \
119119
.current_ds = ASI_P, \
120120
.preempt_count = INIT_PREEMPT_COUNT, \
121+
.kregs = (struct pt_regs *)(init_stack+THREAD_SIZE)-1 \
121122
}
122123

123124
/* how to get the thread information struct from C */

arch/sparc/include/asm/uaccess.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,9 @@
11
/* SPDX-License-Identifier: GPL-2.0 */
22
#ifndef ___ASM_SPARC_UACCESS_H
33
#define ___ASM_SPARC_UACCESS_H
4+
5+
#include <asm/extable.h>
6+
47
#if defined(__sparc__) && defined(__arch64__)
58
#include <asm/uaccess_64.h>
69
#else

arch/sparc/include/asm/uaccess_32.h

Lines changed: 0 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,6 @@
1313

1414
#include <asm/processor.h>
1515

16-
#define ARCH_HAS_SORT_EXTABLE
17-
#define ARCH_HAS_SEARCH_EXTABLE
18-
1916
/* Sparc is not segmented, however we need to be able to fool access_ok()
2017
* when doing system calls from kernel mode legitimately.
2118
*
@@ -40,36 +37,6 @@
4037
#define __access_ok(addr, size) (__user_ok((addr) & get_fs().seg, (size)))
4138
#define access_ok(addr, size) __access_ok((unsigned long)(addr), size)
4239

43-
/*
44-
* The exception table consists of pairs of addresses: the first is the
45-
* address of an instruction that is allowed to fault, and the second is
46-
* the address at which the program should continue. No registers are
47-
* modified, so it is entirely up to the continuation code to figure out
48-
* what to do.
49-
*
50-
* All the routines below use bits of fixup code that are out of line
51-
* with the main instruction path. This means when everything is well,
52-
* we don't even have to jump over them. Further, they do not intrude
53-
* on our cache or tlb entries.
54-
*
55-
* There is a special way how to put a range of potentially faulting
56-
* insns (like twenty ldd/std's with now intervening other instructions)
57-
* You specify address of first in insn and 0 in fixup and in the next
58-
* exception_table_entry you specify last potentially faulting insn + 1
59-
* and in fixup the routine which should handle the fault.
60-
* That fixup code will get
61-
* (faulting_insn_address - first_insn_in_the_range_address)/4
62-
* in %g2 (ie. index of the faulting instruction in the range).
63-
*/
64-
65-
struct exception_table_entry
66-
{
67-
unsigned long insn, fixup;
68-
};
69-
70-
/* Returns 0 if exception not found and fixup otherwise. */
71-
unsigned long search_extables_range(unsigned long addr, unsigned long *g2);
72-
7340
/* Uh, these should become the main single-value transfer routines..
7441
* They automatically use the right size if we just have the right
7542
* pointer type..
@@ -252,12 +219,7 @@ static inline unsigned long __clear_user(void __user *addr, unsigned long size)
252219
unsigned long ret;
253220

254221
__asm__ __volatile__ (
255-
".section __ex_table,#alloc\n\t"
256-
".align 4\n\t"
257-
".word 1f,3\n\t"
258-
".previous\n\t"
259222
"mov %2, %%o1\n"
260-
"1:\n\t"
261223
"call __bzero\n\t"
262224
" mov %1, %%o0\n\t"
263225
"mov %%o0, %0\n"

arch/sparc/include/asm/uaccess_64.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@
1010
#include <linux/string.h>
1111
#include <asm/asi.h>
1212
#include <asm/spitfire.h>
13-
#include <asm/extable_64.h>
1413

1514
#include <asm/processor.h>
1615

arch/sparc/kernel/head_32.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -515,7 +515,7 @@ continue_boot:
515515

516516
/* I want a kernel stack NOW! */
517517
set init_thread_union, %g1
518-
set (THREAD_SIZE - STACKFRAME_SZ), %g2
518+
set (THREAD_SIZE - STACKFRAME_SZ - TRACEREG_SZ), %g2
519519
add %g1, %g2, %sp
520520
mov 0, %fp /* And for good luck */
521521

arch/sparc/kernel/head_64.S

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ tlb_fixup_done:
706706
wr %g0, ASI_P, %asi
707707
mov 1, %g1
708708
sllx %g1, THREAD_SHIFT, %g1
709-
sub %g1, (STACKFRAME_SZ + STACK_BIAS), %g1
709+
sub %g1, (STACKFRAME_SZ + STACK_BIAS + TRACEREG_SZ), %g1
710710
add %g6, %g1, %sp
711711

712712
/* Set per-cpu pointer initially to zero, this makes

arch/sparc/kernel/process_32.c

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -216,16 +216,6 @@ void flush_thread(void)
216216
clear_thread_flag(TIF_USEDFPU);
217217
#endif
218218
}
219-
220-
/* This task is no longer a kernel thread. */
221-
if (current->thread.flags & SPARC_FLAG_KTHREAD) {
222-
current->thread.flags &= ~SPARC_FLAG_KTHREAD;
223-
224-
/* We must fixup kregs as well. */
225-
/* XXX This was not fixed for ti for a while, worked. Unused? */
226-
current->thread.kregs = (struct pt_regs *)
227-
(task_stack_page(current) + (THREAD_SIZE - TRACEREG_SZ));
228-
}
229219
}
230220

231221
static inline struct sparc_stackf __user *
@@ -313,7 +303,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg,
313303
extern int nwindows;
314304
unsigned long psr;
315305
memset(new_stack, 0, STACKFRAME_SZ + TRACEREG_SZ);
316-
p->thread.flags |= SPARC_FLAG_KTHREAD;
317306
p->thread.current_ds = KERNEL_DS;
318307
ti->kpc = (((unsigned long) ret_from_kernel_thread) - 0x8);
319308
childregs->u_regs[UREG_G1] = sp; /* function */
@@ -325,7 +314,6 @@ int copy_thread(unsigned long clone_flags, unsigned long sp, unsigned long arg,
325314
}
326315
memcpy(new_stack, (char *)regs - STACKFRAME_SZ, STACKFRAME_SZ + TRACEREG_SZ);
327316
childregs->u_regs[UREG_FP] = sp;
328-
p->thread.flags &= ~SPARC_FLAG_KTHREAD;
329317
p->thread.current_ds = USER_DS;
330318
ti->kpc = (((unsigned long) ret_from_fork) - 0x8);
331319
ti->kpsr = current->thread.fork_kpsr | PSR_PIL;

0 commit comments

Comments
 (0)