Re: [PATCH 10/14] uaccess: remove most CONFIG_SET_FS users

2022-02-14 Thread Arnd Bergmann
On Mon, Feb 14, 2022 at 6:06 PM Christoph Hellwig  wrote:
>
> On Mon, Feb 14, 2022 at 05:34:48PM +0100, Arnd Bergmann wrote:
> > From: Arnd Bergmann 
> >
> > On almost all architectures, there are no remaining callers
> > of set_fs(), so CONFIG_SET_FS can be disabled, along with
> > removing the thread_info field and any references to it.
> >
> > This turns access_ok() into a cheaper check against TASK_SIZE_MAX.
>
> Wouldn't it make more sense to just merge this into the last patch?

Yes, sounds good. I wasn't sure at first if there is enough buy-in to get
all architectures cleaned up, and I hadn't done the ia64 patch, so it
seemed more important to do this part early, but now it seems that it
will all go in at the same time, so doing this as part of a big removal
at the end makes sense.

Arnd


Re: [PATCH 10/14] uaccess: remove most CONFIG_SET_FS users

2022-02-14 Thread Christoph Hellwig
On Mon, Feb 14, 2022 at 05:34:48PM +0100, Arnd Bergmann wrote:
> From: Arnd Bergmann 
> 
> On almost all architectures, there are no remaining callers
> of set_fs(), so CONFIG_SET_FS can be disabled, along with
> removing the thread_info field and any references to it.
> 
> This turns access_ok() into a cheaper check against TASK_SIZE_MAX.

Wouldn't it make more sense to just merge this into the last patch?


[PATCH 10/14] uaccess: remove most CONFIG_SET_FS users

2022-02-14 Thread Arnd Bergmann
From: Arnd Bergmann 

On almost all architectures, there are no remaining callers
of set_fs(), so CONFIG_SET_FS can be disabled, along with
removing the thread_info field and any references to it.

This turns access_ok() into a cheaper check against TASK_SIZE_MAX.

Signed-off-by: Arnd Bergmann 
---
 arch/alpha/Kconfig|  1 -
 arch/alpha/include/asm/processor.h|  4 --
 arch/alpha/include/asm/thread_info.h  |  2 -
 arch/alpha/include/asm/uaccess.h  | 19 --
 arch/arc/Kconfig  |  1 -
 arch/arc/include/asm/segment.h| 20 ---
 arch/arc/include/asm/thread_info.h|  3 -
 arch/arc/include/asm/uaccess.h|  1 -
 arch/csky/Kconfig |  1 -
 arch/csky/include/asm/processor.h |  2 -
 arch/csky/include/asm/segment.h   | 10 
 arch/csky/include/asm/thread_info.h   |  2 -
 arch/csky/include/asm/uaccess.h   |  3 -
 arch/csky/kernel/asm-offsets.c|  1 -
 arch/h8300/Kconfig|  1 -
 arch/h8300/include/asm/processor.h|  1 -
 arch/h8300/include/asm/segment.h  | 40 -
 arch/h8300/include/asm/thread_info.h  |  3 -
 arch/h8300/kernel/entry.S |  1 -
 arch/h8300/kernel/head_ram.S  |  1 -
 arch/h8300/mm/init.c  |  6 --
 arch/h8300/mm/memory.c|  1 -
 arch/hexagon/Kconfig  |  1 -
 arch/hexagon/include/asm/thread_info.h|  6 --
 arch/hexagon/kernel/process.c |  1 -
 arch/microblaze/Kconfig   |  1 -
 arch/microblaze/include/asm/thread_info.h |  6 --
 arch/microblaze/include/asm/uaccess.h | 24 
 arch/microblaze/kernel/asm-offsets.c  |  1 -
 arch/microblaze/kernel/process.c  |  1 -
 arch/nds32/Kconfig|  1 -
 arch/nds32/include/asm/thread_info.h  |  4 --
 arch/nds32/include/asm/uaccess.h  | 15 +
 arch/nds32/mm/alignment.c |  3 -
 arch/nios2/Kconfig|  1 -
 arch/nios2/include/asm/thread_info.h  |  9 ---
 arch/nios2/include/asm/uaccess.h  | 12 
 arch/openrisc/Kconfig |  1 -
 arch/openrisc/include/asm/thread_info.h   |  7 ---
 arch/openrisc/include/asm/uaccess.h   | 23 
 arch/sparc/Kconfig|  2 +-
 arch/sparc/include/asm/processor_32.h |  6 --
 arch/sparc/include/asm/uaccess_32.h   | 13 -
 arch/sparc/kernel/process_32.c|  2 -
 arch/xtensa/Kconfig   |  1 -
 arch/xtensa/include/asm/asm-uaccess.h | 71 ---
 arch/xtensa/include/asm/processor.h   |  7 ---
 arch/xtensa/include/asm/thread_info.h |  3 -
 arch/xtensa/include/asm/uaccess.h | 16 -
 arch/xtensa/kernel/asm-offsets.c  |  3 -
 include/asm-generic/uaccess.h | 25 +---
 51 files changed, 3 insertions(+), 387 deletions(-)
 delete mode 100644 arch/arc/include/asm/segment.h
 delete mode 100644 arch/csky/include/asm/segment.h
 delete mode 100644 arch/h8300/include/asm/segment.h

diff --git a/arch/alpha/Kconfig b/arch/alpha/Kconfig
index 4e87783c90ad..eee8b5b0a58b 100644
--- a/arch/alpha/Kconfig
+++ b/arch/alpha/Kconfig
@@ -35,7 +35,6 @@ config ALPHA
select OLD_SIGSUSPEND
select CPU_NO_EFFICIENT_FFS if !ALPHA_EV67
select MMU_GATHER_NO_RANGE
-   select SET_FS
select SPARSEMEM_EXTREME if SPARSEMEM
select ZONE_DMA
help
diff --git a/arch/alpha/include/asm/processor.h 
b/arch/alpha/include/asm/processor.h
index 090499c99c1c..43e234c518b1 100644
--- a/arch/alpha/include/asm/processor.h
+++ b/arch/alpha/include/asm/processor.h
@@ -26,10 +26,6 @@
 #define TASK_UNMAPPED_BASE \
   ((current->personality & ADDR_LIMIT_32BIT) ? 0x4000 : TASK_SIZE / 2)
 
-typedef struct {
-   unsigned long seg;
-} mm_segment_t;
-
 /* This is dead.  Everything has been moved to thread_info.  */
 struct thread_struct { };
 #define INIT_THREAD  { }
diff --git a/arch/alpha/include/asm/thread_info.h 
b/arch/alpha/include/asm/thread_info.h
index 2592356e3215..fdc485d7787a 100644
--- a/arch/alpha/include/asm/thread_info.h
+++ b/arch/alpha/include/asm/thread_info.h
@@ -19,7 +19,6 @@ struct thread_info {
unsigned intflags;  /* low level flags */
unsigned intieee_state; /* see fpu.h */
 
-   mm_segment_taddr_limit; /* thread address space */
unsignedcpu;/* current CPU */
int preempt_count; /* 0 => preemptable, <0 => BUG */
unsigned intstatus; /* thread-synchronous flags */
@@ -35,7 +34,6 @@ struct thread_info {
 #define INIT_THREAD_INFO(tsk)  \
 {  \
.task   = , \
-   .addr_limit = KERNEL_DS,\