diff options
Diffstat (limited to 'arch/powerpc')
-rw-r--r-- | arch/powerpc/boot/flatdevtree_env.h | 2 | ||||
-rw-r--r-- | arch/powerpc/kernel/iommu.c | 17 | ||||
-rw-r--r-- | arch/powerpc/kernel/prom_init.c | 39 | ||||
-rw-r--r-- | arch/powerpc/mm/slb.c | 2 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/Kconfig | 5 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/Makefile | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spu_notify.c | 67 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spu_syscalls.c | 14 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/context.c | 16 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/sched.c | 26 | ||||
-rw-r--r-- | arch/powerpc/platforms/cell/spufs/syscalls.c | 1 | ||||
-rw-r--r-- | arch/powerpc/platforms/ps3/os-area.c | 40 | ||||
-rw-r--r-- | arch/powerpc/platforms/pseries/hotplug-cpu.c | 2 |
13 files changed, 177 insertions, 55 deletions
diff --git a/arch/powerpc/boot/flatdevtree_env.h b/arch/powerpc/boot/flatdevtree_env.h index ad0420da8921..66e0ebb1a364 100644 --- a/arch/powerpc/boot/flatdevtree_env.h +++ b/arch/powerpc/boot/flatdevtree_env.h | |||
@@ -2,7 +2,7 @@ | |||
2 | * This file adds the header file glue so that the shared files | 2 | * This file adds the header file glue so that the shared files |
3 | * flatdevicetree.[ch] can compile and work in the powerpc bootwrapper. | 3 | * flatdevicetree.[ch] can compile and work in the powerpc bootwrapper. |
4 | * | 4 | * |
5 | * strncmp & strchr copied from <file:lib/strings.c> | 5 | * strncmp & strchr copied from <file:lib/string.c> |
6 | * Copyright (C) 1991, 1992 Linus Torvalds | 6 | * Copyright (C) 1991, 1992 Linus Torvalds |
7 | * | 7 | * |
8 | * Maintained by: Mark A. Greer <mgreer@mvista.com> | 8 | * Maintained by: Mark A. Greer <mgreer@mvista.com> |
diff --git a/arch/powerpc/kernel/iommu.c b/arch/powerpc/kernel/iommu.c index 47c3fe55242f..a3c406aca664 100644 --- a/arch/powerpc/kernel/iommu.c +++ b/arch/powerpc/kernel/iommu.c | |||
@@ -278,6 +278,7 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
278 | unsigned long flags; | 278 | unsigned long flags; |
279 | struct scatterlist *s, *outs, *segstart; | 279 | struct scatterlist *s, *outs, *segstart; |
280 | int outcount, incount, i; | 280 | int outcount, incount, i; |
281 | unsigned int align; | ||
281 | unsigned long handle; | 282 | unsigned long handle; |
282 | 283 | ||
283 | BUG_ON(direction == DMA_NONE); | 284 | BUG_ON(direction == DMA_NONE); |
@@ -309,7 +310,12 @@ int iommu_map_sg(struct iommu_table *tbl, struct scatterlist *sglist, | |||
309 | /* Allocate iommu entries for that segment */ | 310 | /* Allocate iommu entries for that segment */ |
310 | vaddr = (unsigned long) sg_virt(s); | 311 | vaddr = (unsigned long) sg_virt(s); |
311 | npages = iommu_num_pages(vaddr, slen); | 312 | npages = iommu_num_pages(vaddr, slen); |
312 | entry = iommu_range_alloc(tbl, npages, &handle, mask >> IOMMU_PAGE_SHIFT, 0); | 313 | align = 0; |
314 | if (IOMMU_PAGE_SHIFT < PAGE_SHIFT && slen >= PAGE_SIZE && | ||
315 | (vaddr & ~PAGE_MASK) == 0) | ||
316 | align = PAGE_SHIFT - IOMMU_PAGE_SHIFT; | ||
317 | entry = iommu_range_alloc(tbl, npages, &handle, | ||
318 | mask >> IOMMU_PAGE_SHIFT, align); | ||
313 | 319 | ||
314 | DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen); | 320 | DBG(" - vaddr: %lx, size: %lx\n", vaddr, slen); |
315 | 321 | ||
@@ -570,7 +576,7 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, | |||
570 | { | 576 | { |
571 | dma_addr_t dma_handle = DMA_ERROR_CODE; | 577 | dma_addr_t dma_handle = DMA_ERROR_CODE; |
572 | unsigned long uaddr; | 578 | unsigned long uaddr; |
573 | unsigned int npages; | 579 | unsigned int npages, align; |
574 | 580 | ||
575 | BUG_ON(direction == DMA_NONE); | 581 | BUG_ON(direction == DMA_NONE); |
576 | 582 | ||
@@ -578,8 +584,13 @@ dma_addr_t iommu_map_single(struct iommu_table *tbl, void *vaddr, | |||
578 | npages = iommu_num_pages(uaddr, size); | 584 | npages = iommu_num_pages(uaddr, size); |
579 | 585 | ||
580 | if (tbl) { | 586 | if (tbl) { |
587 | align = 0; | ||
588 | if (IOMMU_PAGE_SHIFT < PAGE_SHIFT && size >= PAGE_SIZE && | ||
589 | ((unsigned long)vaddr & ~PAGE_MASK) == 0) | ||
590 | align = PAGE_SHIFT - IOMMU_PAGE_SHIFT; | ||
591 | |||
581 | dma_handle = iommu_alloc(tbl, vaddr, npages, direction, | 592 | dma_handle = iommu_alloc(tbl, vaddr, npages, direction, |
582 | mask >> IOMMU_PAGE_SHIFT, 0); | 593 | mask >> IOMMU_PAGE_SHIFT, align); |
583 | if (dma_handle == DMA_ERROR_CODE) { | 594 | if (dma_handle == DMA_ERROR_CODE) { |
584 | if (printk_ratelimit()) { | 595 | if (printk_ratelimit()) { |
585 | printk(KERN_INFO "iommu_alloc failed, " | 596 | printk(KERN_INFO "iommu_alloc failed, " |
diff --git a/arch/powerpc/kernel/prom_init.c b/arch/powerpc/kernel/prom_init.c index 1add6efdb315..5d89a21dd0d6 100644 --- a/arch/powerpc/kernel/prom_init.c +++ b/arch/powerpc/kernel/prom_init.c | |||
@@ -2216,6 +2216,45 @@ static void __init fixup_device_tree_efika(void) | |||
2216 | prom_printf("fixup_device_tree_efika: ", | 2216 | prom_printf("fixup_device_tree_efika: ", |
2217 | "skipped entry %x - setprop error\n", i); | 2217 | "skipped entry %x - setprop error\n", i); |
2218 | } | 2218 | } |
2219 | |||
2220 | /* Make sure ethernet mdio bus node exists */ | ||
2221 | node = call_prom("finddevice", 1, 1, ADDR("/builtin/mdio")); | ||
2222 | if (!PHANDLE_VALID(node)) { | ||
2223 | prom_printf("Adding Ethernet MDIO node\n"); | ||
2224 | call_prom("interpret", 1, 1, | ||
2225 | " s\" /builtin\" find-device" | ||
2226 | " new-device" | ||
2227 | " 1 encode-int s\" #address-cells\" property" | ||
2228 | " 0 encode-int s\" #size-cells\" property" | ||
2229 | " s\" mdio\" 2dup device-name device-type" | ||
2230 | " s\" mpc5200b-fec-phy\" encode-string" | ||
2231 | " s\" compatible\" property" | ||
2232 | " 0xf0003000 0x400 reg" | ||
2233 | " 0x2 encode-int" | ||
2234 | " 0x5 encode-int encode+" | ||
2235 | " 0x3 encode-int encode+" | ||
2236 | " s\" interrupts\" property" | ||
2237 | " finish-device"); | ||
2238 | }; | ||
2239 | |||
2240 | /* Make sure ethernet phy device node exist */ | ||
2241 | node = call_prom("finddevice", 1, 1, ADDR("/builtin/mdio/ethernet-phy")); | ||
2242 | if (!PHANDLE_VALID(node)) { | ||
2243 | prom_printf("Adding Ethernet PHY node\n"); | ||
2244 | call_prom("interpret", 1, 1, | ||
2245 | " s\" /builtin/mdio\" find-device" | ||
2246 | " new-device" | ||
2247 | " s\" ethernet-phy\" device-name" | ||
2248 | " 0x10 encode-int s\" reg\" property" | ||
2249 | " my-self" | ||
2250 | " ihandle>phandle" | ||
2251 | " finish-device" | ||
2252 | " s\" /builtin/ethernet\" find-device" | ||
2253 | " encode-int" | ||
2254 | " s\" phy-handle\" property" | ||
2255 | " device-end"); | ||
2256 | } | ||
2257 | |||
2219 | } | 2258 | } |
2220 | #else | 2259 | #else |
2221 | #define fixup_device_tree_efika() | 2260 | #define fixup_device_tree_efika() |
diff --git a/arch/powerpc/mm/slb.c b/arch/powerpc/mm/slb.c index 3cf0802cd2b6..47b06bad24ad 100644 --- a/arch/powerpc/mm/slb.c +++ b/arch/powerpc/mm/slb.c | |||
@@ -295,6 +295,8 @@ void slb_initialize(void) | |||
295 | 295 | ||
296 | create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1); | 296 | create_shadowed_slbe(VMALLOC_START, mmu_kernel_ssize, vflags, 1); |
297 | 297 | ||
298 | slb_shadow_clear(2); | ||
299 | |||
298 | /* We don't bolt the stack for the time being - we're in boot, | 300 | /* We don't bolt the stack for the time being - we're in boot, |
299 | * so the stack is in the bolted segment. By the time it goes | 301 | * so the stack is in the bolted segment. By the time it goes |
300 | * elsewhere, we'll call _switch() which will bolt in the new | 302 | * elsewhere, we'll call _switch() which will bolt in the new |
diff --git a/arch/powerpc/platforms/cell/Kconfig b/arch/powerpc/platforms/cell/Kconfig index e1e2f6a43019..3a963b4a9be0 100644 --- a/arch/powerpc/platforms/cell/Kconfig +++ b/arch/powerpc/platforms/cell/Kconfig | |||
@@ -88,3 +88,8 @@ config CBE_CPUFREQ_PMI | |||
88 | but also at lower core voltage. | 88 | but also at lower core voltage. |
89 | 89 | ||
90 | endmenu | 90 | endmenu |
91 | |||
92 | config OPROFILE_CELL | ||
93 | def_bool y | ||
94 | depends on PPC_CELL_NATIVE && (OPROFILE = m || OPROFILE = y) | ||
95 | |||
diff --git a/arch/powerpc/platforms/cell/Makefile b/arch/powerpc/platforms/cell/Makefile index 3cd565a04d0a..c89964c6fb1f 100644 --- a/arch/powerpc/platforms/cell/Makefile +++ b/arch/powerpc/platforms/cell/Makefile | |||
@@ -19,6 +19,7 @@ spu-manage-$(CONFIG_PPC_CELLEB) += spu_manage.o | |||
19 | spu-manage-$(CONFIG_PPC_CELL_NATIVE) += spu_manage.o | 19 | spu-manage-$(CONFIG_PPC_CELL_NATIVE) += spu_manage.o |
20 | 20 | ||
21 | obj-$(CONFIG_SPU_BASE) += spu_callbacks.o spu_base.o \ | 21 | obj-$(CONFIG_SPU_BASE) += spu_callbacks.o spu_base.o \ |
22 | spu_notify.o \ | ||
22 | spu_syscalls.o spu_fault.o \ | 23 | spu_syscalls.o spu_fault.o \ |
23 | $(spu-priv1-y) \ | 24 | $(spu-priv1-y) \ |
24 | $(spu-manage-y) \ | 25 | $(spu-manage-y) \ |
diff --git a/arch/powerpc/platforms/cell/spu_notify.c b/arch/powerpc/platforms/cell/spu_notify.c new file mode 100644 index 000000000000..34d156959f39 --- /dev/null +++ b/arch/powerpc/platforms/cell/spu_notify.c | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * Move OProfile dependencies from spufs module to the kernel so it | ||
3 | * can run on non-cell PPC. | ||
4 | * | ||
5 | * Copyright (C) IBM 2005 | ||
6 | * | ||
7 | * This program is free software; you can redistribute it and/or modify | ||
8 | * it under the terms of the GNU General Public License as published by | ||
9 | * the Free Software Foundation; either version 2, or (at your option) | ||
10 | * any later version. | ||
11 | * | ||
12 | * This program is distributed in the hope that it will be useful, | ||
13 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
14 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
15 | * GNU General Public License for more details. | ||
16 | * | ||
17 | * You should have received a copy of the GNU General Public License | ||
18 | * along with this program; if not, write to the Free Software | ||
19 | * Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. | ||
20 | */ | ||
21 | |||
22 | #undef DEBUG | ||
23 | |||
24 | #include <linux/module.h> | ||
25 | #include <asm/spu.h> | ||
26 | #include "spufs/spufs.h" | ||
27 | |||
28 | static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier); | ||
29 | |||
30 | void spu_switch_notify(struct spu *spu, struct spu_context *ctx) | ||
31 | { | ||
32 | blocking_notifier_call_chain(&spu_switch_notifier, | ||
33 | ctx ? ctx->object_id : 0, spu); | ||
34 | } | ||
35 | EXPORT_SYMBOL_GPL(spu_switch_notify); | ||
36 | |||
37 | int spu_switch_event_register(struct notifier_block *n) | ||
38 | { | ||
39 | int ret; | ||
40 | ret = blocking_notifier_chain_register(&spu_switch_notifier, n); | ||
41 | if (!ret) | ||
42 | notify_spus_active(); | ||
43 | return ret; | ||
44 | } | ||
45 | EXPORT_SYMBOL_GPL(spu_switch_event_register); | ||
46 | |||
47 | int spu_switch_event_unregister(struct notifier_block *n) | ||
48 | { | ||
49 | return blocking_notifier_chain_unregister(&spu_switch_notifier, n); | ||
50 | } | ||
51 | EXPORT_SYMBOL_GPL(spu_switch_event_unregister); | ||
52 | |||
53 | void spu_set_profile_private_kref(struct spu_context *ctx, | ||
54 | struct kref *prof_info_kref, | ||
55 | void (* prof_info_release) (struct kref *kref)) | ||
56 | { | ||
57 | ctx->prof_priv_kref = prof_info_kref; | ||
58 | ctx->prof_priv_release = prof_info_release; | ||
59 | } | ||
60 | EXPORT_SYMBOL_GPL(spu_set_profile_private_kref); | ||
61 | |||
62 | void *spu_get_profile_private_kref(struct spu_context *ctx) | ||
63 | { | ||
64 | return ctx->prof_priv_kref; | ||
65 | } | ||
66 | EXPORT_SYMBOL_GPL(spu_get_profile_private_kref); | ||
67 | |||
diff --git a/arch/powerpc/platforms/cell/spu_syscalls.c b/arch/powerpc/platforms/cell/spu_syscalls.c index a9438b719fe8..75530d99eda6 100644 --- a/arch/powerpc/platforms/cell/spu_syscalls.c +++ b/arch/powerpc/platforms/cell/spu_syscalls.c | |||
@@ -145,6 +145,20 @@ int elf_coredump_extra_notes_write(struct file *file, loff_t *foffset) | |||
145 | return ret; | 145 | return ret; |
146 | } | 146 | } |
147 | 147 | ||
148 | void notify_spus_active(void) | ||
149 | { | ||
150 | struct spufs_calls *calls; | ||
151 | |||
152 | calls = spufs_calls_get(); | ||
153 | if (!calls) | ||
154 | return; | ||
155 | |||
156 | calls->notify_spus_active(); | ||
157 | spufs_calls_put(calls); | ||
158 | |||
159 | return; | ||
160 | } | ||
161 | |||
148 | int register_spu_syscalls(struct spufs_calls *calls) | 162 | int register_spu_syscalls(struct spufs_calls *calls) |
149 | { | 163 | { |
150 | if (spufs_calls) | 164 | if (spufs_calls) |
diff --git a/arch/powerpc/platforms/cell/spufs/context.c b/arch/powerpc/platforms/cell/spufs/context.c index 237e152d31dc..133995ed5cc7 100644 --- a/arch/powerpc/platforms/cell/spufs/context.c +++ b/arch/powerpc/platforms/cell/spufs/context.c | |||
@@ -177,19 +177,3 @@ void spu_release_saved(struct spu_context *ctx) | |||
177 | spu_release(ctx); | 177 | spu_release(ctx); |
178 | } | 178 | } |
179 | 179 | ||
180 | void spu_set_profile_private_kref(struct spu_context *ctx, | ||
181 | struct kref *prof_info_kref, | ||
182 | void ( * prof_info_release) (struct kref *kref)) | ||
183 | { | ||
184 | ctx->prof_priv_kref = prof_info_kref; | ||
185 | ctx->prof_priv_release = prof_info_release; | ||
186 | } | ||
187 | EXPORT_SYMBOL_GPL(spu_set_profile_private_kref); | ||
188 | |||
189 | void *spu_get_profile_private_kref(struct spu_context *ctx) | ||
190 | { | ||
191 | return ctx->prof_priv_kref; | ||
192 | } | ||
193 | EXPORT_SYMBOL_GPL(spu_get_profile_private_kref); | ||
194 | |||
195 | |||
diff --git a/arch/powerpc/platforms/cell/spufs/sched.c b/arch/powerpc/platforms/cell/spufs/sched.c index 8c8af11b35b4..00d914232af1 100644 --- a/arch/powerpc/platforms/cell/spufs/sched.c +++ b/arch/powerpc/platforms/cell/spufs/sched.c | |||
@@ -182,15 +182,7 @@ static int node_allowed(struct spu_context *ctx, int node) | |||
182 | return rval; | 182 | return rval; |
183 | } | 183 | } |
184 | 184 | ||
185 | static BLOCKING_NOTIFIER_HEAD(spu_switch_notifier); | 185 | void do_notify_spus_active(void) |
186 | |||
187 | void spu_switch_notify(struct spu *spu, struct spu_context *ctx) | ||
188 | { | ||
189 | blocking_notifier_call_chain(&spu_switch_notifier, | ||
190 | ctx ? ctx->object_id : 0, spu); | ||
191 | } | ||
192 | |||
193 | static void notify_spus_active(void) | ||
194 | { | 186 | { |
195 | int node; | 187 | int node; |
196 | 188 | ||
@@ -217,22 +209,6 @@ static void notify_spus_active(void) | |||
217 | } | 209 | } |
218 | } | 210 | } |
219 | 211 | ||
220 | int spu_switch_event_register(struct notifier_block * n) | ||
221 | { | ||
222 | int ret; | ||
223 | ret = blocking_notifier_chain_register(&spu_switch_notifier, n); | ||
224 | if (!ret) | ||
225 | notify_spus_active(); | ||
226 | return ret; | ||
227 | } | ||
228 | EXPORT_SYMBOL_GPL(spu_switch_event_register); | ||
229 | |||
230 | int spu_switch_event_unregister(struct notifier_block * n) | ||
231 | { | ||
232 | return blocking_notifier_chain_unregister(&spu_switch_notifier, n); | ||
233 | } | ||
234 | EXPORT_SYMBOL_GPL(spu_switch_event_unregister); | ||
235 | |||
236 | /** | 212 | /** |
237 | * spu_bind_context - bind spu context to physical spu | 213 | * spu_bind_context - bind spu context to physical spu |
238 | * @spu: physical spu to bind to | 214 | * @spu: physical spu to bind to |
diff --git a/arch/powerpc/platforms/cell/spufs/syscalls.c b/arch/powerpc/platforms/cell/spufs/syscalls.c index 2c34f7170190..430404413178 100644 --- a/arch/powerpc/platforms/cell/spufs/syscalls.c +++ b/arch/powerpc/platforms/cell/spufs/syscalls.c | |||
@@ -86,5 +86,6 @@ struct spufs_calls spufs_calls = { | |||
86 | .spu_run = do_spu_run, | 86 | .spu_run = do_spu_run, |
87 | .coredump_extra_notes_size = spufs_coredump_extra_notes_size, | 87 | .coredump_extra_notes_size = spufs_coredump_extra_notes_size, |
88 | .coredump_extra_notes_write = spufs_coredump_extra_notes_write, | 88 | .coredump_extra_notes_write = spufs_coredump_extra_notes_write, |
89 | .notify_spus_active = do_notify_spus_active, | ||
89 | .owner = THIS_MODULE, | 90 | .owner = THIS_MODULE, |
90 | }; | 91 | }; |
diff --git a/arch/powerpc/platforms/ps3/os-area.c b/arch/powerpc/platforms/ps3/os-area.c index 766685ab26f8..b9ea09d9d2fb 100644 --- a/arch/powerpc/platforms/ps3/os-area.c +++ b/arch/powerpc/platforms/ps3/os-area.c | |||
@@ -23,6 +23,7 @@ | |||
23 | #include <linux/workqueue.h> | 23 | #include <linux/workqueue.h> |
24 | #include <linux/fs.h> | 24 | #include <linux/fs.h> |
25 | #include <linux/syscalls.h> | 25 | #include <linux/syscalls.h> |
26 | #include <linux/ctype.h> | ||
26 | 27 | ||
27 | #include <asm/lmb.h> | 28 | #include <asm/lmb.h> |
28 | 29 | ||
@@ -37,6 +38,8 @@ enum os_area_ldr_format { | |||
37 | HEADER_LDR_FORMAT_GZIP = 1, | 38 | HEADER_LDR_FORMAT_GZIP = 1, |
38 | }; | 39 | }; |
39 | 40 | ||
41 | #define OS_AREA_HEADER_MAGIC_NUM "cell_ext_os_area" | ||
42 | |||
40 | /** | 43 | /** |
41 | * struct os_area_header - os area header segment. | 44 | * struct os_area_header - os area header segment. |
42 | * @magic_num: Always 'cell_ext_os_area'. | 45 | * @magic_num: Always 'cell_ext_os_area'. |
@@ -114,13 +117,11 @@ struct os_area_params { | |||
114 | u8 _reserved_5[8]; | 117 | u8 _reserved_5[8]; |
115 | }; | 118 | }; |
116 | 119 | ||
117 | enum { | 120 | #define OS_AREA_DB_MAGIC_NUM "-db-" |
118 | OS_AREA_DB_MAGIC_NUM = 0x2d64622dU, | ||
119 | }; | ||
120 | 121 | ||
121 | /** | 122 | /** |
122 | * struct os_area_db - Shared flash memory database. | 123 | * struct os_area_db - Shared flash memory database. |
123 | * @magic_num: Always '-db-' = 0x2d64622d. | 124 | * @magic_num: Always '-db-'. |
124 | * @version: os_area_db format version number. | 125 | * @version: os_area_db format version number. |
125 | * @index_64: byte offset of the database id index for 64 bit variables. | 126 | * @index_64: byte offset of the database id index for 64 bit variables. |
126 | * @count_64: number of usable 64 bit index entries | 127 | * @count_64: number of usable 64 bit index entries |
@@ -135,7 +136,7 @@ enum { | |||
135 | */ | 136 | */ |
136 | 137 | ||
137 | struct os_area_db { | 138 | struct os_area_db { |
138 | u32 magic_num; | 139 | u8 magic_num[4]; |
139 | u16 version; | 140 | u16 version; |
140 | u16 _reserved_1; | 141 | u16 _reserved_1; |
141 | u16 index_64; | 142 | u16 index_64; |
@@ -265,12 +266,26 @@ static void __init os_area_get_property(struct device_node *node, | |||
265 | prop->name); | 266 | prop->name); |
266 | } | 267 | } |
267 | 268 | ||
269 | static void dump_field(char *s, const u8 *field, int size_of_field) | ||
270 | { | ||
271 | #if defined(DEBUG) | ||
272 | int i; | ||
273 | |||
274 | for (i = 0; i < size_of_field; i++) | ||
275 | s[i] = isprint(field[i]) ? field[i] : '.'; | ||
276 | s[i] = 0; | ||
277 | #endif | ||
278 | } | ||
279 | |||
268 | #define dump_header(_a) _dump_header(_a, __func__, __LINE__) | 280 | #define dump_header(_a) _dump_header(_a, __func__, __LINE__) |
269 | static void _dump_header(const struct os_area_header *h, const char *func, | 281 | static void _dump_header(const struct os_area_header *h, const char *func, |
270 | int line) | 282 | int line) |
271 | { | 283 | { |
284 | char str[sizeof(h->magic_num) + 1]; | ||
285 | |||
286 | dump_field(str, h->magic_num, sizeof(h->magic_num)); | ||
272 | pr_debug("%s:%d: h.magic_num: '%s'\n", func, line, | 287 | pr_debug("%s:%d: h.magic_num: '%s'\n", func, line, |
273 | h->magic_num); | 288 | str); |
274 | pr_debug("%s:%d: h.hdr_version: %u\n", func, line, | 289 | pr_debug("%s:%d: h.hdr_version: %u\n", func, line, |
275 | h->hdr_version); | 290 | h->hdr_version); |
276 | pr_debug("%s:%d: h.db_area_offset: %u\n", func, line, | 291 | pr_debug("%s:%d: h.db_area_offset: %u\n", func, line, |
@@ -311,7 +326,8 @@ static void _dump_params(const struct os_area_params *p, const char *func, | |||
311 | 326 | ||
312 | static int verify_header(const struct os_area_header *header) | 327 | static int verify_header(const struct os_area_header *header) |
313 | { | 328 | { |
314 | if (memcmp(header->magic_num, "cell_ext_os_area", 16)) { | 329 | if (memcmp(header->magic_num, OS_AREA_HEADER_MAGIC_NUM, |
330 | sizeof(header->magic_num))) { | ||
315 | pr_debug("%s:%d magic_num failed\n", __func__, __LINE__); | 331 | pr_debug("%s:%d magic_num failed\n", __func__, __LINE__); |
316 | return -1; | 332 | return -1; |
317 | } | 333 | } |
@@ -331,7 +347,8 @@ static int verify_header(const struct os_area_header *header) | |||
331 | 347 | ||
332 | static int db_verify(const struct os_area_db *db) | 348 | static int db_verify(const struct os_area_db *db) |
333 | { | 349 | { |
334 | if (db->magic_num != OS_AREA_DB_MAGIC_NUM) { | 350 | if (memcmp(db->magic_num, OS_AREA_DB_MAGIC_NUM, |
351 | sizeof(db->magic_num))) { | ||
335 | pr_debug("%s:%d magic_num failed\n", __func__, __LINE__); | 352 | pr_debug("%s:%d magic_num failed\n", __func__, __LINE__); |
336 | return -1; | 353 | return -1; |
337 | } | 354 | } |
@@ -484,8 +501,11 @@ static int db_get_rtc_diff(const struct os_area_db *db, int64_t *rtc_diff) | |||
484 | static void _dump_db(const struct os_area_db *db, const char *func, | 501 | static void _dump_db(const struct os_area_db *db, const char *func, |
485 | int line) | 502 | int line) |
486 | { | 503 | { |
504 | char str[sizeof(db->magic_num) + 1]; | ||
505 | |||
506 | dump_field(str, db->magic_num, sizeof(db->magic_num)); | ||
487 | pr_debug("%s:%d: db.magic_num: '%s'\n", func, line, | 507 | pr_debug("%s:%d: db.magic_num: '%s'\n", func, line, |
488 | (const char*)&db->magic_num); | 508 | str); |
489 | pr_debug("%s:%d: db.version: %u\n", func, line, | 509 | pr_debug("%s:%d: db.version: %u\n", func, line, |
490 | db->version); | 510 | db->version); |
491 | pr_debug("%s:%d: db.index_64: %u\n", func, line, | 511 | pr_debug("%s:%d: db.index_64: %u\n", func, line, |
@@ -516,7 +536,7 @@ static void os_area_db_init(struct os_area_db *db) | |||
516 | 536 | ||
517 | memset(db, 0, sizeof(struct os_area_db)); | 537 | memset(db, 0, sizeof(struct os_area_db)); |
518 | 538 | ||
519 | db->magic_num = OS_AREA_DB_MAGIC_NUM; | 539 | memcpy(db->magic_num, OS_AREA_DB_MAGIC_NUM, sizeof(db->magic_num)); |
520 | db->version = 1; | 540 | db->version = 1; |
521 | db->index_64 = HEADER_SIZE; | 541 | db->index_64 = HEADER_SIZE; |
522 | db->count_64 = VALUES_64_COUNT; | 542 | db->count_64 = VALUES_64_COUNT; |
diff --git a/arch/powerpc/platforms/pseries/hotplug-cpu.c b/arch/powerpc/platforms/pseries/hotplug-cpu.c index fc48b96c81bf..412e6b42986f 100644 --- a/arch/powerpc/platforms/pseries/hotplug-cpu.c +++ b/arch/powerpc/platforms/pseries/hotplug-cpu.c | |||
@@ -29,6 +29,7 @@ | |||
29 | #include <asm/vdso_datapage.h> | 29 | #include <asm/vdso_datapage.h> |
30 | #include <asm/pSeries_reconfig.h> | 30 | #include <asm/pSeries_reconfig.h> |
31 | #include "xics.h" | 31 | #include "xics.h" |
32 | #include "plpar_wrappers.h" | ||
32 | 33 | ||
33 | /* This version can't take the spinlock, because it never returns */ | 34 | /* This version can't take the spinlock, because it never returns */ |
34 | static struct rtas_args rtas_stop_self_args = { | 35 | static struct rtas_args rtas_stop_self_args = { |
@@ -58,6 +59,7 @@ static void pseries_mach_cpu_die(void) | |||
58 | local_irq_disable(); | 59 | local_irq_disable(); |
59 | idle_task_exit(); | 60 | idle_task_exit(); |
60 | xics_teardown_cpu(0); | 61 | xics_teardown_cpu(0); |
62 | unregister_slb_shadow(hard_smp_processor_id(), __pa(get_slb_shadow())); | ||
61 | rtas_stop_self(); | 63 | rtas_stop_self(); |
62 | /* Should never get here... */ | 64 | /* Should never get here... */ |
63 | BUG(); | 65 | BUG(); |