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

R Sharada sharada at in.ibm.com
Mon Aug 29 21:52:07 EST 2005


Hello,
	Based on Arnd's comments, it made sense to statically allocate the
data structures for htab_base and htab_size as well as assign the values 
therein.

Hence modified the patch to reflect the changes suggested by Arnd and Nathan.
Hopefully, the patch is now in shape to be considered for inclusion.
Sending it herewith for acceptance

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-29 22:11:06.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 = &htab_base,
+	};
+
+	static unsigned long htab_size;
+	static struct property htab_base_size = {
+		.name = "htab_size",
+		.length = sizeof(unsigned long),
+		.value = &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