aboutsummaryrefslogtreecommitdiffstats
path: root/arch/powerpc
diff options
context:
space:
mode:
authorMilton Miller <miltonm@bga.com>2008-10-20 11:37:03 -0400
committerBenjamin Herrenschmidt <benh@kernel.crashing.org>2008-10-21 00:19:12 -0400
commited7b2144bcc87b2b097553f15a2f96e18ede21b0 (patch)
treee967ddbe6b53d10851e1072d0192f35948ed8218 /arch/powerpc
parentdbc1c5c250cbedccf3571597d156e581e34b2944 (diff)
powerpc: Find and destroy possible stale kernel added properties
64 bit powerpc requires the kexec user space tools avoid overwriting the static kernel image and translation hash table when choosing where to put memory image data because it copies the data into place using the kernels virtual memory system. Kexec userspace determines these and other areas blocked by reading properties the kernel adds, but does not filter these properties when creating the device tree for the next kernel. When the second kernel tries to add its values for these properties, the export via /proc/device-tree is hidden by the pre-existing but stale values from the flat tree. Kexec userspace reads the old property, allocates the new kernel at the old kernel's end, and gets rejected by the overlap check. Search and remove these stale properties before adding the new values. Signed-off-by: Milton Miller <miltonm@bga.com> Signed-off-by: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Diffstat (limited to 'arch/powerpc')
-rw-r--r--arch/powerpc/kernel/machine_kexec_64.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c
index a168514d8609..4bd8b4f5e70d 100644
--- a/arch/powerpc/kernel/machine_kexec_64.c
+++ b/arch/powerpc/kernel/machine_kexec_64.c
@@ -312,11 +312,24 @@ static struct property kernel_end_prop = {
312static void __init export_htab_values(void) 312static void __init export_htab_values(void)
313{ 313{
314 struct device_node *node; 314 struct device_node *node;
315 struct property *prop;
315 316
316 node = of_find_node_by_path("/chosen"); 317 node = of_find_node_by_path("/chosen");
317 if (!node) 318 if (!node)
318 return; 319 return;
319 320
321 /* remove any stale propertys so ours can be found */
322 prop = of_find_property(node, kernel_end_prop.name, NULL);
323 if (prop)
324 prom_remove_property(node, prop);
325 prop = of_find_property(node, htab_base_prop.name, NULL);
326 if (prop)
327 prom_remove_property(node, prop);
328 prop = of_find_property(node, htab_size_prop.name, NULL);
329 if (prop)
330 prom_remove_property(node, prop);
331
332 /* information needed by userspace when using default_machine_kexec */
320 kernel_end = __pa(_end); 333 kernel_end = __pa(_end);
321 prom_add_property(node, &kernel_end_prop); 334 prom_add_property(node, &kernel_end_prop);
322 335