diff options
| author | Mark Rutland <[email protected]> | 2016-01-25 11:44:59 +0000 |
|---|---|---|
| committer | Catalin Marinas <[email protected]> | 2016-02-16 15:10:45 +0000 |
| commit | 86ccce896cb0aa800a7a6dcd29b41ffc4eeb1a75 (patch) | |
| tree | f82b5e210e2546c9471e7a3a498b1663aa71be52 | |
| parent | 9e8e865bbe294a69666a1996bda3e87825b258c0 (diff) | |
arm64: unmap idmap earlier
During boot we leave the idmap in place until paging_init, as we
previously had to wait for the zero page to become allocated and
accessible.
Now that we have a statically-allocated zero page, we can uninstall the
idmap much earlier in the boot process, making it far easier to spot
accidental use of physical addresses. This also brings the cold boot
path in line with the secondary boot path.
Signed-off-by: Mark Rutland <[email protected]>
Reviewed-by: Catalin Marinas <[email protected]>
Tested-by: Ard Biesheuvel <[email protected]>
Reviewed-by: Ard Biesheuvel <[email protected]>
Tested-by: Jeremy Linton <[email protected]>
Cc: Laura Abbott <[email protected]>
Cc: Will Deacon <[email protected]>
Signed-off-by: Catalin Marinas <[email protected]>
| -rw-r--r-- | arch/arm64/kernel/setup.c | 6 | ||||
| -rw-r--r-- | arch/arm64/mm/mmu.c | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/arch/arm64/kernel/setup.c b/arch/arm64/kernel/setup.c index f6621ba071f9..cfed56f0ad26 100644 --- a/arch/arm64/kernel/setup.c +++ b/arch/arm64/kernel/setup.c @@ -314,6 +314,12 @@ void __init setup_arch(char **cmdline_p) */ local_async_enable(); + /* + * TTBR0 is only used for the identity mapping at this stage. Make it + * point to zero page to avoid speculatively fetching new entries. + */ + cpu_uninstall_idmap(); + efi_init(); arm64_memblock_init(); diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index e85a719f9f1f..c3ea9df80712 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c @@ -463,12 +463,6 @@ void __init paging_init(void) fixup_executable(); bootmem_init(); - - /* - * TTBR0 is only used for the identity mapping at this stage. Make it - * point to zero page to avoid speculatively fetching new entries. - */ - cpu_uninstall_idmap(); } /* |