From ed7b2144bcc87b2b097553f15a2f96e18ede21b0 Mon Sep 17 00:00:00 2001 From: Milton Miller Date: Mon, 20 Oct 2008 15:37:03 +0000 Subject: 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 Signed-off-by: Benjamin Herrenschmidt --- arch/powerpc/kernel/machine_kexec_64.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'arch/powerpc/kernel/machine_kexec_64.c') diff --git a/arch/powerpc/kernel/machine_kexec_64.c b/arch/powerpc/kernel/machine_kexec_64.c index a168514d860..4bd8b4f5e70 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 = { static void __init export_htab_values(void) { struct device_node *node; + struct property *prop; node = of_find_node_by_path("/chosen"); if (!node) return; + /* remove any stale propertys so ours can be found */ + prop = of_find_property(node, kernel_end_prop.name, NULL); + if (prop) + prom_remove_property(node, prop); + prop = of_find_property(node, htab_base_prop.name, NULL); + if (prop) + prom_remove_property(node, prop); + prop = of_find_property(node, htab_size_prop.name, NULL); + if (prop) + prom_remove_property(node, prop); + + /* information needed by userspace when using default_machine_kexec */ kernel_end = __pa(_end); prom_add_property(node, &kernel_end_prop); -- cgit v1.2.3-18-g5258