Re: [PATCH v3 15/15] powerpc/32s: Activate CONFIG_VMAP_STACK

From: Christophe Leroy
Date: Tue Nov 26 2019 - 04:01:27 EST




Le 19/11/2019 Ã 07:58, Michael Ellerman a ÃcritÂ:
Christophe Leroy <christophe.leroy@xxxxxx> writes:
A few changes to retrieve DAR and DSISR from struct regs
instead of retrieving them directly, as they may have
changed due to a TLB miss.

Also modifies hash_page() and friends to work with virtual
data addresses instead of physical ones.

Signed-off-by: Christophe Leroy <christophe.leroy@xxxxxx>
---
arch/powerpc/kernel/entry_32.S | 4 +++
arch/powerpc/kernel/head_32.S | 19 +++++++++++---
arch/powerpc/kernel/head_32.h | 4 ++-
arch/powerpc/mm/book3s32/hash_low.S | 46 +++++++++++++++++++++-------------
arch/powerpc/mm/book3s32/mmu.c | 9 +++++--
arch/powerpc/platforms/Kconfig.cputype | 2 ++
6 files changed, 61 insertions(+), 23 deletions(-)

This is faulting with qemu mac99 model:

Key type id_resolver registered
Key type id_legacy registered
BUG: Unable to handle kernel data access on read at 0x2f0db684
Faulting instruction address: 0x00004130
Oops: Kernel access of bad area, sig: 11 [#1]
BE PAGE_SIZE=4K MMU=Hash PowerMac
Modules linked in:
CPU: 0 PID: 65 Comm: modprobe Not tainted 5.4.0-rc2-gcc49+ #63
NIP: 00004130 LR: 000008c8 CTR: b7eb86e0

Problem found, that's in load_up_fpu(), have to apply tovirt() to the address read from SPRN_SPRG_THREAD. Same problem in load_up_altivec().
I'll fix that in v4 today.

Christophe