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

* 'merge' of git://git.kernel.org/pub/scm/linux/kernel/git/paulus/powerpc:
powerpc: Use generic compat_sys_old_readdir
powerpc/kexec: Fix up KEXEC_CONTROL_CODE_SIZE missed during conversion
powerpc: Remove dead module_find_bug code
powerpc: Add CMO enabled flag and paging space data to lparcfg
powerpc: Fix CMM page loaning on 64k page kernel with 4k hardware pages
powerpc: Make CMO paging space pool ID and page size available
powerpc: Fix lockdep IRQ tracing bug
powerpc: Fix TLB invalidation on boot on 32-bit
powerpc: Fix loss of vdso on fork on 32-bit

+78 -88
+22
arch/powerpc/include/asm/hvcall.h
··· 291 }; 292 293 int h_get_mpp(struct hvcall_mpp_data *); 294 #endif /* __ASSEMBLY__ */ 295 #endif /* __KERNEL__ */ 296 #endif /* _ASM_POWERPC_HVCALL_H */
··· 291 }; 292 293 int h_get_mpp(struct hvcall_mpp_data *); 294 + 295 + #ifdef CONFIG_PPC_PSERIES 296 + extern int CMO_PrPSP; 297 + extern int CMO_SecPSP; 298 + extern unsigned long CMO_PageSize; 299 + 300 + static inline int cmo_get_primary_psp(void) 301 + { 302 + return CMO_PrPSP; 303 + } 304 + 305 + static inline int cmo_get_secondary_psp(void) 306 + { 307 + return CMO_SecPSP; 308 + } 309 + 310 + static inline unsigned long cmo_get_page_size(void) 311 + { 312 + return CMO_PageSize; 313 + } 314 + #endif /* CONFIG_PPC_PSERIES */ 315 + 316 #endif /* __ASSEMBLY__ */ 317 #endif /* __KERNEL__ */ 318 #endif /* _ASM_POWERPC_HVCALL_H */
+3 -2
arch/powerpc/include/asm/irqflags.h
··· 20 #define TRACE_ENABLE_INTS bl .trace_hardirqs_on 21 #define TRACE_DISABLE_INTS bl .trace_hardirqs_off 22 #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \ 23 - cmpdi en, 0; \ 24 bne 95f; \ 25 stb en,PACASOFTIRQEN(r13); \ 26 bl .trace_hardirqs_off; \ ··· 29 li en,1; 30 #define TRACE_AND_RESTORE_IRQ(en) \ 31 TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \ 32 - 96: stb en,PACASOFTIRQEN(r13) 33 #else 34 #define TRACE_ENABLE_INTS 35 #define TRACE_DISABLE_INTS
··· 20 #define TRACE_ENABLE_INTS bl .trace_hardirqs_on 21 #define TRACE_DISABLE_INTS bl .trace_hardirqs_off 22 #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \ 23 + cmpdi en,0; \ 24 bne 95f; \ 25 stb en,PACASOFTIRQEN(r13); \ 26 bl .trace_hardirqs_off; \ ··· 29 li en,1; 30 #define TRACE_AND_RESTORE_IRQ(en) \ 31 TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \ 32 + stb en,PACASOFTIRQEN(r13); \ 33 + 96: 34 #else 35 #define TRACE_ENABLE_INTS 36 #define TRACE_DISABLE_INTS
-1
arch/powerpc/include/asm/mmu_context.h
··· 147 static inline int init_new_context(struct task_struct *t, struct mm_struct *mm) 148 { 149 mm->context.id = NO_CONTEXT; 150 - mm->context.vdso_base = 0; 151 return 0; 152 } 153
··· 147 static inline int init_new_context(struct task_struct *t, struct mm_struct *mm) 148 { 149 mm->context.id = NO_CONTEXT; 150 return 0; 151 } 152
+1 -1
arch/powerpc/include/asm/systbl.h
··· 92 SYSCALL(uselib) 93 SYSCALL(swapon) 94 SYSCALL(reboot) 95 - SYSX(sys_ni_syscall,old32_readdir,old_readdir) 96 SYSCALL_SPU(mmap) 97 SYSCALL_SPU(munmap) 98 SYSCALL_SPU(truncate)
··· 92 SYSCALL(uselib) 93 SYSCALL(swapon) 94 SYSCALL(reboot) 95 + SYSX(sys_ni_syscall,compat_sys_old_readdir,old_readdir) 96 SYSCALL_SPU(mmap) 97 SYSCALL_SPU(munmap) 98 SYSCALL_SPU(truncate)
+1 -1
arch/powerpc/kernel/head_32.S
··· 1155 lis r10, 0x40 1156 1: addic. r10, r10, -0x1000 1157 tlbie r10 1158 - blt 1b 1159 sync 1160 blr 1161
··· 1155 lis r10, 0x40 1156 1: addic. r10, r10, -0x1000 1157 tlbie r10 1158 + bgt 1b 1159 sync 1160 blr 1161
+5
arch/powerpc/kernel/lparcfg.c
··· 416 unsigned long cmo_faults = 0; 417 unsigned long cmo_fault_time = 0; 418 419 if (!firmware_has_feature(FW_FEATURE_CMO)) 420 return; 421 ··· 429 seq_printf(m, "cmo_faults=%lu\n", cmo_faults); 430 seq_printf(m, "cmo_fault_time_usec=%lu\n", 431 cmo_fault_time / tb_ticks_per_usec); 432 } 433 434 static int pseries_lparcfg_data(struct seq_file *m, void *v)
··· 416 unsigned long cmo_faults = 0; 417 unsigned long cmo_fault_time = 0; 418 419 + seq_printf(m, "cmo_enabled=%d\n", firmware_has_feature(FW_FEATURE_CMO)); 420 + 421 if (!firmware_has_feature(FW_FEATURE_CMO)) 422 return; 423 ··· 427 seq_printf(m, "cmo_faults=%lu\n", cmo_faults); 428 seq_printf(m, "cmo_fault_time_usec=%lu\n", 429 cmo_fault_time / tb_ticks_per_usec); 430 + seq_printf(m, "cmo_primary_psp=%d\n", cmo_get_primary_psp()); 431 + seq_printf(m, "cmo_secondary_psp=%d\n", cmo_get_secondary_psp()); 432 + seq_printf(m, "cmo_page_size=%lu\n", cmo_get_page_size()); 433 } 434 435 static int pseries_lparcfg_data(struct seq_file *m, void *v)
+1 -1
arch/powerpc/kernel/misc_32.S
··· 899 900 /* set a new stack at the bottom of our page... */ 901 /* (not really needed now) */ 902 - addi r1, r4, KEXEC_CONTROL_CODE_SIZE - 8 /* for LR Save+Back Chain */ 903 stw r0, 0(r1) 904 905 /* Do the copies */
··· 899 900 /* set a new stack at the bottom of our page... */ 901 /* (not really needed now) */ 902 + addi r1, r4, KEXEC_CONTROL_PAGE_SIZE - 8 /* for LR Save+Back Chain */ 903 stw r0, 0(r1) 904 905 /* Do the copies */
-15
arch/powerpc/kernel/module.c
··· 99 { 100 module_bug_cleanup(mod); 101 } 102 - 103 - struct bug_entry *module_find_bug(unsigned long bugaddr) 104 - { 105 - struct mod_arch_specific *mod; 106 - unsigned int i; 107 - struct bug_entry *bug; 108 - 109 - list_for_each_entry(mod, &module_bug_list, bug_list) { 110 - bug = mod->bug_table; 111 - for (i = 0; i < mod->num_bugs; ++i, ++bug) 112 - if (bugaddr == bug->bug_addr) 113 - return bug; 114 - } 115 - return NULL; 116 - }
··· 99 { 100 module_bug_cleanup(mod); 101 }
-57
arch/powerpc/kernel/sys_ppc32.c
··· 52 #include <asm/ppc-pci.h> 53 #include <asm/syscalls.h> 54 55 - struct old_linux_dirent32 { 56 - u32 d_ino; 57 - u32 d_offset; 58 - unsigned short d_namlen; 59 - char d_name[1]; 60 - }; 61 - 62 - struct readdir_callback32 { 63 - struct old_linux_dirent32 __user * dirent; 64 - int count; 65 - }; 66 - 67 - static int fillonedir(void * __buf, const char * name, int namlen, 68 - off_t offset, u64 ino, unsigned int d_type) 69 - { 70 - struct readdir_callback32 * buf = (struct readdir_callback32 *) __buf; 71 - struct old_linux_dirent32 __user * dirent; 72 - ino_t d_ino; 73 - 74 - if (buf->count) 75 - return -EINVAL; 76 - d_ino = ino; 77 - if (sizeof(d_ino) < sizeof(ino) && d_ino != ino) 78 - return -EOVERFLOW; 79 - buf->count++; 80 - dirent = buf->dirent; 81 - put_user(d_ino, &dirent->d_ino); 82 - put_user(offset, &dirent->d_offset); 83 - put_user(namlen, &dirent->d_namlen); 84 - copy_to_user(dirent->d_name, name, namlen); 85 - put_user(0, dirent->d_name + namlen); 86 - return 0; 87 - } 88 - 89 - asmlinkage int old32_readdir(unsigned int fd, struct old_linux_dirent32 __user *dirent, unsigned int count) 90 - { 91 - int error = -EBADF; 92 - struct file * file; 93 - struct readdir_callback32 buf; 94 - 95 - file = fget(fd); 96 - if (!file) 97 - goto out; 98 - 99 - buf.count = 0; 100 - buf.dirent = dirent; 101 - 102 - error = vfs_readdir(file, (filldir_t)fillonedir, &buf); 103 - if (error < 0) 104 - goto out_putf; 105 - error = buf.count; 106 - 107 - out_putf: 108 - fput(file); 109 - out: 110 - return error; 111 - } 112 113 asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, 114 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
··· 52 #include <asm/ppc-pci.h> 53 #include <asm/syscalls.h> 54 55 56 asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, 57 compat_ulong_t __user *outp, compat_ulong_t __user *exp,
+25 -2
arch/powerpc/platforms/pseries/plpar_wrappers.h
··· 2 #define _PSERIES_PLPAR_WRAPPERS_H 3 4 #include <asm/hvcall.h> 5 6 static inline long poll_pending(void) 7 { ··· 45 46 static inline long plpar_page_set_loaned(unsigned long vpa) 47 { 48 - return plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_LOANED, vpa, 0); 49 } 50 51 static inline long plpar_page_set_active(unsigned long vpa) 52 { 53 - return plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_ACTIVE, vpa, 0); 54 } 55 56 extern void vpa_init(int cpu);
··· 2 #define _PSERIES_PLPAR_WRAPPERS_H 3 4 #include <asm/hvcall.h> 5 + #include <asm/page.h> 6 7 static inline long poll_pending(void) 8 { ··· 44 45 static inline long plpar_page_set_loaned(unsigned long vpa) 46 { 47 + unsigned long cmo_page_sz = cmo_get_page_size(); 48 + long rc = 0; 49 + int i; 50 + 51 + for (i = 0; !rc && i < PAGE_SIZE; i += cmo_page_sz) 52 + rc = plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_LOANED, vpa + i, 0); 53 + 54 + for (i -= cmo_page_sz; rc && i != 0; i -= cmo_page_sz) 55 + plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_ACTIVE, 56 + vpa + i - cmo_page_sz, 0); 57 + 58 + return rc; 59 } 60 61 static inline long plpar_page_set_active(unsigned long vpa) 62 { 63 + unsigned long cmo_page_sz = cmo_get_page_size(); 64 + long rc = 0; 65 + int i; 66 + 67 + for (i = 0; !rc && i < PAGE_SIZE; i += cmo_page_sz) 68 + rc = plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_ACTIVE, vpa + i, 0); 69 + 70 + for (i -= cmo_page_sz; rc && i != 0; i -= cmo_page_sz) 71 + plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_LOANED, 72 + vpa + i - cmo_page_sz, 0); 73 + 74 + return rc; 75 } 76 77 extern void vpa_init(int cpu);
+20 -8
arch/powerpc/platforms/pseries/setup.c
··· 68 #include "plpar_wrappers.h" 69 #include "pseries.h" 70 71 72 int fwnmi_active; /* TRUE if an FWNMI handler is present */ 73 ··· 328 { 329 char *ptr, *key, *value, *end; 330 int call_status; 331 - int PrPSP = -1; 332 - int SecPSP = -1; 333 334 pr_debug(" -> fw_cmo_feature_init()\n"); 335 spin_lock(&rtas_data_buf_lock); ··· 367 break; 368 } 369 370 - if (0 == strcmp(key, "PrPSP")) 371 - PrPSP = simple_strtol(value, NULL, 10); 372 else if (0 == strcmp(key, "SecPSP")) 373 - SecPSP = simple_strtol(value, NULL, 10); 374 value = key = ptr + 1; 375 } 376 ptr++; 377 } 378 379 - if (PrPSP != -1 || SecPSP != -1) { 380 pr_info("CMO enabled\n"); 381 - pr_debug("CMO enabled, PrPSP=%d, SecPSP=%d\n", PrPSP, SecPSP); 382 powerpc_firmware_features |= FW_FEATURE_CMO; 383 } else 384 - pr_debug("CMO not enabled, PrPSP=%d, SecPSP=%d\n", PrPSP, SecPSP); 385 spin_unlock(&rtas_data_buf_lock); 386 pr_debug(" <- fw_cmo_feature_init()\n"); 387 }
··· 68 #include "plpar_wrappers.h" 69 #include "pseries.h" 70 71 + int CMO_PrPSP = -1; 72 + int CMO_SecPSP = -1; 73 + unsigned long CMO_PageSize = (ASM_CONST(1) << IOMMU_PAGE_SHIFT); 74 75 int fwnmi_active; /* TRUE if an FWNMI handler is present */ 76 ··· 325 { 326 char *ptr, *key, *value, *end; 327 int call_status; 328 + int page_order = IOMMU_PAGE_SHIFT; 329 330 pr_debug(" -> fw_cmo_feature_init()\n"); 331 spin_lock(&rtas_data_buf_lock); ··· 365 break; 366 } 367 368 + if (0 == strcmp(key, "CMOPageSize")) 369 + page_order = simple_strtol(value, NULL, 10); 370 + else if (0 == strcmp(key, "PrPSP")) 371 + CMO_PrPSP = simple_strtol(value, NULL, 10); 372 else if (0 == strcmp(key, "SecPSP")) 373 + CMO_SecPSP = simple_strtol(value, NULL, 10); 374 value = key = ptr + 1; 375 } 376 ptr++; 377 } 378 379 + /* Page size is returned as the power of 2 of the page size, 380 + * convert to the page size in bytes before returning 381 + */ 382 + CMO_PageSize = 1 << page_order; 383 + pr_debug("CMO_PageSize = %lu\n", CMO_PageSize); 384 + 385 + if (CMO_PrPSP != -1 || CMO_SecPSP != -1) { 386 pr_info("CMO enabled\n"); 387 + pr_debug("CMO enabled, PrPSP=%d, SecPSP=%d\n", CMO_PrPSP, 388 + CMO_SecPSP); 389 powerpc_firmware_features |= FW_FEATURE_CMO; 390 } else 391 + pr_debug("CMO not enabled, PrPSP=%d, SecPSP=%d\n", CMO_PrPSP, 392 + CMO_SecPSP); 393 spin_unlock(&rtas_data_buf_lock); 394 pr_debug(" <- fw_cmo_feature_init()\n"); 395 }