diff options
Diffstat (limited to 'arch/powerpc/kernel')
-rw-r--r-- | arch/powerpc/kernel/crash_dump.c | 31 | ||||
-rw-r--r-- | arch/powerpc/kernel/head_32.S | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/ibmebus.c | 12 | ||||
-rw-r--r-- | arch/powerpc/kernel/lparcfg.c | 5 | ||||
-rw-r--r-- | arch/powerpc/kernel/machine_kexec_32.c | 2 | ||||
-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/kernel/vio.c | 2 |
9 files changed, 31 insertions, 97 deletions
diff --git a/arch/powerpc/kernel/crash_dump.c b/arch/powerpc/kernel/crash_dump.c index e0debcca0bfa..a323c9b32ee1 100644 --- a/arch/powerpc/kernel/crash_dump.c +++ b/arch/powerpc/kernel/crash_dump.c | |||
@@ -86,6 +86,19 @@ static int __init parse_savemaxmem(char *p) | |||
86 | } | 86 | } |
87 | __setup("savemaxmem=", parse_savemaxmem); | 87 | __setup("savemaxmem=", parse_savemaxmem); |
88 | 88 | ||
89 | |||
90 | static size_t copy_oldmem_vaddr(void *vaddr, char *buf, size_t csize, | ||
91 | unsigned long offset, int userbuf) | ||
92 | { | ||
93 | if (userbuf) { | ||
94 | if (copy_to_user((char __user *)buf, (vaddr + offset), csize)) | ||
95 | return -EFAULT; | ||
96 | } else | ||
97 | memcpy(buf, (vaddr + offset), csize); | ||
98 | |||
99 | return csize; | ||
100 | } | ||
101 | |||
89 | /** | 102 | /** |
90 | * copy_oldmem_page - copy one page from "oldmem" | 103 | * copy_oldmem_page - copy one page from "oldmem" |
91 | * @pfn: page frame number to be copied | 104 | * @pfn: page frame number to be copied |
@@ -107,16 +120,16 @@ ssize_t copy_oldmem_page(unsigned long pfn, char *buf, | |||
107 | if (!csize) | 120 | if (!csize) |
108 | return 0; | 121 | return 0; |
109 | 122 | ||
110 | vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0); | 123 | csize = min(csize, PAGE_SIZE); |
111 | 124 | ||
112 | if (userbuf) { | 125 | if (pfn < max_pfn) { |
113 | if (copy_to_user((char __user *)buf, (vaddr + offset), csize)) { | 126 | vaddr = __va(pfn << PAGE_SHIFT); |
114 | iounmap(vaddr); | 127 | csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); |
115 | return -EFAULT; | 128 | } else { |
116 | } | 129 | vaddr = __ioremap(pfn << PAGE_SHIFT, PAGE_SIZE, 0); |
117 | } else | 130 | csize = copy_oldmem_vaddr(vaddr, buf, csize, offset, userbuf); |
118 | memcpy(buf, (vaddr + offset), csize); | 131 | iounmap(vaddr); |
132 | } | ||
119 | 133 | ||
120 | iounmap(vaddr); | ||
121 | return csize; | 134 | return csize; |
122 | } | 135 | } |
diff --git a/arch/powerpc/kernel/head_32.S b/arch/powerpc/kernel/head_32.S index 99ee2f0f0f2b..8bb657519299 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/ibmebus.c b/arch/powerpc/kernel/ibmebus.c index 9d42eb57aea3..a06362223f8d 100644 --- a/arch/powerpc/kernel/ibmebus.c +++ b/arch/powerpc/kernel/ibmebus.c | |||
@@ -233,17 +233,6 @@ void ibmebus_free_irq(u32 ist, void *dev_id) | |||
233 | } | 233 | } |
234 | EXPORT_SYMBOL(ibmebus_free_irq); | 234 | EXPORT_SYMBOL(ibmebus_free_irq); |
235 | 235 | ||
236 | static ssize_t name_show(struct device *dev, | ||
237 | struct device_attribute *attr, char *buf) | ||
238 | { | ||
239 | return sprintf(buf, "%s\n", to_of_device(dev)->node->name); | ||
240 | } | ||
241 | |||
242 | static struct device_attribute ibmebus_dev_attrs[] = { | ||
243 | __ATTR_RO(name), | ||
244 | __ATTR_NULL | ||
245 | }; | ||
246 | |||
247 | static char *ibmebus_chomp(const char *in, size_t count) | 236 | static char *ibmebus_chomp(const char *in, size_t count) |
248 | { | 237 | { |
249 | char *out = kmalloc(count + 1, GFP_KERNEL); | 238 | char *out = kmalloc(count + 1, GFP_KERNEL); |
@@ -327,7 +316,6 @@ static struct bus_attribute ibmebus_bus_attrs[] = { | |||
327 | 316 | ||
328 | struct bus_type ibmebus_bus_type = { | 317 | struct bus_type ibmebus_bus_type = { |
329 | .uevent = of_device_uevent, | 318 | .uevent = of_device_uevent, |
330 | .dev_attrs = ibmebus_dev_attrs, | ||
331 | .bus_attrs = ibmebus_bus_attrs | 319 | .bus_attrs = ibmebus_bus_attrs |
332 | }; | 320 | }; |
333 | EXPORT_SYMBOL(ibmebus_bus_type); | 321 | EXPORT_SYMBOL(ibmebus_bus_type); |
diff --git a/arch/powerpc/kernel/lparcfg.c b/arch/powerpc/kernel/lparcfg.c index 1a09719c7628..b3eef30b5131 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/machine_kexec_32.c b/arch/powerpc/kernel/machine_kexec_32.c index cbaa34196797..ae63a964b858 100644 --- a/arch/powerpc/kernel/machine_kexec_32.c +++ b/arch/powerpc/kernel/machine_kexec_32.c | |||
@@ -51,7 +51,7 @@ void default_machine_kexec(struct kimage *image) | |||
51 | relocate_new_kernel_size); | 51 | relocate_new_kernel_size); |
52 | 52 | ||
53 | flush_icache_range(reboot_code_buffer, | 53 | flush_icache_range(reboot_code_buffer, |
54 | reboot_code_buffer + KEXEC_CONTROL_CODE_SIZE); | 54 | reboot_code_buffer + KEXEC_CONTROL_PAGE_SIZE); |
55 | printk(KERN_INFO "Bye!\n"); | 55 | printk(KERN_INFO "Bye!\n"); |
56 | 56 | ||
57 | /* now call it */ | 57 | /* now call it */ |
diff --git a/arch/powerpc/kernel/misc_32.S b/arch/powerpc/kernel/misc_32.S index 6321ae36f729..7a6dfbca7682 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 af07003573c4..7ff292475269 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 709f8cb8bfca..d98634c76060 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/kernel/vio.c b/arch/powerpc/kernel/vio.c index 22a3c33fd751..2750fbab1975 100644 --- a/arch/powerpc/kernel/vio.c +++ b/arch/powerpc/kernel/vio.c | |||
@@ -1113,7 +1113,7 @@ static int vio_bus_probe(struct device *dev) | |||
1113 | return error; | 1113 | return error; |
1114 | } | 1114 | } |
1115 | error = viodrv->probe(viodev, id); | 1115 | error = viodrv->probe(viodev, id); |
1116 | if (error) | 1116 | if (error && firmware_has_feature(FW_FEATURE_CMO)) |
1117 | vio_cmo_bus_remove(viodev); | 1117 | vio_cmo_bus_remove(viodev); |
1118 | } | 1118 | } |
1119 | 1119 | ||