coreboot-kgpe-d16/util
Aaron Durbin e5372ded41 util/x86: add page page table generator
Certain platforms need paging enabled during cache-as-ram because
dirty lines are being evicted by a heavy speculative frontend. Paging
needs to be enabled in order to utilize the NX (no execute) bit for
the regions that are strictly data (such as the stack). This utility
creates 32-bit PAE page tables using a static address space, and
the resulting tables have entries for all the PDPTEs such that it makes
it easy to enable 2MiB naturally aligned DRAM mappings once memory is
trained. Either binary files can be generated or C files. The pages that
are linked use a default base address of 0xaa000000 that can be changed at
runtime to reflect where the page tables are actually loaded. Or
specify a physical address on the command line that is known a priori.

iomap.txt:
0xd0000000, 0x100000000, UC, NX # All of MMIO
0xff000000, 0x100000000, WP, # memory-mapped SPI
0xffff8000, 0x100000000, WP, # XIP bootblock
0xfef00000, 0xfefc0000, WB, NX # CAR
0xfef40000, 0xfefc0000, WB, # verstage
0xfef20000, 0xfefc0000, WB, # romstage
0xfef40000, 0xfefc0000, WB, # fsp-m

$ go run util/x86/x86_page_tables.go --iomap_file=iomap.txt
Merged address space:
00000000d0000000 -- 00000000fef00000 UC NX : 375 big 256 small
00000000fef00000 -- 00000000fef20000 WB NX : 0 big 32 small
00000000fef20000 -- 00000000fefc0000 WB    : 0 big 160 small
00000000fefc0000 -- 00000000ff000000 UC NX : 0 big 64 small
00000000ff000000 -- 0000000100000000 WP    : 8 big 0 small

Total Pages of page tables: 5

Pages linked using base address of 0xaa000000.

BUG=b:72728953

Change-Id: I47625a24979b196011e2293712a8cdbdbb880d79
Signed-off-by: Aaron Durbin <adurbin@chromium.org>
Reviewed-on: https://review.coreboot.org/24919
Reviewed-by: Furquan Shaikh <furquan@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
2018-03-07 21:15:43 +00:00
..
abuild
acpi
amdfwtool util/amdfwtool/amdfwtool.c: Check fstat return 2018-02-22 09:59:40 +00:00
amdtools
archive
arm_boot_tools/mksunxiboot
autoport autoport: Don't do writes to FD in romstage 2018-01-30 23:17:58 +00:00
bimgtool
bincfg util/bincfg: don't use fp shared variable 2018-01-23 05:21:48 +00:00
board_status board_status: Make board_status more friendly for local usage 2018-02-16 22:40:20 +00:00
broadcom util/broadcom/secimage: Add distclean target 2018-02-10 23:49:58 +00:00
cbfstool cbfstool: Add install target to Makefile 2018-03-06 22:19:47 +00:00
cbmem util/cbmem: Re-order regex for "cbmem -1" 2018-02-19 22:00:16 +00:00
checklist
chromeos
crossgcc buildgcc: Add patch to work around Musl libc issue 2018-01-15 01:15:27 +00:00
docker util/docker/coreboot-sdk: Add libftdi1-dev 2018-01-31 16:44:25 +00:00
dtd_parser
ectool
exynos
futility
fuzz-tests
genbuild_h util/genbuild_h: Add gitfile support 2018-01-23 05:33:02 +00:00
genprof
gitconfig util/gitconfig: Replace printf with heredoc 2018-01-23 05:22:40 +00:00
hugo
ifdfake
ifdtool util/ifdtool: Fix region limitation check 2017-10-22 01:51:17 +00:00
intelmetool util/intelmetool: Fix some platforms 2017-11-30 17:19:08 +00:00
inteltool inteltool: Add Cougar- and Pantherpoint PCH PCI IDs for SPI 2018-02-06 16:11:45 +00:00
intelvbttool
ipqheader util/*: Fix final newlines in scripts 2018-01-23 05:17:44 +00:00
k8resdump util/*: don't strip executables 2017-10-29 08:48:56 +00:00
kbc1126
kconfig
lint util/lint/checkpatch.pl: Untaint filename 2018-01-29 15:34:59 +00:00
marvell
me_cleaner util/*: Fix final newlines in scripts 2018-01-23 05:17:44 +00:00
mma
msrtool
mtkheader
nvidia
nvramtool nvramtool: Fix message when option table is not found 2018-02-06 15:29:30 +00:00
optionlist
post
release util/release: Improve git worktree checks 2018-01-17 16:54:22 +00:00
riscvtools util: make-spike-elf.sh: Fix busybox mktemp compatibility 2018-02-20 23:14:06 +00:00
rockchip
romcc
sconfig sconfig: Add a new mmio resource type 2018-01-25 16:50:17 +00:00
scripts util: Make TZ environment variable POSIX compatible 2017-10-14 11:28:14 +00:00
showdevicetree sconfig: Add a new mmio resource type 2018-01-25 16:50:17 +00:00
spkmodem_recv
superiotool util/superiotool: dump VT1211 registers 2018-01-15 00:42:43 +00:00
testing util/broadcom/secimage: Add HMAC test 2018-02-06 16:14:33 +00:00
uio_usbdebug
vgabios
viatool
x86 util/x86: add page page table generator 2018-03-07 21:15:43 +00:00
xcompile