From: christophe leroy <christophe.leroy@c-s.fr>
To: Michael Ellerman <mpe@ellerman.id.au>,
Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Serge Belyshev <belyshev@depni.sinp.msu.ru>,
Segher Boessenkool <segher@kernel.crashing.org>
Cc: linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org
Subject: Re: [PATCH v2] powerpc/32s: fix BATs setting with CONFIG_STRICT_KERNEL_RWX
Date: Wed, 1 May 2019 19:22:06 +0200 [thread overview]
Message-ID: <47f3caee-510b-a95c-cf08-013a282141b6@c-s.fr> (raw)
In-Reply-To: <878svrat7x.fsf@concordia.ellerman.id.au>
Le 01/05/2019 à 02:55, Michael Ellerman a écrit :
> Christophe Leroy <christophe.leroy@c-s.fr> writes:
>> Serge reported some crashes with CONFIG_STRICT_KERNEL_RWX enabled
>> on a book3s32 machine.
>>
>> Analysis shows two issues:
>> - BATs addresses and sizes are not properly aligned.
>> - There is a gap between the last address covered by BATs and the
>> first address covered by pages.
>>
>> Memory mapped with DBATs:
>> 0: 0xc0000000-0xc07fffff 0x00000000 Kernel RO coherent
>> 1: 0xc0800000-0xc0bfffff 0x00800000 Kernel RO coherent
>> 2: 0xc0c00000-0xc13fffff 0x00c00000 Kernel RW coherent
>> 3: 0xc1400000-0xc23fffff 0x01400000 Kernel RW coherent
>> 4: 0xc2400000-0xc43fffff 0x02400000 Kernel RW coherent
>> 5: 0xc4400000-0xc83fffff 0x04400000 Kernel RW coherent
>> 6: 0xc8400000-0xd03fffff 0x08400000 Kernel RW coherent
>> 7: 0xd0400000-0xe03fffff 0x10400000 Kernel RW coherent
>>
>> Memory mapped with pages:
>> 0xe1000000-0xefffffff 0x21000000 240M rw present dirty accessed
>>
>> This patch fixes both issues. With the patch, we get the following
>> which is as expected:
>>
>> Memory mapped with DBATs:
>> 0: 0xc0000000-0xc07fffff 0x00000000 Kernel RO coherent
>> 1: 0xc0800000-0xc0bfffff 0x00800000 Kernel RO coherent
>> 2: 0xc0c00000-0xc0ffffff 0x00c00000 Kernel RW coherent
>> 3: 0xc1000000-0xc1ffffff 0x01000000 Kernel RW coherent
>> 4: 0xc2000000-0xc3ffffff 0x02000000 Kernel RW coherent
>> 5: 0xc4000000-0xc7ffffff 0x04000000 Kernel RW coherent
>> 6: 0xc8000000-0xcfffffff 0x08000000 Kernel RW coherent
>> 7: 0xd0000000-0xdfffffff 0x10000000 Kernel RW coherent
>>
>> Memory mapped with pages:
>> 0xe0000000-0xefffffff 0x20000000 256M rw present dirty accessed
>>
>> Reported-by: Serge Belyshev <belyshev@depni.sinp.msu.ru>
>> Fixes: 63b2bc619565 ("powerpc/mm/32s: Use BATs for STRICT_KERNEL_RWX")
>> Cc: stable@vger.kernel.org
>
> I could probably still get this into v5.1 if you're confident it's a
> good fix.
If possible it would be great.
Yes I'm confident it is a good fix:
- The fix has no impact on the configurations I tested originally (they
were lacking a trailing area not mapped with BATs and the boundarie
between RW and RO was a power of 2 so ffs() returned the same as lfs())
- The fix was tested by myself on QEMU.
- The fix was tested by Serge.
- The fix was acked by Segher.
- The fix make sense (ie ffs() is the good one, fls() was definitly wrong)
Christophe
>
> cheers
>
---
L'absence de virus dans ce courrier électronique a été vérifiée par le logiciel antivirus Avast.
https://www.avast.com/antivirus
next prev parent reply other threads:[~2019-05-01 17:23 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-30 16:11 [PATCH v2] powerpc/32s: fix BATs setting with CONFIG_STRICT_KERNEL_RWX Christophe Leroy
2019-05-01 0:55 ` Michael Ellerman
2019-05-01 17:22 ` christophe leroy [this message]
2019-05-03 7:05 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=47f3caee-510b-a95c-cf08-013a282141b6@c-s.fr \
--to=christophe.leroy@c-s.fr \
--cc=belyshev@depni.sinp.msu.ru \
--cc=benh@kernel.crashing.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mpe@ellerman.id.au \
--cc=paulus@samba.org \
--cc=segher@kernel.crashing.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).