diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-18 15:05:01 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2008-08-18 15:05:01 -0400 |
commit | 04cde035fa47b4a7465a15db8d6eaebcc15a68af (patch) | |
tree | ea70ab0cb99a8337f1822ec2f7e2ed5a7918bd8d | |
parent | 1de481ded98d1d48e2a4102a5aa549e3c4d18ee3 (diff) | |
parent | 50d0b17645a26d2877c9d5538114498c3f82adac (diff) |
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
-rw-r--r-- | arch/powerpc/include/asm/hvcall.h | 22 | ||||
-rw-r--r-- | arch/powerpc/include/asm/irqflags.h | 5 | ||||
-rw-r--r-- | arch/powerpc/include/asm/mmu_context.h | 1 | ||||
-rw-r--r-- | arch/powerpc/include/asm/systbl.h | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/head_32.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/lparcfg.c | 5 | ||||
-rw-r--r-- | arch/powerpc/kernel/misc_32.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/module.c | 15 | ||||
-rw-r--r-- | arch/powerpc/kernel/sys_ppc32.c | 57 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/plpar_wrappers.h | 27 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/setup.c | 28 |
11 files changed, 78 insertions, 88 deletions
diff --git a/arch/powerpc/include/asm/hvcall.h b/arch/powerpc/include/asm/hvcall.h index fbe2932fa9e..6251a4b10be 100644 --- a/arch/powerpc/include/asm/hvcall.h +++ b/arch/powerpc/include/asm/hvcall.h | |||
@@ -291,6 +291,28 @@ struct hvcall_mpp_data { | |||
291 | }; | 291 | }; |
292 | 292 | ||
293 | int h_get_mpp(struct hvcall_mpp_data *); | 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 | |||
294 | #endif /* __ASSEMBLY__ */ | 316 | #endif /* __ASSEMBLY__ */ |
295 | #endif /* __KERNEL__ */ | 317 | #endif /* __KERNEL__ */ |
296 | #endif /* _ASM_POWERPC_HVCALL_H */ | 318 | #endif /* _ASM_POWERPC_HVCALL_H */ |
diff --git a/arch/powerpc/include/asm/irqflags.h b/arch/powerpc/include/asm/irqflags.h index 17ba3a881bf..5f68ecfdf51 100644 --- a/arch/powerpc/include/asm/irqflags.h +++ b/arch/powerpc/include/asm/irqflags.h | |||
@@ -20,7 +20,7 @@ | |||
20 | #define TRACE_ENABLE_INTS bl .trace_hardirqs_on | 20 | #define TRACE_ENABLE_INTS bl .trace_hardirqs_on |
21 | #define TRACE_DISABLE_INTS bl .trace_hardirqs_off | 21 | #define TRACE_DISABLE_INTS bl .trace_hardirqs_off |
22 | #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \ | 22 | #define TRACE_AND_RESTORE_IRQ_PARTIAL(en,skip) \ |
23 | cmpdi en, 0; \ | 23 | cmpdi en,0; \ |
24 | bne 95f; \ | 24 | bne 95f; \ |
25 | stb en,PACASOFTIRQEN(r13); \ | 25 | stb en,PACASOFTIRQEN(r13); \ |
26 | bl .trace_hardirqs_off; \ | 26 | bl .trace_hardirqs_off; \ |
@@ -29,7 +29,8 @@ | |||
29 | li en,1; | 29 | li en,1; |
30 | #define TRACE_AND_RESTORE_IRQ(en) \ | 30 | #define TRACE_AND_RESTORE_IRQ(en) \ |
31 | TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \ | 31 | TRACE_AND_RESTORE_IRQ_PARTIAL(en,96f); \ |
32 | 96: stb en,PACASOFTIRQEN(r13) | 32 | stb en,PACASOFTIRQEN(r13); \ |
33 | 96: | ||
33 | #else | 34 | #else |
34 | #define TRACE_ENABLE_INTS | 35 | #define TRACE_ENABLE_INTS |
35 | #define TRACE_DISABLE_INTS | 36 | #define TRACE_DISABLE_INTS |
diff --git a/arch/powerpc/include/asm/mmu_context.h b/arch/powerpc/include/asm/mmu_context.h index 9102b8bf0ea..6b993ef452f 100644 --- a/arch/powerpc/include/asm/mmu_context.h +++ b/arch/powerpc/include/asm/mmu_context.h | |||
@@ -147,7 +147,6 @@ static inline void get_mmu_context(struct mm_struct *mm) | |||
147 | static inline int init_new_context(struct task_struct *t, struct mm_struct *mm) | 147 | static inline int init_new_context(struct task_struct *t, struct mm_struct *mm) |
148 | { | 148 | { |
149 | mm->context.id = NO_CONTEXT; | 149 | mm->context.id = NO_CONTEXT; |
150 | mm->context.vdso_base = 0; | ||
151 | return 0; | 150 | return 0; |
152 | } | 151 | } |
153 | 152 | ||
diff --git a/arch/powerpc/include/asm/systbl.h b/arch/powerpc/include/asm/systbl.h index e084272ed1c..f6cc7a43b4f 100644 --- a/arch/powerpc/include/asm/systbl.h +++ b/arch/powerpc/include/asm/systbl.h | |||
@@ -92,7 +92,7 @@ COMPAT_SYS_SPU(readlink) | |||
92 | SYSCALL(uselib) | 92 | SYSCALL(uselib) |
93 | SYSCALL(swapon) | 93 | SYSCALL(swapon) |
94 | SYSCALL(reboot) | 94 | SYSCALL(reboot) |
95 | SYSX(sys_ni_syscall,old32_readdir,old_readdir) | 95 | SYSX(sys_ni_syscall,compat_sys_old_readdir,old_readdir) |
96 | SYSCALL_SPU(mmap) | 96 | SYSCALL_SPU(mmap) |
97 | SYSCALL_SPU(munmap) | 97 | SYSCALL_SPU(munmap) |
98 | SYSCALL_SPU(truncate) | 98 | SYSCALL_SPU(truncate) |
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index 99ee2f0f0f2..8bb65751929 100644 --- a/arch/powerpc/kernel/head_32.S +++ b/arch/powerpc/kernel/head_32.S | |||
@@ -1155,7 +1155,7 @@ flush_tlbs: | |||
1155 | lis r10, 0x40 | 1155 | lis r10, 0x40 |
1156 | 1: addic. r10, r10, -0x1000 | 1156 | 1: addic. r10, r10, -0x1000 |
1157 | tlbie r10 | 1157 | tlbie r10 |
1158 | blt 1b | 1158 | bgt 1b |
1159 | sync | 1159 | sync |
1160 | blr | 1160 | blr |
1161 | 1161 | ||
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 1a09719c762..b3eef30b513 100644 --- a/arch/powerpc/kernel/lparcfg.c +++ b/arch/powerpc/kernel/lparcfg.c | |||
@@ -416,6 +416,8 @@ static void pseries_cmo_data(struct seq_file *m) | |||
416 | unsigned long cmo_faults = 0; | 416 | unsigned long cmo_faults = 0; |
417 | unsigned long cmo_fault_time = 0; | 417 | unsigned long cmo_fault_time = 0; |
418 | 418 | ||
419 | seq_printf(m, "cmo_enabled=%d\n", firmware_has_feature(FW_FEATURE_CMO)); | ||
420 | |||
419 | if (!firmware_has_feature(FW_FEATURE_CMO)) | 421 | if (!firmware_has_feature(FW_FEATURE_CMO)) |
420 | return; | 422 | return; |
421 | 423 | ||
@@ -427,6 +429,9 @@ static void pseries_cmo_data(struct seq_file *m) | |||
427 | seq_printf(m, "cmo_faults=%lu\n", cmo_faults); | 429 | seq_printf(m, "cmo_faults=%lu\n", cmo_faults); |
428 | seq_printf(m, "cmo_fault_time_usec=%lu\n", | 430 | seq_printf(m, "cmo_fault_time_usec=%lu\n", |
429 | cmo_fault_time / tb_ticks_per_usec); | 431 | cmo_fault_time / tb_ticks_per_usec); |
432 | seq_printf(m, "cmo_primary_psp=%d\n", cmo_get_primary_psp()); | ||
433 | seq_printf(m, "cmo_secondary_psp=%d\n", cmo_get_secondary_psp()); | ||
434 | seq_printf(m, "cmo_page_size=%lu\n", cmo_get_page_size()); | ||
430 | } | 435 | } |
431 | 436 | ||
432 | static int pseries_lparcfg_data(struct seq_file *m, void *v) | 437 | static int pseries_lparcfg_data(struct seq_file *m, void *v) |
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 6321ae36f72..7a6dfbca768 100644 --- a/arch/powerpc/kernel/misc_32.S +++ b/arch/powerpc/kernel/misc_32.S | |||
@@ -899,7 +899,7 @@ relocate_new_kernel: | |||
899 | 899 | ||
900 | /* set a new stack at the bottom of our page... */ | 900 | /* set a new stack at the bottom of our page... */ |
901 | /* (not really needed now) */ | 901 | /* (not really needed now) */ |
902 | addi r1, r4, KEXEC_CONTROL_CODE_SIZE - 8 /* for LR Save+Back Chain */ | 902 | addi r1, r4, KEXEC_CONTROL_PAGE_SIZE - 8 /* for LR Save+Back Chain */ |
903 | stw r0, 0(r1) | 903 | stw r0, 0(r1) |
904 | 904 | ||
905 | /* Do the copies */ | 905 | /* Do the copies */ |
diff --git a/arch/powerpc/kernel/module.c b/arch/powerpc/kernel/module.c index af07003573c..7ff29247526 100644 --- a/arch/powerpc/kernel/module.c +++ b/arch/powerpc/kernel/module.c | |||
@@ -99,18 +99,3 @@ void module_arch_cleanup(struct module *mod) | |||
99 | { | 99 | { |
100 | module_bug_cleanup(mod); | 100 | module_bug_cleanup(mod); |
101 | } | 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 | } | ||
diff --git a/arch/powerpc/kernel/sys_ppc32.c b/arch/powerpc/kernel/sys_ppc32.c index 709f8cb8bfc..d98634c7606 100644 --- a/arch/powerpc/kernel/sys_ppc32.c +++ b/arch/powerpc/kernel/sys_ppc32.c | |||
@@ -52,63 +52,6 @@ | |||
52 | #include <asm/ppc-pci.h> | 52 | #include <asm/ppc-pci.h> |
53 | #include <asm/syscalls.h> | 53 | #include <asm/syscalls.h> |
54 | 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 | 55 | ||
113 | asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, | 56 | asmlinkage long ppc32_select(u32 n, compat_ulong_t __user *inp, |
114 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, | 57 | compat_ulong_t __user *outp, compat_ulong_t __user *exp, |
diff --git a/arch/powerpc/platforms/pseries/plpar_wrappers.h b/arch/powerpc/platforms/pseries/plpar_wrappers.h index a437267c6bf..d967c1893ab 100644 --- a/arch/powerpc/platforms/pseries/plpar_wrappers.h +++ b/arch/powerpc/platforms/pseries/plpar_wrappers.h | |||
@@ -2,6 +2,7 @@ | |||
2 | #define _PSERIES_PLPAR_WRAPPERS_H | 2 | #define _PSERIES_PLPAR_WRAPPERS_H |
3 | 3 | ||
4 | #include <asm/hvcall.h> | 4 | #include <asm/hvcall.h> |
5 | #include <asm/page.h> | ||
5 | 6 | ||
6 | static inline long poll_pending(void) | 7 | static inline long poll_pending(void) |
7 | { | 8 | { |
@@ -44,12 +45,34 @@ static inline long register_slb_shadow(unsigned long cpu, unsigned long vpa) | |||
44 | 45 | ||
45 | static inline long plpar_page_set_loaned(unsigned long vpa) | 46 | static inline long plpar_page_set_loaned(unsigned long vpa) |
46 | { | 47 | { |
47 | return plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_LOANED, vpa, 0); | 48 | unsigned long cmo_page_sz = cmo_get_page_size(); |
49 | long rc = 0; | ||
50 | int i; | ||
51 | |||
52 | for (i = 0; !rc && i < PAGE_SIZE; i += cmo_page_sz) | ||
53 | rc = plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_LOANED, vpa + i, 0); | ||
54 | |||
55 | for (i -= cmo_page_sz; rc && i != 0; i -= cmo_page_sz) | ||
56 | plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_ACTIVE, | ||
57 | vpa + i - cmo_page_sz, 0); | ||
58 | |||
59 | return rc; | ||
48 | } | 60 | } |
49 | 61 | ||
50 | static inline long plpar_page_set_active(unsigned long vpa) | 62 | static inline long plpar_page_set_active(unsigned long vpa) |
51 | { | 63 | { |
52 | return plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_ACTIVE, vpa, 0); | 64 | unsigned long cmo_page_sz = cmo_get_page_size(); |
65 | long rc = 0; | ||
66 | int i; | ||
67 | |||
68 | for (i = 0; !rc && i < PAGE_SIZE; i += cmo_page_sz) | ||
69 | rc = plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_ACTIVE, vpa + i, 0); | ||
70 | |||
71 | for (i -= cmo_page_sz; rc && i != 0; i -= cmo_page_sz) | ||
72 | plpar_hcall_norets(H_PAGE_INIT, H_PAGE_SET_LOANED, | ||
73 | vpa + i - cmo_page_sz, 0); | ||
74 | |||
75 | return rc; | ||
53 | } | 76 | } |
54 | 77 | ||
55 | extern void vpa_init(int cpu); | 78 | extern void vpa_init(int cpu); |
diff --git a/arch/powerpc/platforms/pseries/setup.c b/arch/powerpc/platforms/pseries/setup.c index 063a0d2fba3..3ce8a139b85 100644 --- a/arch/powerpc/platforms/pseries/setup.c +++ b/arch/powerpc/platforms/pseries/setup.c | |||
@@ -68,6 +68,9 @@ | |||
68 | #include "plpar_wrappers.h" | 68 | #include "plpar_wrappers.h" |
69 | #include "pseries.h" | 69 | #include "pseries.h" |
70 | 70 | ||
71 | int CMO_PrPSP = -1; | ||
72 | int CMO_SecPSP = -1; | ||
73 | unsigned long CMO_PageSize = (ASM_CONST(1) << IOMMU_PAGE_SHIFT); | ||
71 | 74 | ||
72 | int fwnmi_active; /* TRUE if an FWNMI handler is present */ | 75 | int fwnmi_active; /* TRUE if an FWNMI handler is present */ |
73 | 76 | ||
@@ -325,8 +328,7 @@ void pSeries_cmo_feature_init(void) | |||
325 | { | 328 | { |
326 | char *ptr, *key, *value, *end; | 329 | char *ptr, *key, *value, *end; |
327 | int call_status; | 330 | int call_status; |
328 | int PrPSP = -1; | 331 | int page_order = IOMMU_PAGE_SHIFT; |
329 | int SecPSP = -1; | ||
330 | 332 | ||
331 | pr_debug(" -> fw_cmo_feature_init()\n"); | 333 | pr_debug(" -> fw_cmo_feature_init()\n"); |
332 | spin_lock(&rtas_data_buf_lock); | 334 | spin_lock(&rtas_data_buf_lock); |
@@ -365,21 +367,31 @@ void pSeries_cmo_feature_init(void) | |||
365 | break; | 367 | break; |
366 | } | 368 | } |
367 | 369 | ||
368 | if (0 == strcmp(key, "PrPSP")) | 370 | if (0 == strcmp(key, "CMOPageSize")) |
369 | PrPSP = simple_strtol(value, NULL, 10); | 371 | page_order = simple_strtol(value, NULL, 10); |
372 | else if (0 == strcmp(key, "PrPSP")) | ||
373 | CMO_PrPSP = simple_strtol(value, NULL, 10); | ||
370 | else if (0 == strcmp(key, "SecPSP")) | 374 | else if (0 == strcmp(key, "SecPSP")) |
371 | SecPSP = simple_strtol(value, NULL, 10); | 375 | CMO_SecPSP = simple_strtol(value, NULL, 10); |
372 | value = key = ptr + 1; | 376 | value = key = ptr + 1; |
373 | } | 377 | } |
374 | ptr++; | 378 | ptr++; |
375 | } | 379 | } |
376 | 380 | ||
377 | if (PrPSP != -1 || SecPSP != -1) { | 381 | /* Page size is returned as the power of 2 of the page size, |
382 | * convert to the page size in bytes before returning | ||
383 | */ | ||
384 | CMO_PageSize = 1 << page_order; | ||
385 | pr_debug("CMO_PageSize = %lu\n", CMO_PageSize); | ||
386 | |||
387 | if (CMO_PrPSP != -1 || CMO_SecPSP != -1) { | ||
378 | pr_info("CMO enabled\n"); | 388 | pr_info("CMO enabled\n"); |
379 | pr_debug("CMO enabled, PrPSP=%d, SecPSP=%d\n", PrPSP, SecPSP); | 389 | pr_debug("CMO enabled, PrPSP=%d, SecPSP=%d\n", CMO_PrPSP, |
390 | CMO_SecPSP); | ||
380 | powerpc_firmware_features |= FW_FEATURE_CMO; | 391 | powerpc_firmware_features |= FW_FEATURE_CMO; |
381 | } else | 392 | } else |
382 | pr_debug("CMO not enabled, PrPSP=%d, SecPSP=%d\n", PrPSP, SecPSP); | 393 | pr_debug("CMO not enabled, PrPSP=%d, SecPSP=%d\n", CMO_PrPSP, |
394 | CMO_SecPSP); | ||
383 | spin_unlock(&rtas_data_buf_lock); | 395 | spin_unlock(&rtas_data_buf_lock); |
384 | pr_debug(" <- fw_cmo_feature_init()\n"); | 396 | pr_debug(" <- fw_cmo_feature_init()\n"); |
385 | } | 397 | } |