From: Segher Boessenkool <segher@kernel.crashing.org>
To: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Serge Belyshev <belyshev@depni.sinp.msu.ru>,
linux-kernel@vger.kernel.org, stable@vger.kernel.org,
Paul Mackerras <paulus@samba.org>,
linuxppc-dev@lists.ozlabs.org
Subject: Re: [PATCH] powerpc/32s: fix BATs setting with CONFIG_STRICT_KERNEL_RWX
Date: Mon, 29 Apr 2019 07:03:22 -0500 [thread overview]
Message-ID: <20190429120322.GP8599@gate.crashing.org> (raw)
In-Reply-To: <3a21c6f19637847e6ed080186a834ede619f3849.1556528569.git.christophe.leroy@c-s.fr>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
(But see comments below.)
On Mon, Apr 29, 2019 at 09:08:09AM +0000, Christophe Leroy wrote:
> diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
> index bf1de3ca39bc..37cf2af98f6a 100644
> --- a/arch/powerpc/mm/ppc_mmu_32.c
> +++ b/arch/powerpc/mm/ppc_mmu_32.c
> @@ -101,7 +101,7 @@ static int find_free_bat(void)
> static unsigned int block_size(unsigned long base, unsigned long top)
> {
> unsigned int max_size = (cpu_has_feature(CPU_FTR_601) ? 8 : 256) << 20;
> - unsigned int base_shift = (fls(base) - 1) & 31;
> + unsigned int base_shift = (ffs(base) - 1) & 31;
> unsigned int block_shift = (fls(top - base) - 1) & 31;
The code is quite confusing now... Add a comment, or improve it?
Segher
WARNING: multiple messages have this Message-ID (diff)
From: Segher Boessenkool <segher@kernel.crashing.org>
To: Christophe Leroy <christophe.leroy@c-s.fr>
Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>,
Paul Mackerras <paulus@samba.org>,
Michael Ellerman <mpe@ellerman.id.au>,
Serge Belyshev <belyshev@depni.sinp.msu.ru>,
linuxppc-dev@lists.ozlabs.org, linux-kernel@vger.kernel.org,
stable@vger.kernel.org
Subject: Re: [PATCH] powerpc/32s: fix BATs setting with CONFIG_STRICT_KERNEL_RWX
Date: Mon, 29 Apr 2019 07:03:22 -0500 [thread overview]
Message-ID: <20190429120322.GP8599@gate.crashing.org> (raw)
In-Reply-To: <3a21c6f19637847e6ed080186a834ede619f3849.1556528569.git.christophe.leroy@c-s.fr>
Acked-by: Segher Boessenkool <segher@kernel.crashing.org>
(But see comments below.)
On Mon, Apr 29, 2019 at 09:08:09AM +0000, Christophe Leroy wrote:
> diff --git a/arch/powerpc/mm/ppc_mmu_32.c b/arch/powerpc/mm/ppc_mmu_32.c
> index bf1de3ca39bc..37cf2af98f6a 100644
> --- a/arch/powerpc/mm/ppc_mmu_32.c
> +++ b/arch/powerpc/mm/ppc_mmu_32.c
> @@ -101,7 +101,7 @@ static int find_free_bat(void)
> static unsigned int block_size(unsigned long base, unsigned long top)
> {
> unsigned int max_size = (cpu_has_feature(CPU_FTR_601) ? 8 : 256) << 20;
> - unsigned int base_shift = (fls(base) - 1) & 31;
> + unsigned int base_shift = (ffs(base) - 1) & 31;
> unsigned int block_shift = (fls(top - base) - 1) & 31;
The code is quite confusing now... Add a comment, or improve it?
Segher
next prev parent reply other threads:[~2019-04-29 12:04 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-29 9:08 [PATCH] powerpc/32s: fix BATs setting with CONFIG_STRICT_KERNEL_RWX Christophe Leroy
2019-04-29 9:08 ` Christophe Leroy
2019-04-29 12:03 ` Segher Boessenkool [this message]
2019-04-29 12:03 ` Segher Boessenkool
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=20190429120322.GP8599@gate.crashing.org \
--to=segher@kernel.crashing.org \
--cc=belyshev@depni.sinp.msu.ru \
--cc=christophe.leroy@c-s.fr \
--cc=linux-kernel@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=paulus@samba.org \
--cc=stable@vger.kernel.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.