diff options
author | Catalin Marinas <catalin.marinas@arm.com> | 2014-02-04 11:01:31 -0500 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2014-02-20 14:06:11 -0500 |
commit | f35f27e775d6f8aa265fb698975c9c95f2757ef4 (patch) | |
tree | 4fc18801a58a85af2d5000bf6ecbaa93bb4f0808 /arch | |
parent | 6737eaebff6297e5b6aeb458a4b4ad4b61df8f57 (diff) |
arm64: Invalidate the TLB when replacing pmd entries during boot
commit a55f9929a9b257f84b6cc7b2397379cabd744a22 upstream.
With the 64K page size configuration, __create_page_tables in head.S
maps enough memory to get started but using 64K pages rather than 512M
sections with a single pgd/pud/pmd entry pointing to a pte table.
create_mapping() may override the pgd/pud/pmd table entry with a block
(section) one if the RAM size is more than 512MB and aligned correctly.
For the end of this block to be accessible, the old TLB entry must be
invalidated.
Reported-by: Mark Salter <msalter@redhat.com>
Tested-by: Mark Salter <msalter@redhat.com>
Signed-off-by: Catalin Marinas <catalin.marinas@arm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'arch')
-rw-r--r-- | arch/arm64/mm/mmu.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c index 80a369eab637..ba7477efad5c 100644 --- a/arch/arm64/mm/mmu.c +++ b/arch/arm64/mm/mmu.c | |||
@@ -203,10 +203,18 @@ static void __init alloc_init_pmd(pud_t *pud, unsigned long addr, | |||
203 | do { | 203 | do { |
204 | next = pmd_addr_end(addr, end); | 204 | next = pmd_addr_end(addr, end); |
205 | /* try section mapping first */ | 205 | /* try section mapping first */ |
206 | if (((addr | next | phys) & ~SECTION_MASK) == 0) | 206 | if (((addr | next | phys) & ~SECTION_MASK) == 0) { |
207 | pmd_t old_pmd =*pmd; | ||
207 | set_pmd(pmd, __pmd(phys | prot_sect_kernel)); | 208 | set_pmd(pmd, __pmd(phys | prot_sect_kernel)); |
208 | else | 209 | /* |
210 | * Check for previous table entries created during | ||
211 | * boot (__create_page_tables) and flush them. | ||
212 | */ | ||
213 | if (!pmd_none(old_pmd)) | ||
214 | flush_tlb_all(); | ||
215 | } else { | ||
209 | alloc_init_pte(pmd, addr, next, __phys_to_pfn(phys)); | 216 | alloc_init_pte(pmd, addr, next, __phys_to_pfn(phys)); |
217 | } | ||
210 | phys += next - addr; | 218 | phys += next - addr; |
211 | } while (pmd++, addr = next, addr != end); | 219 | } while (pmd++, addr = next, addr != end); |
212 | } | 220 | } |