Commit 9f225788 authored by Linus Torvalds's avatar Linus Torvalds

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
parents d7b815d4 54c9b225
...@@ -113,7 +113,7 @@ ...@@ -113,7 +113,7 @@
STEPUP4((t)+16, fn) STEPUP4((t)+16, fn)
_GLOBAL(powerpc_sha_transform) _GLOBAL(powerpc_sha_transform)
PPC_STLU r1,-STACKFRAMESIZE(r1) PPC_STLU r1,-INT_FRAME_SIZE(r1)
SAVE_8GPRS(14, r1) SAVE_8GPRS(14, r1)
SAVE_10GPRS(22, r1) SAVE_10GPRS(22, r1)
...@@ -175,5 +175,5 @@ _GLOBAL(powerpc_sha_transform) ...@@ -175,5 +175,5 @@ _GLOBAL(powerpc_sha_transform)
REST_8GPRS(14, r1) REST_8GPRS(14, r1)
REST_10GPRS(22, r1) REST_10GPRS(22, r1)
addi r1,r1,STACKFRAMESIZE addi r1,r1,INT_FRAME_SIZE
blr blr
...@@ -52,8 +52,6 @@ ...@@ -52,8 +52,6 @@
#define smp_mb__before_clear_bit() smp_mb() #define smp_mb__before_clear_bit() smp_mb()
#define smp_mb__after_clear_bit() smp_mb() #define smp_mb__after_clear_bit() smp_mb()
#define BITOP_LE_SWIZZLE ((BITS_PER_LONG-1) & ~0x7)
/* Macro for generating the ***_bits() functions */ /* Macro for generating the ***_bits() functions */
#define DEFINE_BITOP(fn, op, prefix, postfix) \ #define DEFINE_BITOP(fn, op, prefix, postfix) \
static __inline__ void fn(unsigned long mask, \ static __inline__ void fn(unsigned long mask, \
......
...@@ -266,7 +266,8 @@ ...@@ -266,7 +266,8 @@
#define SPRN_HSRR0 0x13A /* Hypervisor Save/Restore 0 */ #define SPRN_HSRR0 0x13A /* Hypervisor Save/Restore 0 */
#define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */ #define SPRN_HSRR1 0x13B /* Hypervisor Save/Restore 1 */
#define SPRN_FSCR 0x099 /* Facility Status & Control Register */ #define SPRN_FSCR 0x099 /* Facility Status & Control Register */
#define FSCR_TAR (1<<8) /* Enable Target Adress Register */ #define FSCR_TAR (1 << (63-55)) /* Enable Target Address Register */
#define FSCR_DSCR (1 << (63-61)) /* Enable Data Stream Control Register */
#define SPRN_TAR 0x32f /* Target Address Register */ #define SPRN_TAR 0x32f /* Target Address Register */
#define SPRN_LPCR 0x13E /* LPAR Control Register */ #define SPRN_LPCR 0x13E /* LPAR Control Register */
#define LPCR_VPM0 (1ul << (63-0)) #define LPCR_VPM0 (1ul << (63-0))
......
...@@ -358,3 +358,4 @@ SYSCALL_SPU(setns) ...@@ -358,3 +358,4 @@ SYSCALL_SPU(setns)
COMPAT_SYS(process_vm_readv) COMPAT_SYS(process_vm_readv)
COMPAT_SYS(process_vm_writev) COMPAT_SYS(process_vm_writev)
SYSCALL(finit_module) SYSCALL(finit_module)
SYSCALL(ni_syscall) /* sys_kcmp */
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include <uapi/asm/unistd.h> #include <uapi/asm/unistd.h>
#define __NR_syscalls 354 #define __NR_syscalls 355
#define __NR__exit __NR_exit #define __NR__exit __NR_exit
#define NR_syscalls __NR_syscalls #define NR_syscalls __NR_syscalls
......
...@@ -376,6 +376,7 @@ ...@@ -376,6 +376,7 @@
#define __NR_process_vm_readv 351 #define __NR_process_vm_readv 351
#define __NR_process_vm_writev 352 #define __NR_process_vm_writev 352
#define __NR_finit_module 353 #define __NR_finit_module 353
#define __NR_kcmp 354
#endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */ #endif /* _UAPI_ASM_POWERPC_UNISTD_H_ */
...@@ -48,6 +48,7 @@ _GLOBAL(__restore_cpu_power7) ...@@ -48,6 +48,7 @@ _GLOBAL(__restore_cpu_power7)
_GLOBAL(__setup_cpu_power8) _GLOBAL(__setup_cpu_power8)
mflr r11 mflr r11
bl __init_FSCR
bl __init_hvmode_206 bl __init_hvmode_206
mtlr r11 mtlr r11
beqlr beqlr
...@@ -56,13 +57,13 @@ _GLOBAL(__setup_cpu_power8) ...@@ -56,13 +57,13 @@ _GLOBAL(__setup_cpu_power8)
mfspr r3,SPRN_LPCR mfspr r3,SPRN_LPCR
oris r3, r3, LPCR_AIL_3@h oris r3, r3, LPCR_AIL_3@h
bl __init_LPCR bl __init_LPCR
bl __init_FSCR
bl __init_TLB bl __init_TLB
mtlr r11 mtlr r11
blr blr
_GLOBAL(__restore_cpu_power8) _GLOBAL(__restore_cpu_power8)
mflr r11 mflr r11
bl __init_FSCR
mfmsr r3 mfmsr r3
rldicl. r0,r3,4,63 rldicl. r0,r3,4,63
beqlr beqlr
...@@ -115,7 +116,7 @@ __init_LPCR: ...@@ -115,7 +116,7 @@ __init_LPCR:
__init_FSCR: __init_FSCR:
mfspr r3,SPRN_FSCR mfspr r3,SPRN_FSCR
ori r3,r3,FSCR_TAR ori r3,r3,FSCR_TAR|FSCR_DSCR
mtspr SPRN_FSCR,r3 mtspr SPRN_FSCR,r3
blr blr
......
...@@ -74,13 +74,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) \ ...@@ -74,13 +74,13 @@ END_FTR_SECTION_IFSET(CPU_FTR_REAL_LE) \
mflr r10 ; \ mflr r10 ; \
ld r12,PACAKBASE(r13) ; \ ld r12,PACAKBASE(r13) ; \
LOAD_HANDLER(r12, system_call_entry_direct) ; \ LOAD_HANDLER(r12, system_call_entry_direct) ; \
mtlr r12 ; \ mtctr r12 ; \
mfspr r12,SPRN_SRR1 ; \ mfspr r12,SPRN_SRR1 ; \
/* Re-use of r13... No spare regs to do this */ \ /* Re-use of r13... No spare regs to do this */ \
li r13,MSR_RI ; \ li r13,MSR_RI ; \
mtmsrd r13,1 ; \ mtmsrd r13,1 ; \
GET_PACA(r13) ; /* get r13 back */ \ GET_PACA(r13) ; /* get r13 back */ \
blr ; bctr ;
#else #else
/* We can branch directly */ /* We can branch directly */
#define SYSCALL_PSERIES_2_DIRECT \ #define SYSCALL_PSERIES_2_DIRECT \
......
...@@ -23,6 +23,7 @@ ...@@ -23,6 +23,7 @@
#include <linux/list.h> #include <linux/list.h>
#include <linux/module.h> #include <linux/module.h>
#include <linux/slab.h> #include <linux/slab.h>
#include <linux/string.h>
#include <asm/hvcall.h> #include <asm/hvcall.h>
#include <asm/hvcserver.h> #include <asm/hvcserver.h>
...@@ -188,9 +189,9 @@ int hvcs_get_partner_info(uint32_t unit_address, struct list_head *head, ...@@ -188,9 +189,9 @@ int hvcs_get_partner_info(uint32_t unit_address, struct list_head *head,
= (unsigned int)last_p_partition_ID; = (unsigned int)last_p_partition_ID;
/* copy the Null-term char too */ /* copy the Null-term char too */
strncpy(&next_partner_info->location_code[0], strlcpy(&next_partner_info->location_code[0],
(char *)&pi_buff[2], (char *)&pi_buff[2],
strlen((char *)&pi_buff[2]) + 1); sizeof(next_partner_info->location_code));
list_add_tail(&(next_partner_info->node), head); list_add_tail(&(next_partner_info->node), head);
next_partner_info = NULL; next_partner_info = NULL;
......
...@@ -881,17 +881,12 @@ static struct vio_driver hvcs_vio_driver = { ...@@ -881,17 +881,12 @@ static struct vio_driver hvcs_vio_driver = {
/* Only called from hvcs_get_pi please */ /* Only called from hvcs_get_pi please */
static void hvcs_set_pi(struct hvcs_partner_info *pi, struct hvcs_struct *hvcsd) static void hvcs_set_pi(struct hvcs_partner_info *pi, struct hvcs_struct *hvcsd)
{ {
int clclength;
hvcsd->p_unit_address = pi->unit_address; hvcsd->p_unit_address = pi->unit_address;
hvcsd->p_partition_ID = pi->partition_ID; hvcsd->p_partition_ID = pi->partition_ID;
clclength = strlen(&pi->location_code[0]);
if (clclength > HVCS_CLC_LENGTH)
clclength = HVCS_CLC_LENGTH;
/* copy the null-term char too */ /* copy the null-term char too */
strncpy(&hvcsd->p_location_code[0], strlcpy(&hvcsd->p_location_code[0],
&pi->location_code[0], clclength + 1); &pi->location_code[0], sizeof(hvcsd->p_location_code));
} }
/* /*
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment