From: Ganesh <ganeshgr@linux.ibm.com>
To: "Michal Suchánek" <msuchanek@suse.de>, npiggin@gmail.com
Cc: linuxppc-dev@lists.ozlabs.org, mahesh@linux.vnet.ibm.com
Subject: Re: [PATCH 1/3] powerpc/mce: remove nmi_enter/exit from real mode handler
Date: Fri, 18 Sep 2020 17:34:16 +0530 [thread overview]
Message-ID: <37edc6de-d55a-ec9e-a6f1-ae4535a3bfd9@linux.ibm.com> (raw)
In-Reply-To: <20200917122028.GP29778@kitsune.suse.cz>
On 9/17/20 5:50 PM, Michal Suchánek wrote:
> Hello,
>
> On Wed, Sep 16, 2020 at 10:52:26PM +0530, Ganesh Goudar wrote:
>> Use of nmi_enter/exit in real mode handler causes the kernel to panic
>> and reboot on injecting slb mutihit on pseries machine running in hash
>> mmu mode, As these calls try to accesses memory outside RMO region in
>> real mode handler where translation is disabled.
>>
>> Add check to not to use these calls on pseries machine running in hash
>> mmu mode.
>>
>> Fixes: 116ac378bb3f ("powerpc/64s: machine check interrupt update NMI accounting")
>> Signed-off-by: Ganesh Goudar <ganeshgr@linux.ibm.com>
>> ---
>> arch/powerpc/kernel/mce.c | 7 ++++++-
>> 1 file changed, 6 insertions(+), 1 deletion(-)
>>
>> diff --git a/arch/powerpc/kernel/mce.c b/arch/powerpc/kernel/mce.c
>> index ada59f6c4298..1d42fe0f5f9c 100644
>> --- a/arch/powerpc/kernel/mce.c
>> +++ b/arch/powerpc/kernel/mce.c
>> @@ -591,10 +591,15 @@ EXPORT_SYMBOL_GPL(machine_check_print_event_info);
>> long notrace machine_check_early(struct pt_regs *regs)
>> {
>> long handled = 0;
>> - bool nested = in_nmi();
>> + bool nested;
>> + bool is_pseries_hpt_guest;
>> u8 ftrace_enabled = this_cpu_get_ftrace_enabled();
>>
>> this_cpu_set_ftrace_enabled(0);
>> + is_pseries_hpt_guest = machine_is(pseries) &&
>> + mmu_has_feature(MMU_FTR_HPTE_TABLE);
>> + /* Do not use nmi_enter/exit for pseries hpte guest */
>> + nested = is_pseries_hpt_guest ? true : in_nmi();
> As pointed out already in another comment nesting is supported natively
> since 69ea03b56ed2c7189ccd0b5910ad39f3cad1df21. You can simply do
> nmi_enter and nmi_exit unconditionally - or only based on
> is_pseries_hpt_guest.
ok
> The other question is what is the value of calling nmi_enter here at
> all. It crashes in one case, we simply skip it for that case, and we are
> good. Maybe we could skip it altogether?
Not sure why nmi_enter/exit is needed here, Again, Nick may have a reason.
> Thanks
>
> Michal
next prev parent reply other threads:[~2020-09-18 12:06 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-16 17:22 [PATCH 0/3] powerpc/mce: Fix mce handler and add selftest Ganesh Goudar
2020-09-16 17:22 ` [PATCH 1/3] powerpc/mce: remove nmi_enter/exit from real mode handler Ganesh Goudar
2020-09-17 12:20 ` Michal Suchánek
2020-09-18 12:04 ` Ganesh [this message]
2020-09-16 17:22 ` [PATCH 2/3] powerpc/mce: Add debugfs interface to inject MCE Ganesh Goudar
2020-09-17 8:24 ` kernel test robot
2020-09-17 8:36 ` kernel test robot
2020-09-17 12:23 ` Michal Suchánek
2020-09-18 12:06 ` Ganesh
2020-09-18 6:40 ` Michael Ellerman
2020-09-18 12:07 ` Ganesh
2020-09-16 17:22 ` [PATCH 3/3] selftest/powerpc: Add slb multihit selftest Ganesh Goudar
2020-09-17 12:29 ` [PATCH 0/3] powerpc/mce: Fix mce handler and add selftest Michal Suchánek
2020-09-18 11:49 ` Ganesh
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=37edc6de-d55a-ec9e-a6f1-ae4535a3bfd9@linux.ibm.com \
--to=ganeshgr@linux.ibm.com \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=mahesh@linux.vnet.ibm.com \
--cc=msuchanek@suse.de \
--cc=npiggin@gmail.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;
as well as URLs for NNTP newsgroup(s).