Skip to content

Commit c05b439

Browse files
wildea01gregkh
authored andcommitted
arm64: mm: ensure that the zero page is visible to the page table walker
commit 32d6397 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 <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent c87aa8c commit c05b439

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

arch/arm64/mm/mmu.c

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

375375
empty_zero_page = virt_to_page(zero_page);
376376

377+
/* Ensure the zero page is visible to the page table walker */
378+
dsb(ishst);
379+
377380
/*
378381
* TTBR0 is only used for the identity mapping at this stage. Make it
379382
* point to zero page to avoid speculatively fetching new entries.

0 commit comments

Comments
 (0)