Skip to contentSkip to conversation

zap_low_mappings

DISCUSSION ishare 2 participants 7 messages Mar 7, 2013

lore
Share & tools
lore

ishare

author
#0 lore raw

kernel halts because the page mapping has been modified by zap_low_mappings ,

why we should do zap_low_mappings in init procedure ? this will disorder the page mapping.

thanks!

#1 lore raw
Quoted 5 lines · ishare

kernel halts because the page mapping has been modified by zap_low_mappings

why we should do zap_low_mappings in init procedure ? this will disorder the page mapping.

You might want to get yourself an up to date kernel, as the code you're asking about was removed almost 2 1/.2 years ago.

zap_low_mappings was removed in October 2010 by this commit:

https://git.kernel.org/cgit/linux/kernel/git/torvalds/linux.git/commit/arch/x86/mm/init_32.c?id=b40827fa7268fda8a62490728a61c2856f33830b

x86-32, mm: Add an initial page table for core bootstrapping

This patch adds an initial page table with low mappings used exclusively for booting APs/resuming after ACPI suspend/machine restart. After this, there's no need to add low mappings to swapper_pg_dir and zap them later or create own swsusp PGD page solely for ACPI sleep needs - we have initial_page_table for that.

LKML-Reference:<[email protected]>

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130306/2abb9c96/attachment-0001.bin

author
#2 lore raw

sorry for my outof date kernel .

In the zap_low_mappingd function.there is a selection for kernel,as below:

#ifdef CONFIG_X86_PAE
set_pgd(swapper_pg_dir+i, __pgd(1 + __pa(empty_zero_page)));

   #else
		set_pgd(swapper_pg_dir+i, __pgd(0));

#endif

If I have not define CONFIG_X86_PAE ,then the low mem will be invalided all . so any addressing operation will cause a page_fault because that page is not present.

Am I right ?

#3 lore raw
Quoted 3 lines · ishare
		set_pgd(swapper_pg_dir+i, __pgd(0));

If I have not define CONFIG_X86_PAE ,then the low mem will be invalided all .

And what makes you think that call invalidates *all* the page
mappings?
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130306/d0613e88/attachment.bin

author
#4 lore raw
Quoted 8 lines · Valdis.Kletnieks at vt.edu
Quoted 3 lines · ishare
		set_pgd(swapper_pg_dir+i, __pgd(0));

If I have not define CONFIG_X86_PAE ,then the low mem will be invalided all .

And what makes you think that call invalidates *all* the page mappings?

because all the pde (0-768) are set to 0x0 ,so no phsical pages are mapping to these pde . isn't it?

#5 lore raw
Quoted 2 lines · ishare

because all the pde (0-768) are set to 0x0 ,so no phsical pages are mapping to these pde . isn't it?

The pdes don't end at 768. Think about what pde numbers the kernel gets when it loads at 0xc0000000 (which is where it lands with the default 3G/1G split).

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 865 bytes
Desc: not available
Url : http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20130307/1318d572/attachment.bin

author
#6 lore raw
Quoted 7 lines · Valdis.Kletnieks at vt.edu
Quoted 2 lines · ishare

because all the pde (0-768) are set to 0x0 ,so no phsical pages are mapping to these pde . isn't it?

The pdes don't end at 768. Think about what pde numbers the kernel gets when it loads at 0xc0000000 (which is where it lands with the default 3G/1G split).

Of course , the mapping of address above 0xc0000000 have not been effected ever , think about address 0x5 there is no phsical address mapping it .

Quoted 3 lines