In order to simplify VMAP stack implementation, move
MSR_PR test into EXCEPTION_PROLOG_0.
This requires to not modify cr0 between EXCEPTION_PROLOG_0
and EXCEPTION_PROLOG_1.
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/head_32.h | 4 ++--
arch/powerpc/kernel/head_8xx.S | 39 +++
handle_page_fault() is the only function that save DAR/DEAR itself.
Save DAR/DEAR before calling handle_page_fault() to prepare for
VMAP stack which will require to save even before.
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/entry_32.S | 1 -
arch/powerpc/kernel/head_32.S
The purpose of this serie is to enable CONFIG_VMAP_STACK on PPC32.
rfc v1: initial support on 8xx
rfc v2: added stack overflow detection.
v3:
- Stack overflow detection works, tested with LKDTM STACK_EXHAUST test
- Support for book3s32 added
v4:
- Fixed build failure with CONFIG_KVM (patch 14)
This patch creates a macro for the very first part of
exception prolog, this will help when implementing
CONFIG_VMAP_STACK
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/head_32.S | 4 +---
arch/powerpc/kernel/head_32.h | 9 ++---
arch/powerpc/kernel/head_8xx.S | 9 ++---
3 fi
On PPC32, MTMSRD() is simply defined as mtmsr.
Replace MTMSRD(reg) by mtmsr reg in files dedicated to PPC32,
this makes the code less obscure.
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/entry_32.S | 18 +-
arch/powerpc/kernel/head_32.h | 4 ++--
2 files changed, 1
In order to ease stack overflow detection, align
stack to 2 * THREAD_SIZE when using VMAP_STACK.
This allows overflow detection using a single bit check.
Signed-off-by: Christophe Leroy
---
arch/powerpc/include/asm/thread_info.h | 13 +
arch/powerpc/kernel/setup_32.c | 2 +-
In preparation of handling CONFIG_VMAP_STACK, DTLB miss handler need
to use different scratch registers than other exception handlers in
order to not jeopardise exception entry on stack DTLB misses.
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/head_8xx.S | 27 ++---
To avoid recursive faults, stack overflow detection has to be
performed before writing in the stack in exception prologs.
Do it by checking the alignment. If the stack pointer alignment is
wrong, it means it is pointing to the following or preceding page.
Without VMAP stack, a stack overflow is c
Refactor reading and saving of DAR and DSISR in exception vectors.
This will ease the implementation of VMAP stack.
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/head_32.S | 5 +
arch/powerpc/kernel/head_32.h | 11 +++
arch/powerpc/kernel/head_8xx.S | 23 +++
In order to also catch overflows on IRQ stacks, use vmapped stacks.
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/irq.c | 22 ++
arch/powerpc/kernel/setup_32.c | 3 +++
2 files changed, 25 insertions(+)
diff --git a/arch/powerpc/kernel/irq.c b/arch/powerpc/ke
To support CONFIG_VMAP_STACK, the kernel has to activate Data MMU
Translation for accessing the stack. Before doing that it must save
SRR0, SRR1 and also DAR and DSISR when relevant, in order to not
loose them in case there is a Data TLB Miss once the translation is
reactivated.
This patch adds fi
head_8xx.S has entries for all exceptions from 0x100 to 0x1f00.
Several of them do not exist and are never generated by the 8xx
in accordance with the documentation.
Remove those entry points to make some room for future growing
exception code.
Signed-off-by: Christophe Leroy
---
arch/powerpc/k
Move DataStoreTLBMiss perf handler in order to cope
with future growing exception prolog.
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/head_8xx.S | 24
1 file changed, 12 insertions(+), 12 deletions(-)
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerp
Breakpoint exception is big.
Split it to support future growth on exception prolog.
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/head_8xx.S | 19 ++-
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/arch/powerpc/kernel/head_8xx.S b/arch/powerpc/kernel/he
This patch enables CONFIG_VMAP_STACK. For that, a few changes are
done in head_8xx.S.
Signed-off-by: Christophe Leroy
---
arch/powerpc/kernel/head_8xx.S | 32 ++--
arch/powerpc/platforms/Kconfig.cputype | 1 +
2 files changed, 27 insertions(+), 6 deletions(-)
The part decidated to handling hash_page() is fully unneeded for
processors not having real hash pages like the 603.
Lets enlarge the content of the feature fixup, and provide
an alternative which jumps directly instead of getting NIPs.
Also, in preparation of VMAP stacks, the end of DSI handler
Trying VMAP_STACK with KVM, vmlinux was not starting.
This was due to SRR0 and SRR1 clobbered by an ISI due to
the rfi being in a different page than the mtsrr0/1:
c0003fe0 :
c0003fe0: 38 83 00 54 addir4,r3,84
c0003fe4: 7c 60 00 a6 mfmsr r3
c0003fe8: 70 60 00 30
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. Same on load_up_fpu()
and load_up_altivec().
Signed-off-by:
https://bugzilla.kernel.org/show_bug.cgi?id=205283
--- Comment #8 from Christophe Leroy (christophe.le...@c-s.fr) ---
Thanks for the test.
Looking once more at module_alloc() in arch/powerpc/mm/kasan/kasan_init_32.c, I
think we are missing an initialisation.
In module_alloc(), in the call to __
On Fri, Dec 20, 2019 at 03:54:55PM -0800, John Hubbard wrote:
> On 12/20/19 10:29 AM, Leon Romanovsky wrote:
> ...
> >> $ ./build.sh
> >> $ build/bin/run_tests.py
> >>
> >> If you get things that far I think Leon can get a reproduction for you
> >
> > I'm not so optimistic about that.
> >
>
> OK, I
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA256
Hi Linus,
Please pull some more powerpc fixes for 5.5:
The following changes since commit e42617b825f8073569da76dc4510bfa019b1c35a:
Linux 5.5-rc1 (2019-12-08 14:57:55 -0800)
are available in the git repository at:
https://git.kernel.org/pub/
These slice routines are called from the SLB miss handler, which can
lead to warnings from the IRQ code, because we have not reconciled the
IRQ state properly:
WARNING: CPU: 72 PID: 30150 at arch/powerpc/kernel/irq.c:258
arch_local_irq_restore.part.0+0xcc/0x100
Modules linked in:
CPU: 72 PI
The pull request you sent on Sat, 21 Dec 2019 23:04:03 +1100:
> https://git.kernel.org/pub/scm/linux/kernel/git/powerpc/linux.git
> tags/powerpc-5.5-4
has been merged into torvalds/linux.git:
https://git.kernel.org/torvalds/c/6d04182dd36dc5a4dd2e352c1d0f0241e83bd2a0
Thank you!
--
Deet-doot-do
https://bugzilla.kernel.org/show_bug.cgi?id=205283
--- Comment #9 from Erhard F. (erhar...@mailbox.org) ---
module_alloc() in arch/powerpc/mm/kasan/kasan_init_32.c now is:
#if defined(CONFIG_MODULES) && !defined(CONFIG_KASAN_VMALLOC)
void *module_alloc(unsigned long size)
{
void *base;
https://bugzilla.kernel.org/show_bug.cgi?id=205283
--- Comment #10 from Christophe Leroy (christophe.le...@c-s.fr) ---
So it must be something more. By the way, now that KASAN_VMALLOC exists and
handle module loading better, I think we should analyse the impact of
activating KASAN_VMALLOC at all t
https://bugzilla.kernel.org/show_bug.cgi?id=205099
--- Comment #9 from Erhard F. (erhar...@mailbox.org) ---
Created attachment 286395
--> https://bugzilla.kernel.org/attachment.cgi?id=286395&action=edit
dmesg (kernel 5.5-rc2+, KASAN_VMALLOC + INLINE KASAN, PowerMac G4 DP)
(In reply to Christoph
https://bugzilla.kernel.org/show_bug.cgi?id=205099
--- Comment #10 from Erhard F. (erhar...@mailbox.org) ---
Created attachment 286397
--> https://bugzilla.kernel.org/attachment.cgi?id=286397&action=edit
dmesg (kernel 5.5-rc2+, KASAN_VMALLOC + OUTLINE KASAN, PowerMac G4 DP)
--
You are receivin
On 12/21/19 2:08 AM, Leon Romanovsky wrote:
On Fri, Dec 20, 2019 at 03:54:55PM -0800, John Hubbard wrote:
On 12/20/19 10:29 AM, Leon Romanovsky wrote:
...
$ ./build.sh
$ build/bin/run_tests.py
If you get things that far I think Leon can get a reproduction for you
I'm not so optimistic about
28 matches
Mail list logo