Wu Fengguang 36e15263aa kcore: add _text to KCORE_TEXT
Extend KCORE_TEXT to cover the pages between _text and _stext, to allow
examining some important page table pages.

`readelf -a` output on x86_64 before and after patch:
	  Type           Offset             VirtAddr           PhysAddr
before    LOAD           0x00007fff8100c000 0xffffffff81009000 0x0000000000000000
after     LOAD           0x00007fff81003000 0xffffffff81000000 0x0000000000000000

The newly covered pages are:

	0xffffffff81000000 <startup_64> etc.
	0xffffffff81001000 <init_level4_pgt>
	0xffffffff81002000 <level3_ident_pgt>
	0xffffffff81003000 <level3_kernel_pgt>
	0xffffffff81004000 <level2_fixmap_pgt>
	0xffffffff81005000 <level1_fixmap_pgt>
	0xffffffff81006000 <level2_ident_pgt>
	0xffffffff81007000 <level2_kernel_pgt>
	0xffffffff81008000 <level2_spare_pgt>

Before patch, /proc/kcore shows outdated contents for the above page
table pages, for example:

	(gdb) p level3_ident_pgt
	$1 = {<text variable, no debug info>} 0xffffffff81002000 <level3_ident_pgt>
	(gdb) p/x *((pud_t *)&level3_ident_pgt)@512
	$2 = {{pud = 0x1006063}, {pud = 0x0} <repeats 511 times>}

while the real content is:

	root@hp /home/wfg# hexdump -s 0x1002000 -n 4096 /dev/mem
	1002000 6063 0100 0000 0000 8067 0000 0000 0000
	1002010 0000 0000 0000 0000 0000 0000 0000 0000
	*
	1003000

That is, on a x86_64 box with 2GB memory, we can see first-1GB / full-2GB
identity mapping before/after patch:

	(gdb) p/x *((pud_t *)&level3_ident_pgt)@512
before  $1 = {{pud = 0x1006063}, {pud = 0x0} <repeats 511 times>}
after   $1 = {{pud = 0x1006063}, {pud = 0x8067}, {pud = 0x0} <repeats 510 times>}

Obviously the content before patch is wrong.

Signed-off-by: Wu Fengguang <fengguang.wu@intel.com>
Cc: Andi Kleen <andi@firstfloor.org>
Cc: KAMEZAWA Hiroyuki <kamezawa.hiroyu@jp.fujitsu.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2010-05-27 09:12:47 -07:00
..
2010-05-27 09:12:41 -07:00
2010-04-30 14:52:51 -05:00
2009-06-17 00:36:36 -04:00
2010-05-25 08:07:04 -07:00
2010-05-21 18:31:20 -04:00
2010-05-17 05:27:42 +02:00
2010-05-25 08:07:03 -07:00
2010-05-27 09:12:47 -07:00
2010-05-21 18:31:16 -04:00
2010-01-26 22:22:26 -05:00
2010-05-25 08:07:07 -07:00
2009-12-16 07:20:13 -08:00
2010-03-06 11:26:29 -08:00
2010-03-19 08:05:10 +01:00
2009-09-24 07:21:03 -07:00
2010-05-21 18:31:16 -04:00
2009-12-17 04:52:13 -05:00
2010-05-21 18:31:16 -04:00
2010-05-11 17:43:58 +02:00
2010-05-21 21:27:26 +02:00
2010-03-06 11:26:29 -08:00
2010-05-21 18:31:16 -04:00
2010-03-08 16:55:37 +01:00
2010-05-21 18:31:17 -04:00
2010-05-21 18:31:22 -04:00
2010-05-18 08:57:00 +10:00
2010-05-21 18:31:17 -04:00
2010-03-12 15:52:32 -08:00
2010-05-21 18:31:17 -04:00