diff options
author | Arnd Bergmann <arnd@arndb.de> | 2022-02-11 23:35:55 +0300 |
---|---|---|
committer | Arnd Bergmann <arnd@arndb.de> | 2022-02-25 11:36:06 +0300 |
commit | e5ef21d139957b8d064fefb7db42d1525605dd98 (patch) | |
tree | 4a2098c1ffee6233f975dde26be636719f953b95 /arch/ia64/include/asm/uaccess.h | |
parent | 75d4d29549e54c61466d60336b1c6e3a5d28797c (diff) | |
download | linux-e5ef21d139957b8d064fefb7db42d1525605dd98.tar.xz |
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.h | 21 |
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> |