Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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

+45 -17
+1
arch/tile/include/asm/elf.h
··· 129 129 struct linux_binprm; 130 130 extern int arch_setup_additional_pages(struct linux_binprm *bprm, 131 131 int executable_stack); 132 + /* update AT_VECTOR_SIZE_ARCH if the number of NEW_AUX_ENT entries changes */ 132 133 #define ARCH_DLINFO \ 133 134 do { \ 134 135 NEW_AUX_ENT(AT_SYSINFO_EHDR, VDSO_BASE); \
+5
arch/tile/include/asm/setup.h
··· 25 25 #define MAXMEM_PFN PFN_DOWN(MAXMEM) 26 26 27 27 int tile_console_write(const char *buf, int count); 28 + 29 + #ifdef CONFIG_EARLY_PRINTK 28 30 void early_panic(const char *fmt, ...); 31 + #else 32 + #define early_panic panic 33 + #endif 29 34 30 35 /* Init-time routine to do tile-specific per-cpu setup. */ 31 36 void setup_cpu(int boot);
+2
arch/tile/include/uapi/asm/auxvec.h
··· 18 18 /* The vDSO location. */ 19 19 #define AT_SYSINFO_EHDR 33 20 20 21 + #define AT_VECTOR_SIZE_ARCH 1 /* entries in ARCH_DLINFO */ 22 + 21 23 #endif /* _ASM_TILE_AUXVEC_H */
+22 -13
arch/tile/kernel/compat.c
··· 23 23 #include <linux/uaccess.h> 24 24 #include <linux/signal.h> 25 25 #include <asm/syscalls.h> 26 + #include <asm/byteorder.h> 26 27 27 28 /* 28 29 * Syscalls that take 64-bit numbers traditionally take them in 32-bit 29 30 * "high" and "low" value parts on 32-bit architectures. 30 31 * In principle, one could imagine passing some register arguments as 31 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 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 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 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 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 68 COMPAT_SYSCALL_DEFINE6(sync_file_range2, int, fd, unsigned int, flags, 60 - u32, offset_lo, u32, offset_hi, 61 - u32, nbytes_lo, u32, nbytes_hi) 69 + SYSCALL_PAIR(offset), SYSCALL_PAIR(nbytes)) 62 70 { 63 71 return sys_sync_file_range(fd, ((loff_t)offset_hi << 32) | offset_lo, 64 72 ((loff_t)nbytes_hi << 32) | nbytes_lo, ··· 74 66 } 75 67 76 68 COMPAT_SYSCALL_DEFINE6(fallocate, int, fd, int, mode, 77 - u32, offset_lo, u32, offset_hi, 78 - u32, len_lo, u32, len_hi) 69 + SYSCALL_PAIR(offset), SYSCALL_PAIR(len)) 79 70 { 80 71 return sys_fallocate(fd, mode, ((loff_t)offset_hi << 32) | offset_lo, 81 72 ((loff_t)len_hi << 32) | len_lo); ··· 84 77 * Avoid bug in generic sys_llseek() that specifies offset_high and 85 78 * offset_low as "unsigned long", thus making it possible to pass 86 79 * a sign-extended high 32 bits in offset_low. 80 + * Note that we do not use SYSCALL_PAIR here since glibc passes the 81 + * high and low parts explicitly in that order. 87 82 */ 88 83 COMPAT_SYSCALL_DEFINE5(llseek, unsigned int, fd, unsigned int, offset_high, 89 84 unsigned int, offset_low, loff_t __user *, result,
+10 -3
arch/tile/kernel/sys.c
··· 33 33 #include <asm/pgtable.h> 34 34 #include <asm/homecache.h> 35 35 #include <asm/cachectl.h> 36 + #include <asm/byteorder.h> 36 37 #include <arch/chip.h> 37 38 38 39 SYSCALL_DEFINE3(cacheflush, unsigned long, addr, unsigned long, len, ··· 60 59 61 60 #if !defined(__tilegx__) || defined(CONFIG_COMPAT) 62 61 63 - ssize_t sys32_readahead(int fd, u32 offset_lo, u32 offset_hi, u32 count) 62 + #ifdef __BIG_ENDIAN 63 + #define SYSCALL_PAIR(name) u32 name ## _hi, u32 name ## _lo 64 + #else 65 + #define SYSCALL_PAIR(name) u32 name ## _lo, u32 name ## _hi 66 + #endif 67 + 68 + ssize_t sys32_readahead(int fd, SYSCALL_PAIR(offset), u32 count) 64 69 { 65 70 return sys_readahead(fd, ((loff_t)offset_hi << 32) | offset_lo, count); 66 71 } 67 72 68 - int sys32_fadvise64_64(int fd, u32 offset_lo, u32 offset_hi, 69 - u32 len_lo, u32 len_hi, int advice) 73 + int sys32_fadvise64_64(int fd, SYSCALL_PAIR(offset), 74 + SYSCALL_PAIR(len), int advice) 70 75 { 71 76 return sys_fadvise64_64(fd, ((loff_t)offset_hi << 32) | offset_lo, 72 77 ((loff_t)len_hi << 32) | len_lo, advice);
+5 -1
arch/tile/lib/exports.c
··· 77 77 EXPORT_SYMBOL(__umoddi3); 78 78 int64_t __moddi3(int64_t dividend, int64_t divisor); 79 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 85 int64_t __muldi3(int64_t, int64_t); 82 86 EXPORT_SYMBOL(__muldi3); 83 87 uint64_t __lshrdi3(uint64_t, unsigned int);