From: mark.rutland@arm.com (Mark Rutland)
To: linux-arm-kernel@lists.infradead.org
Subject: [PATCHv3 05/18] arm64: unmap idmap earlier
Date: Mon, 25 Jan 2016 11:44:59 +0000 [thread overview]
Message-ID: <1453722312-23076-6-git-send-email-mark.rutland@arm.com> (raw)
In-Reply-To: <1453722312-23076-1-git-send-email-mark.rutland@arm.com>
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 <mark.rutland@arm.com>
Reviewed-by: Catalin Marinas <catalin.marinas@arm.com>
Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Reviewed-by: Ard Biesheuvel <ard.biesheuvel@linaro.org>
Cc: Jeremy Linton <jeremy.linton@arm.com>
Cc: Laura Abbott <labbott@fedoraproject.org>
Cc: Will Deacon <will.deacon@arm.com>
---
arch/arm64/kernel/setup.c | 6 ++++++
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 f6621ba..cfed56f 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 e85a719..c3ea9df 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();
}
/*
--
1.9.1
next prev parent reply other threads:[~2016-01-25 11:44 UTC|newest]
Thread overview: 21+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-01-25 11:44 [PATCHv3 00/18] arm64: mm: rework page table creation Mark Rutland
2016-01-25 11:44 ` [PATCHv3 01/18] asm-generic: make __set_fixmap_offset a static inline Mark Rutland
2016-01-25 11:44 ` [PATCHv3 02/18] arm64: mm: specialise pagetable allocators Mark Rutland
2016-01-25 11:44 ` [PATCHv3 03/18] arm64: mm: place empty_zero_page in bss Mark Rutland
2016-01-25 11:44 ` [PATCHv3 04/18] arm64: unify idmap removal Mark Rutland
2016-01-25 11:44 ` Mark Rutland [this message]
2016-01-25 11:45 ` [PATCHv3 06/18] arm64: add function to install the idmap Mark Rutland
2016-01-25 11:45 ` [PATCHv3 07/18] arm64: mm: add code to safely replace TTBR1_EL1 Mark Rutland
2016-01-25 11:45 ` [PATCHv3 08/18] arm64: kasan: avoid TLB conflicts Mark Rutland
2016-01-25 11:45 ` [PATCHv3 09/18] arm64: mm: move pte_* macros Mark Rutland
2016-01-25 11:45 ` [PATCHv3 10/18] arm64: mm: add functions to walk page tables by PA Mark Rutland
2016-01-25 11:45 ` [PATCHv3 11/18] arm64: mm: avoid redundant __pa(__va(x)) Mark Rutland
2016-01-25 11:45 ` [PATCHv3 12/18] arm64: mm: add __{pud,pgd}_populate Mark Rutland
2016-01-25 11:45 ` [PATCHv3 13/18] arm64: mm: add functions to walk tables in fixmap Mark Rutland
2016-01-25 11:45 ` [PATCHv3 14/18] arm64: mm: use fixmap when creating page tables Mark Rutland
2016-01-25 11:45 ` [PATCHv3 15/18] arm64: mm: allocate pagetables anywhere Mark Rutland
2016-01-25 11:45 ` [PATCHv3 16/18] arm64: mm: allow passing a pgdir to alloc_init_* Mark Rutland
2016-01-25 11:45 ` [PATCHv3 17/18] arm64: ensure _stext and _etext are page-aligned Mark Rutland
2016-01-25 11:45 ` [PATCHv3 18/18] arm64: mm: create new fine-grained mappings at boot Mark Rutland
2016-01-27 15:43 ` [PATCHv3 00/18] arm64: mm: rework page table creation Jeremy Linton
2016-01-28 15:07 ` Catalin Marinas
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1453722312-23076-6-git-send-email-mark.rutland@arm.com \
--to=mark.rutland@arm.com \
--cc=linux-arm-kernel@lists.infradead.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).