Set the default image base on arm64 and i386 to a superpage-aligned

address.

Reviewed by:	emaste, markj
Discussed with:	dim
Differential Revision:	https://reviews.freebsd.org/D16385
This commit is contained in:
Alan Cox 2018-08-04 02:30:51 +00:00
parent 8f410865b8
commit 1856c32ef6
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=337282
2 changed files with 8 additions and 0 deletions

View File

@ -66,6 +66,10 @@ AArch64::AArch64() {
PltHeaderSize = 32;
DefaultMaxPageSize = 65536;
// Align to the 2 MiB page size (known as a superpage or huge page).
// FreeBSD automatically promotes 2 MiB-aligned allocations.
DefaultImageBase = 0x200000;
// It doesn't seem to be documented anywhere, but tls on aarch64 uses variant
// 1 of the tls structures and the tcb size is 16.
TcbSize = 16;

View File

@ -61,6 +61,10 @@ X86::X86() {
PltHeaderSize = 16;
TlsGdRelaxSkip = 2;
TrapInstr = 0xcccccccc; // 0xcc = INT3
// Align to the non-PAE large page size (known as a superpage or huge page).
// FreeBSD automatically promotes large, superpage-aligned allocations.
DefaultImageBase = 0x400000;
}
static bool hasBaseReg(uint8_t ModRM) { return (ModRM & 0xc7) != 0x5; }