diff options
| author | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-27 13:54:11 -0400 |
|---|---|---|
| committer | Linus Torvalds <torvalds@linux-foundation.org> | 2016-07-27 13:54:11 -0400 |
| commit | f9abf53af4c78b08da44d841d23308c4f4d74c83 (patch) | |
| tree | d6da18a9904884196112835cdb76e8c2a84e4fde | |
| parent | ba4f67899f9b3091744da4a4ce4057123ed02c4e (diff) | |
| parent | cdf8b4633075f2171d440d2e37c9c2609019a81a (diff) | |
Merge git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile
Pull tile architecture updates from Chris Metcalf:
"A few stray changes"
* git://git.kernel.org/pub/scm/linux/kernel/git/cmetcalf/linux-tile:
tile: Define AT_VECTOR_SIZE_ARCH for ARCH_DLINFO
tile: support gcc 7 optimization to use __multi3
tile 32-bit big-endian: fix bugs in syscall argument order
tile: allow disabling CONFIG_EARLY_PRINTK
| -rw-r--r-- | arch/tile/include/asm/elf.h | 1 | ||||
| -rw-r--r-- | arch/tile/include/asm/setup.h | 5 | ||||
| -rw-r--r-- | arch/tile/include/uapi/asm/auxvec.h | 2 | ||||
| -rw-r--r-- | arch/tile/kernel/compat.c | 35 | ||||
| -rw-r--r-- | arch/tile/kernel/sys.c | 13 | ||||
| -rw-r--r-- | arch/tile/lib/exports.c | 6 |
6 files changed, 45 insertions, 17 deletions
diff --git a/arch/tile/include/asm/elf.h b/arch/tile/include/asm/elf.h index c505d77e4d06..e9d54a06736f 100644 --- a/arch/tile/include/asm/elf.h +++ b/arch/tile/include/asm/elf.h | |||
| @@ -129,6 +129,7 @@ extern int dump_task_regs(struct task_struct *, elf_gregset_t *); | |||
| 129 | struct linux_binprm; | 129 | struct linux_binprm; |
| 130 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, | 130 | extern int arch_setup_additional_pages(struct linux_binprm *bprm, |
| 131 | int executable_stack); | 131 | int executable_stack); |
| 132 | /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ | ||
| 132 | #define ARCH_DLINFO \ | 133 | #define ARCH_DLINFO \ |
| 133 | do { \ | 134 | do { \ |
| 134 | NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); \ | 135 | NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); \ |
diff --git a/arch/tile/include/asm/setup.h b/arch/tile/include/asm/setup.h index e98909033e5b..2a0347af0702 100644 --- a/arch/tile/include/asm/setup.h +++ b/arch/tile/include/asm/setup.h | |||
| @@ -25,7 +25,12 @@ | |||
| 25 | #define MAXMEM_PFN PFN_DOWN(MAXMEM) | 25 | #define MAXMEM_PFN PFN_DOWN(MAXMEM) |
| 26 | 26 | ||
| 27 | int tile_console_write(const char *buf, int count); | 27 | int tile_console_write(const char *buf, int count); |
| 28 | |||
| 29 | #ifdef CONFIG_EARLY_PRINTK | ||
| 28 | void early_panic(const char *fmt, ...); | 30 | void early_panic(const char *fmt, ...); |
| 31 | #else | ||
| 32 | #define early_panic panic | ||
| 33 | #endif | ||
| 29 | 34 | ||
| 30 | /* Init-time routine to do tile-specific per-cpu setup. */ | 35 | /* Init-time routine to do tile-specific per-cpu setup. */ |
| 31 | void setup_cpu(int boot); | 36 | void setup_cpu(int boot); |
diff --git a/arch/tile/include/uapi/asm/auxvec.h b/arch/tile/include/uapi/asm/auxvec.h index c93e92709f14..f497123ed980 100644 --- a/arch/tile/include/uapi/asm/auxvec.h +++ b/arch/tile/include/uapi/asm/auxvec.h | |||
| @@ -18,4 +18,6 @@ | |||
| 18 | /* The vDSO location. */ | 18 | /* The vDSO location. */ |
| 19 | #define AT_SYSINFO_EHDR 33 | 19 | #define AT_SYSINFO_EHDR 33 |
| 20 | 20 | ||
| 21 | #define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */ | ||
| 22 | |||
| 21 | #endif /* _ASM_TILE_AUXVEC_H */ | 23 | #endif /* _ASM_TILE_AUXVEC_H */ |
diff --git a/arch/tile/kernel/compat.c b/arch/tile/kernel/compat.c index 49120843ff96..bdaf71d31a4a 100644 --- a/arch/tile/kernel/compat.c +++ b/arch/tile/kernel/compat.c | |||
| @@ -23,42 +23,50 @@ | |||
| 23 | #include <linux/uaccess.h> | 23 | #include <linux/uaccess.h> |
| 24 | #include <linux/signal.h> | 24 | #include <linux/signal.h> |
| 25 | #include <asm/syscalls.h> | 25 | #include <asm/syscalls.h> |
| 26 | #include <asm/byteorder.h> | ||
| 26 | 27 | ||
| 27 | /* | 28 | /* |
| 28 | * Syscalls that take 64-bit numbers traditionally take them in 32-bit | 29 | * Syscalls that take 64-bit numbers traditionally take them in 32-bit |
| 29 | * "high" and "low" value parts on 32-bit architectures. | 30 | * "high" and "low" value parts on 32-bit architectures. |
| 30 | * In principle, one could imagine passing some register arguments as | 31 | * In principle, one could imagine passing some register arguments as |
| 31 | * fully 64-bit on TILE-Gx in 32-bit mode, but it seems easier to | 32 | * fully 64-bit on TILE-Gx in 32-bit mode, but it seems easier to |
| 32 | * adapt the usual convention. | 33 | * adopt the usual convention. |
| 33 | */ | 34 | */ |
| 34 | 35 | ||
| 36 | #ifdef __BIG_ENDIAN | ||
| 37 | #define SYSCALL_PAIR(name) u32, name ## _hi, u32, name ## _lo | ||
| 38 | #else | ||
| 39 | #define SYSCALL_PAIR(name) u32, name ## _lo, u32, name ## _hi | ||
| 40 | #endif | ||
| 41 | |||
| 35 | COMPAT_SYSCALL_DEFINE4(truncate64, char __user *, filename, u32, dummy, | 42 | COMPAT_SYSCALL_DEFINE4(truncate64, char __user *, filename, u32, dummy, |
| 36 | u32, low, u32, high) | 43 | SYSCALL_PAIR(length)) |
| 37 | { | 44 | { |
| 38 | return sys_truncate(filename, ((loff_t)high << 32) | low); | 45 | return sys_truncate(filename, ((loff_t)length_hi << 32) | length_lo); |
| 39 | } | 46 | } |
| 40 | 47 | ||
| 41 | COMPAT_SYSCALL_DEFINE4(ftruncate64, unsigned int, fd, u32, dummy, | 48 | COMPAT_SYSCALL_DEFINE4(ftruncate64, unsigned int, fd, u32, dummy, |
| 42 | u32, low, u32, high) | 49 | SYSCALL_PAIR(length)) |
| 43 | { | 50 | { |
| 44 | return sys_ftruncate(fd, ((loff_t)high << 32) | low); | 51 | return sys_ftruncate(fd, ((loff_t)length_hi << 32) | length_lo); |
| 45 | } | 52 | } |
| 46 | 53 | ||
| 47 | COMPAT_SYSCALL_DEFINE6(pread64, unsigned int, fd, char __user *, ubuf, | 54 | COMPAT_SYSCALL_DEFINE6(pread64, unsigned int, fd, char __user *, ubuf, |
| 48 | size_t, count, u32, dummy, u32, low, u32, high) | 55 | size_t, count, u32, dummy, SYSCALL_PAIR(offset)) |
| 49 | { | 56 | { |
| 50 | return sys_pread64(fd, ubuf, count, ((loff_t)high << 32) | low); | 57 | return sys_pread64(fd, ubuf, count, |
| 58 | ((loff_t)offset_hi << 32) | offset_lo); | ||
| 51 | } | 59 | } |
| 52 | 60 | ||
| 53 | COMPAT_SYSCALL_DEFINE6(pwrite64, unsigned int, fd, char __user *, ubuf, | 61 | COMPAT_SYSCALL_DEFINE6(pwrite64, unsigned int, fd, char __user *, ubuf, |
| 54 | size_t, count, u32, dummy, u32, low, u32, high) | 62 | size_t, count, u32, dummy, SYSCALL_PAIR(offset)) |
| 55 | { | 63 | { |
| 56 | return sys_pwrite64(fd, ubuf, count, ((loff_t)high << 32) | low); | 64 | return sys_pwrite64(fd, ubuf, count, |
| 65 | ((loff_t)offset_hi << 32) | offset_lo); | ||
| 57 | } | 66 | } |
| 58 | 67 | ||
| 59 | COMPAT_SYSCALL_DEFINE6(sync_file_range2, int, fd, unsigned int, flags, | 68 | COMPAT_SYSCALL_DEFINE6(sync_file_range2, int, fd, unsigned int, flags, |
| 60 | u32, offset_lo, u32, offset_hi, | 69 | SYSCALL_PAIR(offset), SYSCALL_PAIR(nbytes)) |
| 61 | u32, nbytes_lo, u32, nbytes_hi) | ||
| 62 | { | 70 | { |
| 63 | return sys_sync_file_range(fd, ((loff_t)offset_hi << 32) | offset_lo, | 71 | return sys_sync_file_range(fd, ((loff_t)offset_hi << 32) | offset_lo, |
| 64 | ((loff_t)nbytes_hi << 32) | nbytes_lo, | 72 | ((loff_t)nbytes_hi << 32) | nbytes_lo, |
| @@ -66,8 +74,7 @@ COMPAT_SYSCALL_DEFINE6(sync_file_range2, int, fd, unsigned int, flags, | |||
| 66 | } | 74 | } |
| 67 | 75 | ||
| 68 | COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, | 76 | COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, |
| 69 | u32, offset_lo, u32, offset_hi, | 77 | SYSCALL_PAIR(offset), SYSCALL_PAIR(len)) |
| 70 | u32, len_lo, u32, len_hi) | ||
| 71 | { | 78 | { |
| 72 | return sys_fallocate(fd, mode, ((loff_t)offset_hi << 32) | offset_lo, | 79 | return sys_fallocate(fd, mode, ((loff_t)offset_hi << 32) | offset_lo, |
| 73 | ((loff_t)len_hi << 32) | len_lo); | 80 | ((loff_t)len_hi << 32) | len_lo); |
| @@ -77,6 +84,8 @@ COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, | |||
| 77 | * Avoid bug in generic sys_llseek() that specifies offset_high and | 84 | * Avoid bug in generic sys_llseek() that specifies offset_high and |
| 78 | * offset_low as "unsigned long", thus making it possible to pass | 85 | * offset_low as "unsigned long", thus making it possible to pass |
| 79 | * a sign-extended high 32 bits in offset_low. | 86 | * a sign-extended high 32 bits in offset_low. |
| 87 | * Note that we do not use SYSCALL_PAIR here since glibc passes the | ||
| 88 | * high and low parts explicitly in that order. | ||
| 80 | */ | 89 | */ |
| 81 | COMPAT_SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned int, offset_high, | 90 | COMPAT_SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned int, offset_high, |
| 82 | unsigned int, offset_low, loff_t __user *, result, | 91 | unsigned int, offset_low, loff_t __user *, result, |
diff --git a/arch/tile/kernel/sys.c b/arch/tile/kernel/sys.c index 38debe706061..c7418dcbbb08 100644 --- a/arch/tile/kernel/sys.c +++ b/arch/tile/kernel/sys.c | |||
| @@ -33,6 +33,7 @@ | |||
| 33 | #include <asm/pgtable.h> | 33 | #include <asm/pgtable.h> |
| 34 | #include <asm/homecache.h> | 34 | #include <asm/homecache.h> |
| 35 | #include <asm/cachectl.h> | 35 | #include <asm/cachectl.h> |
| 36 | #include <asm/byteorder.h> | ||
| 36 | #include <arch/chip.h> | 37 | #include <arch/chip.h> |
| 37 | 38 | ||
| 38 | SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, len, | 39 | SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, len, |
| @@ -59,13 +60,19 @@ SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, len, | |||
| 59 | 60 | ||
| 60 | #if !defined(__tilegx__) || defined(CONFIG_COMPAT) | 61 | #if !defined(__tilegx__) || defined(CONFIG_COMPAT) |
| 61 | 62 | ||
| 62 | ssize_t sys32_readahead(int fd, u32 offset_lo, u32 offset_hi, u32 count) | 63 | #ifdef __BIG_ENDIAN |
| 64 | #define SYSCALL_PAIR(name) u32 name ## _hi, u32 name ## _lo | ||
| 65 | #else | ||
| 66 | #define SYSCALL_PAIR(name) u32 name ## _lo, u32 name ## _hi | ||
| 67 | #endif | ||
| 68 | |||
| 69 | ssize_t sys32_readahead(int fd, SYSCALL_PAIR(offset), u32 count) | ||
| 63 | { | 70 | { |
| 64 | return sys_readahead(fd, ((loff_t)offset_hi << 32) | offset_lo, count); | 71 | return sys_readahead(fd, ((loff_t)offset_hi << 32) | offset_lo, count); |
| 65 | } | 72 | } |
| 66 | 73 | ||
| 67 | int sys32_fadvise64_64(int fd, u32 offset_lo, u32 offset_hi, | 74 | int sys32_fadvise64_64(int fd, SYSCALL_PAIR(offset), |
| 68 | u32 len_lo, u32 len_hi, int advice) | 75 | SYSCALL_PAIR(len), int advice) |
| 69 | { | 76 | { |
| 70 | return sys_fadvise64_64(fd, ((loff_t)offset_hi << 32) | offset_lo, | 77 | return sys_fadvise64_64(fd, ((loff_t)offset_hi << 32) | offset_lo, |
| 71 | ((loff_t)len_hi << 32) | len_lo, advice); | 78 | ((loff_t)len_hi << 32) | len_lo, advice); |
diff --git a/arch/tile/lib/exports.c b/arch/tile/lib/exports.c index 9d171ca4302c..c5369fe643c7 100644 --- a/arch/tile/lib/exports.c +++ b/arch/tile/lib/exports.c | |||
| @@ -77,7 +77,11 @@ uint64_t __umoddi3(uint64_t dividend, uint64_t divisor); | |||
| 77 | EXPORT_SYMBOL(__umoddi3); | 77 | EXPORT_SYMBOL(__umoddi3); |
| 78 | int64_t __moddi3(int64_t dividend, int64_t divisor); | 78 | int64_t __moddi3(int64_t dividend, int64_t divisor); |
| 79 | EXPORT_SYMBOL(__moddi3); | 79 | EXPORT_SYMBOL(__moddi3); |
| 80 | #ifndef __tilegx__ | 80 | #ifdef __tilegx__ |
| 81 | typedef int TItype __attribute__((mode(TI))); | ||
| 82 | TItype __multi3(TItype a, TItype b); | ||
| 83 | EXPORT_SYMBOL(__multi3); /* required for gcc 7 and later */ | ||
| 84 | #else | ||
| 81 | int64_t __muldi3(int64_t, int64_t); | 85 | int64_t __muldi3(int64_t, int64_t); |
| 82 | EXPORT_SYMBOL(__muldi3); | 86 | EXPORT_SYMBOL(__muldi3); |
| 83 | uint64_t __lshrdi3(uint64_t, unsigned int); | 87 | uint64_t __lshrdi3(uint64_t, unsigned int); |
