powerpc/64s/radix: Fix radix segment exception handling

Nicholas Piggin npiggin at gmail.com
Sat Apr 13 15:59:43 AEST 2019


Michael Ellerman's on April 13, 2019 1:39 pm:
> Nicholas Piggin <npiggin at gmail.com> writes:
>> Michael Ellerman's on April 11, 2019 12:49 am:
>>> On Fri, 2019-03-29 at 07:42:57 UTC, Nicholas Piggin wrote:
>>>> Commit 48e7b76957 ("powerpc/64s/hash: Convert SLB miss handlers to C")
>>>> broke the radix-mode segment exception handler. In radix mode, this is
>>>> exception is not an SLB miss, rather it signals that the EA is outside
>>>> the range translated by any page table.
>>>> 
>>>> The commit lost the radix feature alternate code patch, which can
>>>> cause faults to some EAs to kernel BUG at arch/powerpc/mm/slb.c:639!
>>>> 
>>>> The original radix code would send faults to slb_miss_large_addr,
>>>> which would end up faulting due to slb_addr_limit being 0. This patch
>>>> sends radix directly to do_bad_slb_fault, which is a bit clearer.
>>>> 
>>>> Fixes: 48e7b76957 ("powerpc/64s/hash: Convert SLB miss handlers to C")
>>>> Cc: Aneesh Kumar K.V <aneesh.kumar at linux.vnet.ibm.com>
>>>> Reported-by: Anton Blanchard <anton at samba.org>
>>>> Signed-off-by: Nicholas Piggin <npiggin at gmail.com>
>>>> Reviewed-by: Aneesh Kumar K.V <aneesh.kumar at linux.ibm.com>
>>> 
>>> Applied to powerpc fixes, thanks.
>>> 
>>> https://git.kernel.org/powerpc/c/7100e8704b61247649c50551b965e71d
>>
>> I sent a v2 with a selftests that triggers the crash if you want it.
>> Code was unchanged to no big deal there.
> 
> Yeah I checked the kernel part was unchanged so stuck with v1.
> 
> I also sent a self test, which is similar but slightly different to
> yours, though yours is better in general. I'll try and merge them into
> one test.

If you don't mind that would be good. The siglongjmp handler is
cleaner though, and should make it simpler to test ifetch accesses.
We just need to get the sig info into yours, and an array of
interesting addresses.

Thanks,
Nick



More information about the Linuxppc-dev mailing list