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

Merge branch 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc

Pull powerpc fixes from Ben Herrenschmidt:
"Here are a few powerpc bits & fixes for rc1. A couple of str*cpy
fixes, some fixes in handling the FSCR register on Power8 (controls
the enabling of processor features), a 32-bit build fix and a couple
more nits."

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/benh/powerpc:
powerpc: Set DSCR bit in FSCR setup
powerpc: Add DSCR FSCR register bit definition
powerpc: Fix setting FSCR for HV=0 and on secondary CPUs
powerpc: Wireup the kcmp syscall to sys_ni
powerpc: Remove unused BITOP_LE_SWIZZLE macro
powerpc: Avoid link stack corruption in MMU on syscall entry path
drivers/tty/hvc: Use strlcpy instead of strncpy
powerpc/pseries/hvcserver: Fix strncpy buffer limit in location code
powerpc: Fix compile of sha1-powerpc-asm.S on 32-bit

+17 -19
+2 -2
arch/powerpc/crypto/sha1-powerpc-asm.S
··· 113 113 STEPUP4((t)+16, fn) 114 114 115 115 _GLOBAL(powerpc_sha_transform) 116 - PPC_STLU r1,-STACKFRAMESIZE(r1) 116 + PPC_STLU r1,-INT_FRAME_SIZE(r1) 117 117 SAVE_8GPRS(14, r1) 118 118 SAVE_10GPRS(22, r1) 119 119 ··· 175 175 176 176 REST_8GPRS(14, r1) 177 177 REST_10GPRS(22, r1) 178 - addi r1,r1,STACKFRAMESIZE 178 + addi r1,r1,INT_FRAME_SIZE 179 179 blr
-2
arch/powerpc/include/asm/bitops.h
··· 52 52 #define smp_mb__before_clear_bit() smp_mb() 53 53 #define smp_mb__after_clear_bit() smp_mb() 54 54 55 - #define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7) 56 - 57 55 /* Macro for generating the ***_bits() functions */ 58 56 #define DEFINE_BITOP(fn, op, prefix, postfix) \ 59 57 static __inline__ void fn(unsigned long mask, \
+2 -1
arch/powerpc/include/asm/reg.h
··· 266 266 #define SPRN_HSRR0 0x13A /* Hypervisor Save/Restore 0 */ 267 267 #define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */ 268 268 #define SPRN_FSCR 0x099 /* Facility Status & Control Register */ 269 - #define FSCR_TAR (1<<8) /* Enable Target Adress Register */ 269 + #define FSCR_TAR (1 << (63-55)) /* Enable Target Address Register */ 270 + #define FSCR_DSCR (1 << (63-61)) /* Enable Data Stream Control Register */ 270 271 #define SPRN_TAR 0x32f /* Target Address Register */ 271 272 #define SPRN_LPCR 0x13E /* LPAR Control Register */ 272 273 #define LPCR_VPM0 (1ul << (63-0))
+1
arch/powerpc/include/asm/systbl.h
··· 358 358 COMPAT_SYS(process_vm_readv) 359 359 COMPAT_SYS(process_vm_writev) 360 360 SYSCALL(finit_module) 361 + SYSCALL(ni_syscall) /* sys_kcmp */
+1 -1
arch/powerpc/include/asm/unistd.h
··· 12 12 #include <uapi/asm/unistd.h> 13 13 14 14 15 - #define __NR_syscalls 354 15 + #define __NR_syscalls 355 16 16 17 17 #define __NR__exit __NR_exit 18 18 #define NR_syscalls __NR_syscalls
+1
arch/powerpc/include/uapi/asm/unistd.h
··· 376 376 #define __NR_process_vm_readv 351 377 377 #define __NR_process_vm_writev 352 378 378 #define __NR_finit_module 353 379 + #define __NR_kcmp 354 379 380 380 381 381 382 #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
+3 -2
arch/powerpc/kernel/cpu_setup_power.S
··· 48 48 49 49 _GLOBAL(__setup_cpu_power8) 50 50 mflr r11 51 + bl __init_FSCR 51 52 bl __init_hvmode_206 52 53 mtlr r11 53 54 beqlr ··· 57 56 mfspr r3,SPRN_LPCR 58 57 oris r3, r3, LPCR_AIL_3@h 59 58 bl __init_LPCR 60 - bl __init_FSCR 61 59 bl __init_TLB 62 60 mtlr r11 63 61 blr 64 62 65 63 _GLOBAL(__restore_cpu_power8) 66 64 mflr r11 65 + bl __init_FSCR 67 66 mfmsr r3 68 67 rldicl. r0,r3,4,63 69 68 beqlr ··· 116 115 117 116 __init_FSCR: 118 117 mfspr r3,SPRN_FSCR 119 - ori r3,r3,FSCR_TAR 118 + ori r3,r3,FSCR_TAR|FSCR_DSCR 120 119 mtspr SPRN_FSCR,r3 121 120 blr 122 121
+2 -2
arch/powerpc/kernel/exceptions-64s.S
··· 74 74 mflr r10 ; \ 75 75 ld r12,PACAKBASE(r13) ; \ 76 76 LOAD_HANDLER(r12, system_call_entry_direct) ; \ 77 - mtlr r12 ; \ 77 + mtctr r12 ; \ 78 78 mfspr r12,SPRN_SRR1 ; \ 79 79 /* Re-use of r13... No spare regs to do this */ \ 80 80 li r13,MSR_RI ; \ 81 81 mtmsrd r13,1 ; \ 82 82 GET_PACA(r13) ; /* get r13 back */ \ 83 - blr ; 83 + bctr ; 84 84 #else 85 85 /* We can branch directly */ 86 86 #define SYSCALL_PSERIES_2_DIRECT \
+3 -2
arch/powerpc/platforms/pseries/hvcserver.c
··· 23 23 #include <linux/list.h> 24 24 #include <linux/module.h> 25 25 #include <linux/slab.h> 26 + #include <linux/string.h> 26 27 27 28 #include <asm/hvcall.h> 28 29 #include <asm/hvcserver.h> ··· 189 188 = (unsigned int)last_p_partition_ID; 190 189 191 190 /* copy the Null-term char too */ 192 - strncpy(&next_partner_info->location_code[0], 191 + strlcpy(&next_partner_info->location_code[0], 193 192 (char *)&pi_buff[2], 194 - strlen((char *)&pi_buff[2]) + 1); 193 + sizeof(next_partner_info->location_code)); 195 194 196 195 list_add_tail(&(next_partner_info->node), head); 197 196 next_partner_info = NULL;
+2 -7
drivers/tty/hvc/hvcs.c
··· 881 881 /* Only called from hvcs_get_pi please */ 882 882 static void hvcs_set_pi(struct hvcs_partner_info *pi, struct hvcs_struct *hvcsd) 883 883 { 884 - int clclength; 885 - 886 884 hvcsd->p_unit_address = pi->unit_address; 887 885 hvcsd->p_partition_ID = pi->partition_ID; 888 - clclength = strlen(&pi->location_code[0]); 889 - if (clclength > HVCS_CLC_LENGTH) 890 - clclength = HVCS_CLC_LENGTH; 891 886 892 887 /* copy the null-term char too */ 893 - strncpy(&hvcsd->p_location_code[0], 894 - &pi->location_code[0], clclength + 1); 888 + strlcpy(&hvcsd->p_location_code[0], 889 + &pi->location_code[0], sizeof(hvcsd->p_location_code)); 895 890 } 896 891 897 892 /*