Commit a5ad8378 authored by Arnd Bergmann's avatar Arnd Bergmann
Browse files

sparc64: remove CONFIG_SET_FS support



sparc64 uses address space identifiers to differentiate between kernel
and user space, using ASI_P for kernel threads but ASI_AIUS for normal
user space, with the option of changing between them.

As nothing really changes the ASI any more, just hardcode ASI_AIUS
everywhere. Kernel threads are not allowed to access __user pointers
anyway.

Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
parent 5a06fcb1
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -46,7 +46,6 @@ config SPARC
	select LOCKDEP_SMALL if LOCKDEP
	select NEED_DMA_MAP_STATE
	select NEED_SG_DMA_LENGTH
	select SET_FS
	select TRACE_IRQFLAGS_SUPPORT

config SPARC32
@@ -59,6 +58,7 @@ config SPARC32
	select HAVE_UID16
	select OLD_SIGACTION
	select ZONE_DMA
	select SET_FS

config SPARC64
	def_bool 64BIT
+0 −4
Original line number Diff line number Diff line
@@ -47,10 +47,6 @@

#ifndef __ASSEMBLY__

typedef struct {
	unsigned char seg;
} mm_segment_t;

/* The Sparc processor specific thread struct. */
/* XXX This should die, everything can go into thread_info now. */
struct thread_struct {
+1 −3
Original line number Diff line number Diff line
@@ -20,10 +20,8 @@ do { \
	 */
#define switch_to(prev, next, last)					\
do {	save_and_clear_fpu();						\
	/* If you are tempted to conditionalize the following */	\
	/* so that ASI is only written if it changes, think again. */	\
	__asm__ __volatile__("wr %%g0, %0, %%asi"			\
	: : "r" (task_thread_info(next)->current_ds));\
	: : "r" (ASI_AIUS));						\
	trap_block[current_thread_info()->cpu].thread =			\
		task_thread_info(next);					\
	__asm__ __volatile__(						\
+1 −3
Original line number Diff line number Diff line
@@ -46,7 +46,7 @@ struct thread_info {
	struct pt_regs		*kregs;
	int			preempt_count;	/* 0 => preemptable, <0 => BUG */
	__u8			new_child;
	__u8			current_ds;
	__u8			__pad;
	__u16			cpu;

	unsigned long		*utraps;
@@ -81,7 +81,6 @@ struct thread_info {
#define TI_KREGS	0x00000028
#define TI_PRE_COUNT	0x00000030
#define TI_NEW_CHILD	0x00000034
#define TI_CURRENT_DS	0x00000035
#define TI_CPU		0x00000036
#define TI_UTRAPS	0x00000038
#define TI_REG_WINDOW	0x00000040
@@ -116,7 +115,6 @@ struct thread_info {
#define INIT_THREAD_INFO(tsk)				\
{							\
	.task		=	&tsk,			\
	.current_ds	=	ASI_P,			\
	.preempt_count	=	INIT_PREEMPT_COUNT,	\
	.kregs		=	(struct pt_regs *)(init_stack+THREAD_SIZE)-1 \
}
+1 −19
Original line number Diff line number Diff line
@@ -12,33 +12,15 @@
#include <asm/spitfire.h>

#include <asm/processor.h>
#include <asm-generic/access_ok.h>

/*
 * Sparc64 is segmented, though more like the M68K than the I386.
 * We use the secondary ASI to address user memory, which references a
 * completely different VM map, thus there is zero chance of the user
 * doing something queer and tricking us into poking kernel memory.
 *
 * What is left here is basically what is needed for the other parts of
 * the kernel that expect to be able to manipulate, erum, "segments".
 * Or perhaps more properly, permissions.
 *
 * "For historical reasons, these macros are grossly misnamed." -Linus
 */

#define KERNEL_DS   ((mm_segment_t) { ASI_P })
#define USER_DS     ((mm_segment_t) { ASI_AIUS })	/* har har har */

#define get_fs() ((mm_segment_t){(current_thread_info()->current_ds)})

#include <asm-generic/access_ok.h>

#define set_fs(val)								\
do {										\
	current_thread_info()->current_ds = (val).seg;				\
	__asm__ __volatile__ ("wr %%g0, %0, %%asi" : : "r" ((val).seg));	\
} while(0)

/*
 * Test whether a block of memory is a valid user space address.
 * Returns 0 if the range is valid, nonzero otherwise.
Loading