]> git.kernelconcepts.de Git - karo-tx-uboot.git/commit
x86: Implement arch_phys_memset so that it can wipe memory above 4GB
authorGabe Black <gabeblack@chromium.org>
Tue, 23 Oct 2012 18:04:46 +0000 (18:04 +0000)
committerSimon Glass <sjg@chromium.org>
Thu, 6 Dec 2012 22:30:41 +0000 (14:30 -0800)
commitac31a7b81c5519a86ddce4fde4a99ba759332abc
treec6e52cdfc23a0fbfb25a2d0d2d153894e3c416ff
parent40fef0490610686022f99b8e070df7ac761c11a0
x86: Implement arch_phys_memset so that it can wipe memory above 4GB

Implement arch_phys_memset so that it can set memory at physical addresses
above 4GB using PAE paging. Because there are only 5 page tables in PAE mode,
1 PDPT and 4 PDTs, those tables are statically allocated in the BSS. The
tables must be 4K page aligned and are declared that way, and because U-Boot
starts as 4K aligned and the relocation code relocates it to a 4K aligned
address, the tables work as intended.

While paging is turned on, all 4GB are identity mapped except for one 2MB
page which is used as the window into high memory. This way, U-Boot will
continue to work as expected when running code that expects to access memory
freely, but the code can still get at high memory through its window.

The window is put at 2MB so that it's 2MB page aligned, low in memory to be
out of the way of things U-Boot is likely to care about, and above the lowest
1MB where lots of random things live.

Signed-off-by: Gabe Black <gabeblack@chromium.org>
Signed-off-by: Simon Glass <sjg@chromium.org>
arch/x86/lib/Makefile
arch/x86/lib/physmem.c [new file with mode: 0644]