[PATCH] D50297: Align AArch64 and i386 image base to superpage

Peter Smith via Phabricator via llvm-commits llvm-commits at lists.llvm.org
Mon Sep 17 14:30:36 PDT 2018


peter.smith added a comment.

Does FreeBsd use 4Kb granules for the page size or the LLD default of 64Kb. From what I can see from the MMU documentation when 64Kb pages are used the equivalent of the Super Page size is 512MiB and not 2 MiB? If I'm right then aligning to 2MiB is only going to be beneficial when 4Kb pages are used. On the assumption that it doesn't do much harm to people using 64Kb pages I don't have any objections in changing it though. Aligning to 512MiB for 64kb pages sounds a bit extreme though.

To summarise if Android/Bionic are happy that this isn't going to be a problem then I'm ok with it.



================
Comment at: ELF/Arch/AArch64.cpp:73
+  DefaultImageBase = 0x200000;
+
   // It doesn't seem to be documented anywhere, but tls on aarch64 uses variant
----------------
My understanding is that when 64k pages are used (see DefaultMaxPageSize) the size of the huge/super page is 512MiB. Aligning to 2MiB on AArch64 may not be effective for the default 64kb pages.

At the moment the most official reference I can find is in the Arm ARM VMSAv8-64 translation table level 0, level 1, and level 2 descriptor formats
https://static.docs.arm.com/ddi0487/ca/DDI0487C_a_armv8_arm.pdf



Repository:
  rLLD LLVM Linker

https://reviews.llvm.org/D50297





More information about the llvm-commits mailing list