mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
To: "Michal Suchánek" <msuchanek@suse.de>
Cc: linuxppc-dev@lists.ozlabs.org, maddy@linux.ibm.com,
	mpe@ellerman.id.au, npiggin@gmail.com, chleroy@kernel.org,
	mkchauras@linux.ibm.com, mkchauras@gmail.com,
	sshegde@linux.ibm.com, ruanjinjie@huawei.com,
	ritesh.list@gmail.com, riteshh@linux.ibm.com,
	linux-kernel@vger.kernel.org
Subject: Re: [PATCH] powerpc/interrupt: Use early_radix_enabled() in NMI real-mode guard
Date: Mon, 7 Sep 2026 14:24:06 +0530	[thread overview]
Message-ID: <a5836b4f-16ad-462c-bfa9-d523915239ea@linux.ibm.com> (raw)
In-Reply-To: <ap53KNdFJWaUw8GM@kunlun.suse.cz>


On 07/09/26 2:04 pm, Michal Suchánek wrote:
> Hello,
>
> On Mon, Sep 07, 2026 at 12:30:58PM +0530, Venkat Rao Bagalkote wrote:
>> radix_enabled() uses a jump label which is only valid after
>> mmu_feature_keys_init() is called. Before that point, on a pSeries
>> hash guest, early_check_vec5() clears MMU_FTR_TYPE_RADIX in
>> cur_cpu_spec->mmu_features but the jump label has not yet been patched,
>> so radix_enabled() incorrectly returns true.
>>
>> Replace radix_enabled() with early_radix_enabled() which does a plain
>> bitmask check against cur_cpu_spec->mmu_features and is correct at all
>> times, including before jump label initialization.
> Any Fixes: here?


Hello Michal,

Yes, this can have.

Fixes: 118178e62e2e ("powerpc: move NMI entry/exit code into wrapper")

As commit 118178e62e2e originally introduced !radxi_enabled() check in 
NMI wrapper path.


Regards,

Venkat.

>
> Thanks
>
> Michal
>
>> Add the missing #include <asm/mmu.h> since early_radix_enabled() is
>> declared there.
>>
>> Signed-off-by: Venkat Rao Bagalkote <venkat88@linux.ibm.com>
>> ---
>>   arch/powerpc/include/asm/interrupt.h | 5 +++--
>>   1 file changed, 3 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/powerpc/include/asm/interrupt.h b/arch/powerpc/include/asm/interrupt.h
>> index 1b45a49e9bed..36a654e780f7 100644
>> --- a/arch/powerpc/include/asm/interrupt.h
>> +++ b/arch/powerpc/include/asm/interrupt.h
>> @@ -71,6 +71,7 @@
>>   
>>   #include <asm/kprobes.h>
>>   #include <asm/runlatch.h>
>> +#include <asm/mmu.h>
>>   
>>   #ifdef CONFIG_PPC_IRQ_SOFT_MASK_DEBUG
>>   /*
>> @@ -290,7 +291,7 @@ interrupt_handler long func(struct pt_regs *regs)			\
>>   		state = irqentry_nmi_enter(regs);			\
>>   	} else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) &&			\
>>   		   firmware_has_feature(FW_FEATURE_LPAR) &&		\
>> -		   !radix_enabled()) {					\
>> +		   !early_radix_enabled()) {				\
>>   		/* no nmi_entry for a pseries hash guest		\
>>   		 * taking a real mode exception */			\
>>   	} else if (IS_ENABLED(CONFIG_KASAN)) {				\
>> @@ -307,7 +308,7 @@ interrupt_handler long func(struct pt_regs *regs)			\
>>   		irqentry_nmi_exit(regs, state);				\
>>   	} else if (IS_ENABLED(CONFIG_PPC_BOOK3S_64) &&			\
>>   		   firmware_has_feature(FW_FEATURE_LPAR) &&		\
>> -		   !radix_enabled()) {					\
>> +		   !early_radix_enabled()) {				\
>>   		/* no nmi_exit for a pseries hash guest			\
>>   		 * taking a real mode exception */			\
>>   	} else if (IS_ENABLED(CONFIG_KASAN)) {				\
>> -- 
>> 2.45.2
>>
>>

  reply	other threads:[~2026-09-07  8:54 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-07  7:00 Venkat Rao Bagalkote
2026-09-07  7:18 ` Mukesh Kumar Chaurasiya
2026-09-07  8:34 ` Michal Suchánek
2026-09-07  8:54   ` Venkat Rao Bagalkote [this message]
2026-09-07 17:27     ` Shrikanth Hegde
2026-09-08  3:52       ` Venkat Rao Bagalkote

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=a5836b4f-16ad-462c-bfa9-d523915239ea@linux.ibm.com \
    --to=venkat88@linux.ibm.com \
    --cc=chleroy@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linuxppc-dev@lists.ozlabs.org \
    --cc=maddy@linux.ibm.com \
    --cc=mkchauras@gmail.com \
    --cc=mkchauras@linux.ibm.com \
    --cc=mpe@ellerman.id.au \
    --cc=msuchanek@suse.de \
    --cc=npiggin@gmail.com \
    --cc=ritesh.list@gmail.com \
    --cc=riteshh@linux.ibm.com \
    --cc=ruanjinjie@huawei.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®