* [PATCH] arm64: mm: Use __pa_symbol() for set_swapper_pgd()
@ 2018-10-10 14:43 James Morse
2018-10-10 14:52 ` Will Deacon
2018-10-10 16:57 ` Catalin Marinas
0 siblings, 2 replies; 3+ messages in thread
From: James Morse @ 2018-10-10 14:43 UTC (permalink / raw)
To: linux-arm-kernel
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().
Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
Signed-off-by: James Morse <james.morse@arm.com>
CC: Jun Yao <yaojun8558363@gmail.com>
Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
arch/arm64/mm/mmu.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/arch/arm64/mm/mmu.c b/arch/arm64/mm/mmu.c
index 6f0e2edcc114..6deb836a102a 100644
--- a/arch/arm64/mm/mmu.c
+++ b/arch/arm64/mm/mmu.c
@@ -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
--
2.19.0
^ permalink raw reply related [flat|nested] 3+ messages in thread* [PATCH] arm64: mm: Use __pa_symbol() for set_swapper_pgd()
2018-10-10 14:43 [PATCH] arm64: mm: Use __pa_symbol() for set_swapper_pgd() James Morse
@ 2018-10-10 14:52 ` Will Deacon
2018-10-10 16:57 ` Catalin Marinas
1 sibling, 0 replies; 3+ messages in thread
From: Will Deacon @ 2018-10-10 14:52 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Oct 10, 2018 at 03:43:22PM +0100, James Morse wrote:
> 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().
>
> Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: James Morse <james.morse@arm.com>
> CC: Jun Yao <yaojun8558363@gmail.com>
> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
> ---
> 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.
Acked-by: Will Deacon <will.deacon@arm.com>
Will
^ permalink raw reply [flat|nested] 3+ messages in thread* [PATCH] arm64: mm: Use __pa_symbol() for set_swapper_pgd()
2018-10-10 14:43 [PATCH] arm64: mm: Use __pa_symbol() for set_swapper_pgd() James Morse
2018-10-10 14:52 ` Will Deacon
@ 2018-10-10 16:57 ` Catalin Marinas
1 sibling, 0 replies; 3+ messages in thread
From: Catalin Marinas @ 2018-10-10 16:57 UTC (permalink / raw)
To: linux-arm-kernel
On Wed, Oct 10, 2018 at 03:43:22PM +0100, James Morse wrote:
> 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().
>
> Reported-by: Geert Uytterhoeven <geert+renesas@glider.be>
> Signed-off-by: James Morse <james.morse@arm.com>
> CC: Jun Yao <yaojun8558363@gmail.com>
> Tested-by: Geert Uytterhoeven <geert+renesas@glider.be>
Applied. Thanks.
--
Catalin
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2018-10-10 16:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-10-10 14:43 [PATCH] arm64: mm: Use __pa_symbol() for set_swapper_pgd() James Morse
2018-10-10 14:52 ` Will Deacon
2018-10-10 16:57 ` Catalin Marinas
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).