aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2016-06-10 15:23:49 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2016-06-10 15:23:49 -0400
commitccf55f73a607dba0cec470e677e3fad754304220 (patch)
tree4c2a9c6c2eb75c545854241acb28b293ad86e95f
parentc8f17d60645cc38cbe5f6e2b2f93370483b28895 (diff)
parent8017ea35d33f9e0950d369773ab48bcb1efb9ba0 (diff)
Merge tag 'powerpc-4.7-3Michael Ellerman:' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux
Pull powerpc fixes from - ptrace: Fix out of bounds array access warning from Khem Raj - pseries: Fix PCI config address for DDW from Gavin Shan - pseries: Fix IBM_ARCH_VEC_NRCORES_OFFSET since POWER8NVL was added from Michael Ellerman - of: fix autoloading due to broken modalias with no 'compatible' from Wolfram Sang - radix: Fix always false comparison against MMU_NO_CONTEXT from Aneesh Kumar K.V - hash: Compute the segment size correctly for ISA 3.0 from Aneesh Kumar K.V - nohash: Fix build break with 64K pages from Michael Ellerman * tag 'powerpc-4.7-3' of git://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux: powerpc/nohash: Fix build break with 64K pages powerpc/mm/hash: Compute the segment size correctly for ISA 3.0 powerpc/mm/radix: Fix always false comparison against MMU_NO_CONTEXT of: fix autoloading due to broken modalias with no 'compatible' powerpc/pseries: Fix IBM_ARCH_VEC_NRCORES_OFFSET since POWER8NVL was added powerpc/pseries: Fix PCI config address for DDW powerpc/ptrace: Fix out of bounds array access warning
-rw-r--r--arch/powerpc/include/asm/nohash/64/pgalloc.h2
-rw-r--r--arch/powerpc/kernel/prom_init.c2
-rw-r--r--arch/powerpc/kernel/ptrace.c4
-rw-r--r--arch/powerpc/mm/hash_native_64.c6
-rw-r--r--arch/powerpc/mm/tlb-radix.c8
-rw-r--r--arch/powerpc/platforms/pseries/iommu.c4
-rw-r--r--scripts/mod/file2alias.c2
7 files changed, 16 insertions, 12 deletions
diff --git a/arch/powerpc/include/asm/nohash/64/pgalloc.h b/arch/powerpc/include/asm/nohash/64/pgalloc.h
index 0c12a3bfe2ab..069369f6414b 100644
--- a/arch/powerpc/include/asm/nohash/64/pgalloc.h
+++ b/arch/powerpc/include/asm/nohash/64/pgalloc.h
@@ -172,7 +172,7 @@ static inline pgtable_t pte_alloc_one(struct mm_struct *mm,
172 172
173static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte) 173static inline void pte_free_kernel(struct mm_struct *mm, pte_t *pte)
174{ 174{
175 pte_fragment_fre((unsigned long *)pte, 1); 175 pte_fragment_free((unsigned long *)pte, 1);
176} 176}
177 177
178static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage) 178static inline void pte_free(struct mm_struct *mm, pgtable_t ptepage)
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c
index ccd2037c797f..6ee4b72cda42 100644
--- a/arch/powerpc/kernel/prom_init.c
+++ b/arch/powerpc/kernel/prom_init.c
@@ -719,7 +719,7 @@ unsigned char ibm_architecture_vec[] = {
719 * must match by the macro below. Update the definition if 719 * must match by the macro below. Update the definition if
720 * the structure layout changes. 720 * the structure layout changes.
721 */ 721 */
722#define IBM_ARCH_VEC_NRCORES_OFFSET 125 722#define IBM_ARCH_VEC_NRCORES_OFFSET 133
723 W(NR_CPUS), /* number of cores supported */ 723 W(NR_CPUS), /* number of cores supported */
724 0, 724 0,
725 0, 725 0,
diff --git a/arch/powerpc/kernel/ptrace.c b/arch/powerpc/kernel/ptrace.c
index 30a03c03fe73..060b140f03c6 100644
--- a/arch/powerpc/kernel/ptrace.c
+++ b/arch/powerpc/kernel/ptrace.c
@@ -377,7 +377,7 @@ static int fpr_get(struct task_struct *target, const struct user_regset *regset,
377 377
378#else 378#else
379 BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != 379 BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) !=
380 offsetof(struct thread_fp_state, fpr[32][0])); 380 offsetof(struct thread_fp_state, fpr[32]));
381 381
382 return user_regset_copyout(&pos, &count, &kbuf, &ubuf, 382 return user_regset_copyout(&pos, &count, &kbuf, &ubuf,
383 &target->thread.fp_state, 0, -1); 383 &target->thread.fp_state, 0, -1);
@@ -405,7 +405,7 @@ static int fpr_set(struct task_struct *target, const struct user_regset *regset,
405 return 0; 405 return 0;
406#else 406#else
407 BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) != 407 BUILD_BUG_ON(offsetof(struct thread_fp_state, fpscr) !=
408 offsetof(struct thread_fp_state, fpr[32][0])); 408 offsetof(struct thread_fp_state, fpr[32]));
409 409
410 return user_regset_copyin(&pos, &count, &kbuf, &ubuf, 410 return user_regset_copyin(&pos, &count, &kbuf, &ubuf,
411 &target->thread.fp_state, 0, -1); 411 &target->thread.fp_state, 0, -1);
diff --git a/arch/powerpc/mm/hash_native_64.c b/arch/powerpc/mm/hash_native_64.c
index d873f6507f72..40e05e7f43de 100644
--- a/arch/powerpc/mm/hash_native_64.c
+++ b/arch/powerpc/mm/hash_native_64.c
@@ -550,7 +550,11 @@ static void hpte_decode(struct hash_pte *hpte, unsigned long slot,
550 } 550 }
551 } 551 }
552 /* This works for all page sizes, and for 256M and 1T segments */ 552 /* This works for all page sizes, and for 256M and 1T segments */
553 *ssize = hpte_v >> HPTE_V_SSIZE_SHIFT; 553 if (cpu_has_feature(CPU_FTR_ARCH_300))
554 *ssize = hpte_r >> HPTE_R_3_0_SSIZE_SHIFT;
555 else
556 *ssize = hpte_v >> HPTE_V_SSIZE_SHIFT;
557
554 shift = mmu_psize_defs[size].shift; 558 shift = mmu_psize_defs[size].shift;
555 559
556 avpn = (HPTE_V_AVPN_VAL(hpte_v) & ~mmu_psize_defs[size].avpnm); 560 avpn = (HPTE_V_AVPN_VAL(hpte_v) & ~mmu_psize_defs[size].avpnm);
diff --git a/arch/powerpc/mm/tlb-radix.c b/arch/powerpc/mm/tlb-radix.c
index 0fdaf93a3e09..54efba2fd66e 100644
--- a/arch/powerpc/mm/tlb-radix.c
+++ b/arch/powerpc/mm/tlb-radix.c
@@ -117,7 +117,7 @@ static inline void _tlbie_va(unsigned long va, unsigned long pid,
117 */ 117 */
118void radix__local_flush_tlb_mm(struct mm_struct *mm) 118void radix__local_flush_tlb_mm(struct mm_struct *mm)
119{ 119{
120 unsigned int pid; 120 unsigned long pid;
121 121
122 preempt_disable(); 122 preempt_disable();
123 pid = mm->context.id; 123 pid = mm->context.id;
@@ -130,7 +130,7 @@ EXPORT_SYMBOL(radix__local_flush_tlb_mm);
130void radix___local_flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr, 130void radix___local_flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
131 unsigned long ap, int nid) 131 unsigned long ap, int nid)
132{ 132{
133 unsigned int pid; 133 unsigned long pid;
134 134
135 preempt_disable(); 135 preempt_disable();
136 pid = mm ? mm->context.id : 0; 136 pid = mm ? mm->context.id : 0;
@@ -160,7 +160,7 @@ static int mm_is_core_local(struct mm_struct *mm)
160 160
161void radix__flush_tlb_mm(struct mm_struct *mm) 161void radix__flush_tlb_mm(struct mm_struct *mm)
162{ 162{
163 unsigned int pid; 163 unsigned long pid;
164 164
165 preempt_disable(); 165 preempt_disable();
166 pid = mm->context.id; 166 pid = mm->context.id;
@@ -185,7 +185,7 @@ EXPORT_SYMBOL(radix__flush_tlb_mm);
185void radix___flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr, 185void radix___flush_tlb_page(struct mm_struct *mm, unsigned long vmaddr,
186 unsigned long ap, int nid) 186 unsigned long ap, int nid)
187{ 187{
188 unsigned int pid; 188 unsigned long pid;
189 189
190 preempt_disable(); 190 preempt_disable();
191 pid = mm ? mm->context.id : 0; 191 pid = mm ? mm->context.id : 0;
diff --git a/arch/powerpc/platforms/pseries/iommu.c b/arch/powerpc/platforms/pseries/iommu.c
index b7dfc1359d01..3e8865b187de 100644
--- a/arch/powerpc/platforms/pseries/iommu.c
+++ b/arch/powerpc/platforms/pseries/iommu.c
@@ -927,7 +927,7 @@ static int query_ddw(struct pci_dev *dev, const u32 *ddw_avail,
927 dn = pci_device_to_OF_node(dev); 927 dn = pci_device_to_OF_node(dev);
928 pdn = PCI_DN(dn); 928 pdn = PCI_DN(dn);
929 buid = pdn->phb->buid; 929 buid = pdn->phb->buid;
930 cfg_addr = (pdn->busno << 8) | pdn->devfn; 930 cfg_addr = ((pdn->busno << 16) | (pdn->devfn << 8));
931 931
932 ret = rtas_call(ddw_avail[0], 3, 5, (u32 *)query, 932 ret = rtas_call(ddw_avail[0], 3, 5, (u32 *)query,
933 cfg_addr, BUID_HI(buid), BUID_LO(buid)); 933 cfg_addr, BUID_HI(buid), BUID_LO(buid));
@@ -956,7 +956,7 @@ static int create_ddw(struct pci_dev *dev, const u32 *ddw_avail,
956 dn = pci_device_to_OF_node(dev); 956 dn = pci_device_to_OF_node(dev);
957 pdn = PCI_DN(dn); 957 pdn = PCI_DN(dn);
958 buid = pdn->phb->buid; 958 buid = pdn->phb->buid;
959 cfg_addr = (pdn->busno << 8) | pdn->devfn; 959 cfg_addr = ((pdn->busno << 16) | (pdn->devfn << 8));
960 960
961 do { 961 do {
962 /* extra outputs are LIOBN and dma-addr (hi, lo) */ 962 /* extra outputs are LIOBN and dma-addr (hi, lo) */
diff --git a/scripts/mod/file2alias.c b/scripts/mod/file2alias.c
index a9155077feef..fec75786f75b 100644
--- a/scripts/mod/file2alias.c
+++ b/scripts/mod/file2alias.c
@@ -384,7 +384,7 @@ static void do_of_entry_multi(void *symval, struct module *mod)
384 len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*", 384 len = sprintf(alias, "of:N%sT%s", (*name)[0] ? *name : "*",
385 (*type)[0] ? *type : "*"); 385 (*type)[0] ? *type : "*");
386 386
387 if (compatible[0]) 387 if ((*compatible)[0])
388 sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "", 388 sprintf(&alias[len], "%sC%s", (*type)[0] ? "*" : "",
389 *compatible); 389 *compatible);
390 390