mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "Christophe Leroy (CS GROUP)" <chleroy@kernel.org>
To: Julian Braha <julianbraha@gmail.com>, maddy@linux.ibm.com
Cc: mpe@ellerman.id.au, npiggin@gmail.com, ritesh.list@gmail.com,
	sshegde@linux.ibm.com, linuxppc-dev@lists.ozlabs.org,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/Kconfig: limit the PPC_85xx DATA_SHIFT range to STRICT_KERNEL_RWX
Date: Wed, 14 Oct 2026 14:39:18 +0200	[thread overview]
Message-ID: <c373cb30-a505-414b-850f-4356aa68595a@kernel.org> (raw)
In-Reply-To: <7eafa839-ef4e-4856-be6d-d8e0a9ab3030@gmail.com>



Le 14/10/2026 à 13:23, Julian Braha a écrit :
> On 10/12/26 11:28, Christophe Leroy (CS GROUP) wrote:
>> Le 11/10/2026 à 13:31, Julian Braha a écrit :
>>> On PPC_85xx, enabling DEBUG_PAGEALLOC without STRICT_KERNEL_RWX activates
>>> the DATA_SHIFT range of 20..24, but since the PAGE_SHIFT default is
>>> outside the range (12), kconfig adjusts it to 20, causing 1mb alignment
>>> instead of 4kb. However, the larger alignment is only needed for the
>>> separate kernel permissions provided by STRICT_KERNEL_RWX.
>>>
>>> Since PPC_85xx uses page poisoning for DEBUG_PAGEALLOC and does not
>>> support KFENCE, let's restrict this range to STRICT_KERNEL_RWX.
>>>
>>> This out-of-range default was detected by kconfirm, a static analysis
>>> tool
>>> for Kconfig.
>>
>> Looks like with this change I'm now able to set DATA_SHIFT to any value
>> when STRICT_KERNEL_RWX is not set and DEBUG_PAGEALLOC is set.
>>
>> The range used to protect against that.
> 
> Sorry, yeah kconfig can be tricky...
> 
>> +    range 20 24 if STRICT_KERNEL_RWX && PPC_85xx
> I think if we keep this ^ and then add another range:
> 
>      range PAGE_SHIFT 24 if !STRICT_KERNEL_RWX && PPC_85xx
> 
> this would cover your STRICT_KERNEL_RWX=n and DEBUG_PAGEALLOC=y
> configuration while resolving the 12 -> 20

Yes I think that should work.

Christophe

      reply	other threads:[~2026-10-14 12:39 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-11 11:31 Julian Braha
2026-10-12 10:28 ` Christophe Leroy (CS GROUP)
2026-10-14 11:23   ` Julian Braha
2026-10-14 12:39     ` Christophe Leroy (CS GROUP) [this message]

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=c373cb30-a505-414b-850f-4356aa68595a@kernel.org \
    --to=chleroy@kernel.org \
    --cc=julianbraha@gmail.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=npiggin@gmail.com \
    --cc=ritesh.list@gmail.com \
    --cc=sshegde@linux.ibm.com \
    /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

all inboxes | Powered by JetHome®