aboutsummaryrefslogtreecommitdiffstats
path: root/arch/ia64/include/asm/uaccess.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2022-02-11 21:35:55 +0100
committerArnd Bergmann <arnd@arndb.de>2022-02-25 09:36:06 +0100
commite5ef21d139957b8d064fefb7db42d1525605dd98 (patch)
tree4a2098c1ffee6233f975dde26be636719f953b95 /arch/ia64/include/asm/uaccess.h
parentsh: remove CONFIG_SET_FS support (diff)
downloadlinux-dev-e5ef21d139957b8d064fefb7db42d1525605dd98.tar.xz
linux-dev-e5ef21d139957b8d064fefb7db42d1525605dd98.zip
ia64: remove CONFIG_SET_FS support
ia64 only uses set_fs() in one file to handle unaligned access for both user space and kernel instructions. Rewrite this to explicitly pass around a flag about which one it is and drop the feature from the architecture. Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'arch/ia64/include/asm/uaccess.h')
-rw-r--r--arch/ia64/include/asm/uaccess.h21
1 files changed, 6 insertions, 15 deletions
diff --git a/arch/ia64/include/asm/uaccess.h b/arch/ia64/include/asm/uaccess.h
index e242a3cc1330..60adadeb3e9e 100644
--- a/arch/ia64/include/asm/uaccess.h
+++ b/arch/ia64/include/asm/uaccess.h
@@ -42,26 +42,17 @@
#include <asm/extable.h>
/*
- * For historical reasons, the following macros are grossly misnamed:
- */
-#define KERNEL_DS ((mm_segment_t) { ~0UL }) /* cf. access_ok() */
-#define USER_DS ((mm_segment_t) { TASK_SIZE-1 }) /* cf. access_ok() */
-
-#define get_fs() (current_thread_info()->addr_limit)
-#define set_fs(x) (current_thread_info()->addr_limit = (x))
-
-/*
- * When accessing user memory, we need to make sure the entire area really is in
- * user-level space. In order to do this efficiently, we make sure that the page at
- * address TASK_SIZE is never valid. We also need to make sure that the address doesn't
+ * When accessing user memory, we need to make sure the entire area really is
+ * in user-level space. We also need to make sure that the address doesn't
* point inside the virtually mapped linear page table.
*/
static inline int __access_ok(const void __user *p, unsigned long size)
{
+ unsigned long limit = TASK_SIZE;
unsigned long addr = (unsigned long)p;
- unsigned long seg = get_fs().seg;
- return likely(addr <= seg) &&
- (seg == KERNEL_DS.seg || likely(REGION_OFFSET(addr) < RGN_MAP_LIMIT));
+
+ return likely((size <= limit) && (addr <= (limit - size)) &&
+ likely(REGION_OFFSET(addr) < RGN_MAP_LIMIT));
}
#define __access_ok __access_ok
#include <asm-generic/access_ok.h>