• Mark Rutland's avatar
    arm64: consistently use reserved_pg_dir · 833be850
    Mark Rutland authored
    Depending on configuration options and specific code paths, we either
    use the empty_zero_page or the configuration-dependent reserved_ttbr0
    as a reserved value for TTBR{0,1}_EL1.
    
    To simplify this code, let's always allocate and use the same
    reserved_pg_dir, replacing reserved_ttbr0. Note that this is allocated
    (and hence pre-zeroed), and is also marked as read-only in the kernel
    Image mapping.
    
    Keeping this separate from the empty_zero_page potentially helps with
    robustness as the empty_zero_page is used in a number of cases where a
    failure to map it read-only could allow it to become corrupted.
    
    The (presently unused) swapper_pg_end symbol is also removed, and
    comments are added wherever we rely on the offsets between the
    pre-allocated pg_dirs to keep these cases easily identifiable.
    Signed-off-by: default avatarMark Rutland <mark.rutland@arm.com>
    Cc: Will Deacon <will@kernel.org>
    Link: https://lore.kernel.org/r/20201103102229.8542-1-mark.rutland@arm.comSigned-off-by: default avatarCatalin Marinas <catalin.marinas@arm.com>
    833be850
mmu_context.h 6.81 KB