[PATCH] export htab value for kexec on non-lpar - cleaned up patch

R Sharada sharada at in.ibm.com
Tue Aug 30 15:36:18 EST 2005


Hello Paulus,
	Hmm.. I did clean that warning and error messages up. Must have switched
to the older patch while sending it out. My apologies.
	Here is the patch with the warning and errors cleaned up

Thanks and Regards,
Sharada


Signed-off-by: R Sharada <sharada at in.ibm.com>
---


diff -puN include/asm-ppc64/mmu.h~kexec-export-htab-value include/asm-ppc64/mmu.h
--- linux-2.6.13-rc6-org/include/asm-ppc64/mmu.h~kexec-export-htab-value	2005-08-25 05:27:35.000000000 +0530
+++ linux-2.6.13-rc6-org-sharada/include/asm-ppc64/mmu.h	2005-08-29 22:09:04.000000000 +0530
@@ -58,6 +58,7 @@
  * Hash table
  */
 
+#define HASH_GROUP_SIZE 0x80    /* size of each hash group */
 #define HPTES_PER_GROUP 8
 
 #define HPTE_V_AVPN_SHIFT	7
diff -puN ./arch/ppc64/kernel/setup.c~kexec-export-htab-value ./arch/ppc64/kernel/setup.c
--- linux-2.6.13-rc6-org/./arch/ppc64/kernel/setup.c~kexec-export-htab-value	2005-08-25 05:27:35.000000000 +0530
+++ linux-2.6.13-rc6-org-sharada/./arch/ppc64/kernel/setup.c	2005-08-30 16:37:30.000000000 +0530
@@ -1033,6 +1033,39 @@ void __init setup_syscall_map(void)
 	       count32, count64);
 }
 
+static void __init export_htab_value(void)
+{
+	static unsigned long htab_base;
+	static struct property htab_base_prop = {
+		.name = "htab_base",
+		.length = sizeof(unsigned long),
+		.value = (unsigned char *)&htab_base,
+	};
+
+	static unsigned long htab_size;
+	static struct property htab_size_prop = {
+		.name = "htab_size",
+		.length = sizeof(unsigned long),
+		.value = (unsigned char *)&htab_size,
+	};
+
+	struct device_node *node;
+
+	if (systemcfg->platform == PLATFORM_PSERIES_LPAR)
+		return;
+
+	node = of_find_node_by_path("/chosen");
+	if (!node)
+		return;
+
+	htab_base = __pa(htab_address);
+	prom_add_property(node, &htab_base_prop);
+	htab_size = (htab_hash_mask + 1) * HASH_GROUP_SIZE;
+	prom_add_property(node, &htab_size_prop);
+
+	of_node_put(node);
+}
+
 /*
  * Called into from start_kernel, after lock_kernel has been called.
  * Initializes bootmem, which is unsed to manage page allocation until
@@ -1086,6 +1119,8 @@ void __init setup_arch(char **cmdline_p)
 	}
 
 	paging_init();
+	/* export htab value into /proc/device-tree/chosen for kexec */
+	export_htab_value();
 	ppc64_boot_msg(0x15, "Setup Done");
 }
 
_



More information about the Linuxppc64-dev mailing list