• Ard Biesheuvel's avatar
    arm64: head: simplify page table mapping macros (slightly) · 53519ddf
    Ard Biesheuvel authored
    Simplify the macros in head.S that are used to set up the early page
    tables, by switching to immediates for the number of bits that are
    interpreted as the table index at each level. This makes it much
    easier to infer from the instruction stream what is going on, and
    reduces the number of instructions emitted substantially.
    
    Note that the extended ID map for cases where no additional level needs
    to be configured now uses a compile time size as well, which means that
    we interpret up to 10 bits as the table index at the root level (for
    52-bit physical addressing), without taking into account whether or not
    this is supported on the current system.  However, those bits can only
    be set if we are executing the image from an address that exceeds the
    48-bit PA range, and are guaranteed to be cleared otherwise, and given
    that we are dealing with a mapping in the lower TTBR0 range of the
    address space, the result is therefore the same as if we'd mask off only
    6 bits.
    Signed-off-by: default avatarArd Biesheuvel <ardb@kernel.org>
    Link: https://lore.kernel.org/r/20220624150651.1358849-6-ardb@kernel.orgSigned-off-by: default avatarWill Deacon <will@kernel.org>
    53519ddf
head.S 24 KB