arm64: mm: Use __pa_symbol() for set_swapper_pgd()
PATCH 1/1 arm64: mm: Use __pa_symbol() for set_swapper_pgd()
commit 2330b7ca78350efcb ("arm64/mm: use fixmap to modify swapper_pg_dir") modifies the swapper_pg_dir via the fixmap as the kernel page tables have been moved to a read-only part of the kernel mapping.
Using __pa() to setup the fixmap causes CONFIG_DEBUG_VIRTUAL to fire, as this function is used on the kernel-image swapper address. The in_swapper_pgdir() test before each call of this function means set_swapper_pgd() will only ever be called when pgdp points somewhere in the kernel-image mapping of swapper_pd_dir. Use __pa_symbol().
--- arch/arm64/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
arch/arm64/mm/mmu.c +1 -1
@@ -74,7 +74,7 @@ void set_swapper_pgd(pgd_t *pgdp, pgd_t pgd)pgd_t *fixmap_pgdp;spin_lock (&swapper_pgdir_lock); - fixmap_pgdp =pgd_set_fixmap (__pa (pgdp)); + fixmap_pgdp =pgd_set_fixmap (__pa_symbol (pgdp));WRITE_ONCE (*fixmap_pgdp, pgd);/* * We need dsb(ishst) here to ensure the page-table-walker sees
Signature · 1 line
2.19.0
PATCH 1/1 arm64: mm: Use __pa_symbol() for set_swapper_pgd()
Quoted 12 lines · James Morse
commit
2330b7ca78350efcb("arm64/mm: use fixmap to modifyswapper_pg_dir") modifies theswapper_pg_dirvia the fixmap as the kernel page tables have been moved to a read-only part of the kernel mapping.Using
__pa()to setup the fixmap causesCONFIG_DEBUG_VIRTUALto fire, as this function is used on the kernel-image swapper address. Thein_swapper_pgdir()test before each call of this function meansset_swapper_pgd()will only ever be called when pgdp points somewhere in the kernel-image mapping ofswapper_pd_dir. Use__pa_symbol().
Quoted 7 lines
Reported-by Geert Uytterhoeven <[email protected]>Signed-off-by James Morse <[email protected]>CC Jun Yao <[email protected]>Tested-by Geert Uytterhoeven <[email protected]>--- arch/arm64/mm/mmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
Since this only affects for-next/core, Catalin should pick this up for 4.20.
Will
PATCH 1/1 arm64: mm: Use __pa_symbol() for set_swapper_pgd()
In reply to James MorseQuoted 12 lines · James Morse
commit
2330b7ca78350efcb("arm64/mm: use fixmap to modifyswapper_pg_dir") modifies theswapper_pg_dirvia the fixmap as the kernel page tables have been moved to a read-only part of the kernel mapping.Using
__pa()to setup the fixmap causesCONFIG_DEBUG_VIRTUALto fire, as this function is used on the kernel-image swapper address. Thein_swapper_pgdir()test before each call of this function meansset_swapper_pgd()will only ever be called when pgdp points somewhere in the kernel-image mapping ofswapper_pd_dir. Use__pa_symbol().
Quoted 4 lines
Reported-by Geert Uytterhoeven <[email protected]>Signed-off-by James Morse <[email protected]>CC Jun Yao <[email protected]>Tested-by Geert Uytterhoeven <[email protected]>
Applied. Thanks.
Signature · 1 line
Catalin