remove set_fs() for h8300
Hi all,
this series removes support for the deprecated set_fs address space override on h8300. Because h8300 doesn't actually have different address spaces to start with as a pure nommu port the changes are pretty simple.
Compile tested only.
PATCH 1/2 h8300: remove memory.c
None of the empty stubs defined in this file are used or even declared in a header.
--- arch/h8300/mm/Makefile | 2 +- arch/h8300/mm/memory.c | 53 ------------------------------------------ 2 files changed, 1 insertion(+), 54 deletions(-) delete mode 100644 arch/h8300/mm/memory.c
arch/h8300/mm/Makefile +1 -1
@@ -3,4 +3,4 @@ # Makefile for the linux h8300-specific parts of the memory manager. # -obj-y := init.o fault.o memory.o +obj-y := init.o fault.o
arch/h8300/mm/memory.c deleted +0 -53
53 lines not on this page · raw message
Signature · 1 line
2.30.2
PATCH 2/2 h8300: don't implement set_fs
In reply to Christoph HellwigThere is no need for set_fs on this nommu-only architecture, so just remove all the boilerplate code.
--- 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 ----- 7 files changed, 53 deletions(-) delete mode 100644 arch/h8300/include/asm/segment.h
arch/h8300/Kconfig +0 -1
@@ -24,7 +24,6 @@ config H8300 select HAVE_ARCH_KGDB select HAVE_ARCH_HASH select CPU_NO_EFFICIENT_FFS - select SET_FS select UACCESS_MEMCPY config CPU_BIG_ENDIAN
arch/h8300/include/asm/processor.h +0 -1
@@ -13,7 +13,6 @@#define __ASM_H8300_PROCESSOR_H#include <linux/compiler.h> -#include <asm/segment.h> #include <asm/ptrace.h> #include <asm/current.h>
arch/h8300/include/asm/segment.h deleted +0 -40
@@ -1,40 +0,0 @@ -/* SPDX-License-Identifier: GPL-2.0 */ -#ifndef _H8300_SEGMENT_H -#define _H8300_SEGMENT_H - -/* define constants */ -#define USER_DATA (1) -#ifndef __USER_DS -#define __USER_DS (USER_DATA) -#endif -#define USER_PROGRAM (2) -#define SUPER_DATA (3) -#ifndef __KERNEL_DS -#define __KERNEL_DS (SUPER_DATA) -#endif -#define SUPER_PROGRAM (4) - -#ifndef __ASSEMBLY__ - -typedef struct { -unsigned long seg; -}mm_segment_t ; - -#define MAKE_MM_SEG (s) ((mm_segment_t) { (s) }) -#define USER_DS MAKE_MM_SEG(__USER_DS) -#define KERNEL_DS MAKE_MM_SEG(__KERNEL_DS) - -/* -* Get/set the SFC/DFC registers for MOVES instructions -*/ - -static inline mm_segment_t get_fs (void ) -{ -return USER_DS ; -} - -#define uaccess_kernel () (get_fs().seg == KERNEL_DS.seg) - -#endif /* __ASSEMBLY__ */ - -#endif /* _H8300_SEGMENT_H */
arch/h8300/include/asm/thread_info.h +0 -3
@@ -10,7 +10,6 @@#define _ASM_THREAD_INFO_H#include <asm/page.h> -#include <asm/segment.h> #ifdef __KERNEL__
@@ -31,7 +30,6 @@ struct thread_info {unsigned long flags;/* low level flags */ int cpu;/* cpu we're on */ int preempt_count;/* 0 => preemptable, <0 => BUG */ -mm_segment_t addr_limit; };/*
@@ -43,7 +41,6 @@ struct thread_info { .flags = 0, \ .cpu = 0, \ .preempt_count = INIT_PREEMPT_COUNT, \ - .addr_limit = KERNEL_DS, \ }/* how to get the thread information struct from C */
arch/h8300/kernel/entry.S +0 -1
@@ -17,7 +17,6 @@ #include <linux/sys.h> #include <asm/unistd.h> #include <asm/setup.h> -#include <asm/segment.h> #include <asm/linkage.h> #include <asm/asm-offsets.h> #include <asm/thread_info.h>
arch/h8300/kernel/head_ram.S +0 -1
@@ -4,7 +4,6 @@ #include <linux/init.h> #include <asm/unistd.h> #include <asm/setup.h> -#include <asm/segment.h> #include <asm/linkage.h> #include <asm/asm-offsets.h> #include <asm/thread_info.h>
arch/h8300/mm/init.c +0 -6
@@ -34,7 +34,6 @@#include <linux/gfp.h> #include <asm/setup.h> -#include <asm/segment.h> #include <asm/page.h> #include <asm/sections.h>
@@ -71,11 +70,6 @@ void __init paging_init(void)panic ("%s: Failed to allocate %lu bytes align=0x%lx\n" , __func__,PAGE_SIZE ,PAGE_SIZE ); -/* -* Set up SFC/DFC registers (user data space). -*/ -set_fs (USER_DS ); -pr_debug ("before free_area_init\n" ); pr_debug("free_area_init -> start_mem is %#lx\nvirtual_end is %#lx\n",
Signature · 1 line
2.30.2
Quoted 8 lines · Christoph Hellwig
Hi all,
this series removes support for the deprecated
set_fsaddress space override on h8300. Because h8300 doesn't actually have different address spaces to start with as a pure nommu port the changes are pretty simple.Compile tested only.
Any comments?
Arnd Bergmann
Reviewed-byQuoted 4 lines · Christoph Hellwig
Quoted 2 lines · Christoph Hellwig
Hi all,
Quoted 8 lines
Quoted 6 lines
this series removes support for the deprecated
set_fsaddress space override on h8300. Because h8300 doesn't actually have different address spaces to start with as a pure nommu port the changes are pretty simple.Compile tested only.
Any comments?
It took me a while to figure out that this works on architectures that define CONFIG_UACCESS_MEMCPY, as they get the asm-generic version of get_kernel_nofault(). Maybe add that to the changelog, plus my
Do you have more of these? I'm happy to take them through the asm-generic tree, at least for architectures with no response from the maintainers (not m68k, which looks too complex). I did partial patches for sh and sparc at some point to remove the set_fs() callers, but got stuck when I tried doing ia64 and didn't submit any of these.
Arnd
Quoted 5 lines · Arnd Bergmann
It took me a while to figure out that this works on architectures that define
CONFIG_UACCESS_MEMCPY, as they get the asm-generic version ofget_kernel_nofault(). Maybe add that to the changelog, plus my
Quoted 7 lines
Reviewed-by Arnd Bergmann <[email protected]>Do you have more of these? I'm happy to take them through the asm-generic tree, at least for architectures with no response from the maintainers (not m68k, which looks too complex). I did partial patches for sh and sparc at some point to remove the
set_fs()callers, but got stuck when I tried doing ia64 and didn't submit any of these.
This one actually got picked up in the u8300 tree now. The only outstanding one I have is uml, waiting for maintainer feedback for that.