linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* remove set_fs() for h8300
@ 2021-07-09 11:53 Christoph Hellwig
  2021-07-09 11:53 ` [PATCH 1/2] h8300: remove memory.c Christoph Hellwig
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-07-09 11:53 UTC (permalink / raw)
  To: Yoshinori Sato; +Cc: uclinux-h8-devel, linux-kernel

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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [PATCH 1/2] h8300: remove memory.c
  2021-07-09 11:53 remove set_fs() for h8300 Christoph Hellwig
@ 2021-07-09 11:53 ` Christoph Hellwig
  2021-07-09 11:53 ` [PATCH 2/2] h8300: don't implement set_fs Christoph Hellwig
  2021-08-17  5:20 ` remove set_fs() for h8300 Christoph Hellwig
  2 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-07-09 11:53 UTC (permalink / raw)
  To: Yoshinori Sato; +Cc: uclinux-h8-devel, linux-kernel

None of the empty stubs defined in this file are used or even declared
in a header.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 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

diff --git a/arch/h8300/mm/Makefile b/arch/h8300/mm/Makefile
index e85b5c91f5bc..a62be6137846 100644
--- a/arch/h8300/mm/Makefile
+++ b/arch/h8300/mm/Makefile
@@ -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
diff --git a/arch/h8300/mm/memory.c b/arch/h8300/mm/memory.c
deleted file mode 100644
index 4a60e2b5eb96..000000000000
--- a/arch/h8300/mm/memory.c
+++ /dev/null
@@ -1,53 +0,0 @@
-// SPDX-License-Identifier: GPL-2.0
-/*
- *  linux/arch/h8300/mm/memory.c
- *
- *  Copyright (C) 2002  Yoshinori Sato <ysato@users.sourceforge.jp>,
- *
- *  Based on:
- *
- *  linux/arch/m68knommu/mm/memory.c
- *
- *  Copyright (C) 1998  Kenneth Albanowski <kjahds@kjahds.com>,
- *  Copyright (C) 1999-2002, Greg Ungerer (gerg@snapgear.com)
- *
- *  Based on:
- *
- *  linux/arch/m68k/mm/memory.c
- *
- *  Copyright (C) 1995  Hamish Macdonald
- */
-
-#include <linux/mm.h>
-#include <linux/kernel.h>
-#include <linux/string.h>
-#include <linux/types.h>
-
-#include <asm/setup.h>
-#include <asm/segment.h>
-#include <asm/page.h>
-#include <asm/traps.h>
-#include <asm/io.h>
-
-void cache_clear(unsigned long paddr, int len)
-{
-}
-
-
-void cache_push(unsigned long paddr, int len)
-{
-}
-
-void cache_push_v(unsigned long vaddr, int len)
-{
-}
-
-/*
- * Map some physical address range into the kernel address space.
- */
-
-unsigned long kernel_map(unsigned long paddr, unsigned long size,
-			 int nocacheflag, unsigned long *memavailp)
-{
-	return paddr;
-}
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* [PATCH 2/2] h8300: don't implement set_fs
  2021-07-09 11:53 remove set_fs() for h8300 Christoph Hellwig
  2021-07-09 11:53 ` [PATCH 1/2] h8300: remove memory.c Christoph Hellwig
@ 2021-07-09 11:53 ` Christoph Hellwig
  2021-08-17  5:20 ` remove set_fs() for h8300 Christoph Hellwig
  2 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-07-09 11:53 UTC (permalink / raw)
  To: Yoshinori Sato; +Cc: uclinux-h8-devel, linux-kernel

There is no need for set_fs on this nommu-only architecture, so just
remove all the boilerplate code.

Signed-off-by: Christoph Hellwig <hch@lst.de>
---
 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

diff --git a/arch/h8300/Kconfig b/arch/h8300/Kconfig
index 3e3e0f16f7e0..fe48c4f26cc8 100644
--- a/arch/h8300/Kconfig
+++ b/arch/h8300/Kconfig
@@ -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
diff --git a/arch/h8300/include/asm/processor.h b/arch/h8300/include/asm/processor.h
index a060b41b2d31..66d7d5271f10 100644
--- a/arch/h8300/include/asm/processor.h
+++ b/arch/h8300/include/asm/processor.h
@@ -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>
 
diff --git a/arch/h8300/include/asm/segment.h b/arch/h8300/include/asm/segment.h
deleted file mode 100644
index 37950725d9b9..000000000000
--- a/arch/h8300/include/asm/segment.h
+++ /dev/null
@@ -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 */
diff --git a/arch/h8300/include/asm/thread_info.h b/arch/h8300/include/asm/thread_info.h
index a518214d4ddd..ff2d873749a4 100644
--- a/arch/h8300/include/asm/thread_info.h
+++ b/arch/h8300/include/asm/thread_info.h
@@ -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 */
diff --git a/arch/h8300/kernel/entry.S b/arch/h8300/kernel/entry.S
index c6e289b5f1f2..42db87c17917 100644
--- a/arch/h8300/kernel/entry.S
+++ b/arch/h8300/kernel/entry.S
@@ -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>
diff --git a/arch/h8300/kernel/head_ram.S b/arch/h8300/kernel/head_ram.S
index dbf8429f5fab..489462f0ee57 100644
--- a/arch/h8300/kernel/head_ram.S
+++ b/arch/h8300/kernel/head_ram.S
@@ -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>
diff --git a/arch/h8300/mm/init.c b/arch/h8300/mm/init.c
index f7bf4693e3b2..9fa13312720a 100644
--- a/arch/h8300/mm/init.c
+++ b/arch/h8300/mm/init.c
@@ -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",
-- 
2.30.2


^ permalink raw reply related	[flat|nested] 6+ messages in thread

* Re: remove set_fs() for h8300
  2021-07-09 11:53 remove set_fs() for h8300 Christoph Hellwig
  2021-07-09 11:53 ` [PATCH 1/2] h8300: remove memory.c Christoph Hellwig
  2021-07-09 11:53 ` [PATCH 2/2] h8300: don't implement set_fs Christoph Hellwig
@ 2021-08-17  5:20 ` Christoph Hellwig
  2021-08-20 11:05   ` Arnd Bergmann
  2 siblings, 1 reply; 6+ messages in thread
From: Christoph Hellwig @ 2021-08-17  5:20 UTC (permalink / raw)
  To: Yoshinori Sato; +Cc: uclinux-h8-devel, linux-kernel

On Fri, Jul 09, 2021 at 01:53:09PM +0200, Christoph Hellwig wrote:
> 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.

Any comments?

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: remove set_fs() for h8300
  2021-08-17  5:20 ` remove set_fs() for h8300 Christoph Hellwig
@ 2021-08-20 11:05   ` Arnd Bergmann
  2021-08-20 14:33     ` Christoph Hellwig
  0 siblings, 1 reply; 6+ messages in thread
From: Arnd Bergmann @ 2021-08-20 11:05 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Yoshinori Sato, moderated list:H8/300 ARCHITECTURE,
	Linux Kernel Mailing List

On Tue, Aug 17, 2021 at 7:21 AM Christoph Hellwig <hch@lst.de> wrote:
>
> On Fri, Jul 09, 2021 at 01:53:09PM +0200, Christoph Hellwig wrote:
> > 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.
>
> 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

Reviewed-by: Arnd Bergmann <arnd@arndb.de>

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

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: remove set_fs() for h8300
  2021-08-20 11:05   ` Arnd Bergmann
@ 2021-08-20 14:33     ` Christoph Hellwig
  0 siblings, 0 replies; 6+ messages in thread
From: Christoph Hellwig @ 2021-08-20 14:33 UTC (permalink / raw)
  To: Arnd Bergmann
  Cc: Christoph Hellwig, Yoshinori Sato,
	moderated list:H8/300 ARCHITECTURE, Linux Kernel Mailing List

On Fri, Aug 20, 2021 at 01:05:30PM +0200, Arnd Bergmann wrote:
> 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
> 
> Reviewed-by: Arnd Bergmann <arnd@arndb.de>
> 
> 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.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2021-08-20 14:33 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-07-09 11:53 remove set_fs() for h8300 Christoph Hellwig
2021-07-09 11:53 ` [PATCH 1/2] h8300: remove memory.c Christoph Hellwig
2021-07-09 11:53 ` [PATCH 2/2] h8300: don't implement set_fs Christoph Hellwig
2021-08-17  5:20 ` remove set_fs() for h8300 Christoph Hellwig
2021-08-20 11:05   ` Arnd Bergmann
2021-08-20 14:33     ` Christoph Hellwig

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).