• Ard Biesheuvel's avatar
    arm64: simplify kernel segment mapping granularity · 97740051
    Ard Biesheuvel authored
    The mapping of the kernel consist of four segments, each of which is mapped
    with different permission attributes and/or lifetimes. To optimize the TLB
    and translation table footprint, we define various opaque constants in the
    linker script that resolve to different aligment values depending on the
    page size and whether CONFIG_DEBUG_ALIGN_RODATA is set.
    
    Considering that
    - a 4 KB granule kernel benefits from a 64 KB segment alignment (due to
      the fact that it allows the use of the contiguous bit),
    - the minimum alignment of the .data segment is THREAD_SIZE already, not
      PAGE_SIZE (i.e., we already have padding between _data and the start of
      the .data payload in many cases),
    - 2 MB is a suitable alignment value on all granule sizes, either for
      mapping directly (level 2 on 4 KB), or via the contiguous bit (level 3 on
      16 KB and 64 KB),
    - anything beyond 2 MB exceeds the minimum alignment mandated by the boot
      protocol, and can only be mapped efficien...
    97740051
Kconfig.debug 2.83 KB