Skip to content

Commit 8182d4c

Browse files
wildea01gregkh
authored andcommitted
arm64: mm: ensure that the zero page is visible to the page table walker
commit 32d6397805d00573ce1fa55f408ce2bca15b0ad3 upstream. In paging_init, we allocate the zero page, memset it to zero and then point TTBR0 to it in order to avoid speculative fetches through the identity mapping. In order to guarantee that the freshly zeroed page is indeed visible to the page table walker, we need to execute a dsb instruction prior to writing the TTBR. Signed-off-by: Will Deacon <will.deacon@arm.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent c01afb9 commit 8182d4c

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

arch/arm64/mm/mmu.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -456,6 +456,9 @@ void __init paging_init(void)
456456

457457
empty_zero_page = virt_to_page(zero_page);
458458

459+
/* Ensure the zero page is visible to the page table walker */
460+
dsb(ishst);
461+
459462
/*
460463
* TTBR0 is only used for the identity mapping at this stage. Make it
461464
* point to zero page to avoid speculatively fetching new entries.

0 commit comments

Comments
 (0)