--- ./makedumpfile.h.org	2006-09-07 18:33:49.000000000 +0900
+++ ./makedumpfile.h	2006-09-07 18:47:38.000000000 +0900
@@ -102,6 +102,7 @@ isAnon(unsigned long mapping)
  * Incorrect address
  */
 #define NOT_MEMMAP_ADDR	(0x0)
+#define NOT_KV_ADDR	(0x0)
 
 /*
  * Dump Level
@@ -246,12 +247,17 @@ do { \
  * The values of linux 2.6.15.1
  */
 #ifdef __i386__
-#define PAGE_OFFSET     	0xc0000000
+#define PAGE_OFFSET		(0xc0000000)
 #define __VMALLOC_RESERVE       (128 << 20)
 #define MAXMEM                  (-PAGE_OFFSET-__VMALLOC_RESERVE)
+#define KVBASE_MASK		(0x7fffff)
+#define KVBASE			(SYMBOL(_stext) & ~KVBASE_MASK)
 #endif /* i386 */
+
 #ifdef __x86_64__
-#define MAXMEM			0x3fffffffffffUL
+#define PAGE_OFFSET		(0xffff810000000000)
+#define MAXMEM			(0x3fffffffffffUL)
+#define KVBASE			PAGE_OFFSET
 #endif /* x86_64 */
 
 #ifdef __ia64__ /* ia64 */
@@ -367,6 +373,7 @@ struct DumpInfo {
 struct symbol_table {
 	unsigned long	mem_map;
 	unsigned long	system_utsname;
+	unsigned long	_stext;
 };
 
 struct size_table {
--- ./makedumpfile.c.org	2006-09-07 18:33:42.000000000 +0900
+++ ./makedumpfile.c	2006-09-07 18:35:15.000000000 +0900
@@ -711,6 +711,7 @@ get_symbol_info(struct DumpInfo *info)
 {
 	unsigned long sym_mem_map = NOT_FOUND_SYMBOL;
 	unsigned long sym_system_utsname = NOT_FOUND_SYMBOL;
+	unsigned long sym__stext = NOT_FOUND_SYMBOL;
 	char buf[BUFSIZE_FGETS], *mapitems[MAXARGS], *endp;
 
 	if (info->name_sysmap == NULL) {
@@ -743,16 +744,33 @@ get_symbol_info(struct DumpInfo *info)
 				return FALSE;
 			}
 		}
+		if (strcmp(mapitems[2], "_stext") == 0) {
+			sym__stext = strtoul(mapitems[0], &endp, 16);
+			if ((!sym__stext || sym__stext == ULONG_MAX)
+			    || strlen(endp) != 0) {
+				ERRMSG("The map file has invalid address of %s",
+				    mapitems[2]);
+				return FALSE;
+			}
+		}
 		if ((sym_mem_map != NOT_FOUND_SYMBOL)
-		    && (sym_system_utsname != NOT_FOUND_SYMBOL))
+		    && (sym_system_utsname != NOT_FOUND_SYMBOL)
+		    && (sym__stext != NOT_FOUND_SYMBOL))
 			break;
 	}
 	SYMBOL(mem_map) = sym_mem_map;
 	SYMBOL(system_utsname) = sym_system_utsname;
+	SYMBOL(_stext) = sym__stext;
 
 	return TRUE;
 }
 
+int
+is_kvaddr(unsigned long addr)
+{
+	return (addr >= (unsigned long)(KVBASE));
+}
+
 /*
  * Get the size of structure.
  */
@@ -880,6 +898,7 @@ generate_config(struct DumpInfo *info)
 	 */
 	WRITE_SYMBOL("mem_map", mem_map);
 	WRITE_SYMBOL("system_utsname", system_utsname);
+	WRITE_SYMBOL("_stext", _stext);
 
 	/*
 	 * write the structure size of 1st kernel
@@ -999,6 +1018,7 @@ read_config(struct DumpInfo *info)
 
 	READ_SYMBOL("mem_map", mem_map);
 	READ_SYMBOL("system_utsname", system_utsname);
+	READ_SYMBOL("_stext", _stext);
 
 	READ_STRUCTURE_SIZE("page", page);
 	READ_MEMBER_OFFSET("page.flags", page.flags);
