mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Tiezhu Yang <yangtiezhu@loongson.cn>
To: Huacai Chen <chenhuacai@kernel.org>
Cc: Thomas Bogendoerfer <tsbogend@alpha.franken.de>,
	"Maciej W. Rozycki" <macro@orcam.me.uk>,
	linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org,
	loongson-kernel@lists.loongnix.cn
Subject: Re: [PATCH v4 3/4] MIPS: Return earlier in die() if notify_die() returns NOTIFY_STOP
Date: Mon, 21 Aug 2023 10:28:51 +0800	[thread overview]
Message-ID: <467fb231-4b0a-478e-0f68-358d0651fc05@loongson.cn> (raw)
In-Reply-To: <CAAhV-H5_3NeAEqiBgXqxwhUbTGRhEO0fL2bY4KCOJ6J=cf9Emw@mail.gmail.com>



On 08/20/2023 04:53 PM, Huacai Chen wrote:
> Hi, Tiezhu,
>
> On Sun, Aug 20, 2023 at 7:21 AM Tiezhu Yang <yangtiezhu@loongson.cn> wrote:
>>
>> After the call to oops_exit(), it should not panic or execute
>> the crash kernel if the oops is to be suppressed.
>>
>> Suggested-by: Maciej W. Rozycki <macro@orcam.me.uk>
>> Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
>> ---
>>  arch/mips/kernel/traps.c | 6 ++++--
>>  1 file changed, 4 insertions(+), 2 deletions(-)
>>
>> diff --git a/arch/mips/kernel/traps.c b/arch/mips/kernel/traps.c
>> index 8e528a8..fd770dc 100644
>> --- a/arch/mips/kernel/traps.c
>> +++ b/arch/mips/kernel/traps.c
>> @@ -412,6 +412,9 @@ void die(const char *str, struct pt_regs *regs)
>>
>>         oops_exit();
>>
>> +       if (ret == NOTIFY_STOP)
>> +               return;
>> +
>>         if (in_interrupt())
>>                 panic("Fatal exception in interrupt");
>>
>> @@ -421,8 +424,7 @@ void die(const char *str, struct pt_regs *regs)
>>         if (regs && kexec_should_crash(current))
>>                 crash_kexec(regs);
>>
>> -       if (ret != NOTIFY_STOP)
>> -               make_task_dead(SIGSEGV);
>> +       make_task_dead(SIGSEGV);
> Then you call make_task_dead() at the end unconditionally, and die()
> becomes a noreturn function again.

No, it can return if (ret == NOTIFY_STOP), so die() is a return
function now, please see objdump -d arch/mips/kernel/traps.o.

Thanks,
Tiezhu


  reply	other threads:[~2023-08-21  2:28 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-08-19  8:36 [PATCH v4 0/4] Modify die() for MIPS Tiezhu Yang
2023-08-19  8:36 ` [PATCH v4 1/4] MIPS: Add BUG() at the end of nmi_exception_handler() Tiezhu Yang
2023-08-19  8:36 ` [PATCH v4 2/4] MIPS: Do not kill the task in die() if notify_die() returns NOTIFY_STOP Tiezhu Yang
2023-08-19  8:36 ` [PATCH v4 3/4] MIPS: Return earlier " Tiezhu Yang
2023-08-20  8:53   ` Huacai Chen
2023-08-21  2:28     ` Tiezhu Yang [this message]
2023-08-22  7:38       ` Huacai Chen
2023-08-22  8:55         ` Tiezhu Yang
2023-08-19  8:36 ` [PATCH v4 4/4] MIPS: Add identifier names to arguments of die() declaration Tiezhu Yang
2023-08-19 10:49   ` Philippe Mathieu-Daudé
2023-08-28  9:11 ` [PATCH v4 0/4] Modify die() for MIPS Thomas Bogendoerfer
2023-08-29 15:19   ` Thomas Bogendoerfer
2023-08-30  6:23     ` Huacai Chen
2023-08-30 17:01       ` Maciej W. Rozycki
2023-08-31  5:34         ` YunQiang Su
2023-08-31 10:38     ` Jiaxun Yang

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=467fb231-4b0a-478e-0f68-358d0651fc05@loongson.cn \
    --to=yangtiezhu@loongson.cn \
    --cc=chenhuacai@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-mips@vger.kernel.org \
    --cc=loongson-kernel@lists.loongnix.cn \
    --cc=macro@orcam.me.uk \
    --cc=tsbogend@alpha.franken.de \
    /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®