Received: by 2002:a05:7412:1492:b0:e2:908c:2ebd with SMTP id s18csp629282rdh; Tue, 22 Aug 2023 06:23:49 -0700 (PDT) X-Google-Smtp-Source: AGHT+IFexpBmmYkEmFgEYeZfLnrLQZ6X2klYiKsDkXuWb/wdzQhzqvYZmlSuloomFjqPNlqVW7uK X-Received: by 2002:aa7:d758:0:b0:522:ba6c:9b1b with SMTP id a24-20020aa7d758000000b00522ba6c9b1bmr6916834eds.26.1692710629120; Tue, 22 Aug 2023 06:23:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1692710629; cv=none; d=google.com; s=arc-20160816; b=V9UgXZ8kMqdZpLCx78f/dUj8mno2Dks0aoNZnYr01YAH4JLcnGmdWopY64Ko72QzwV Sa23fW9aCfTfIUhPZjLfVyktO7LcCorAkR+xZJh8guVUTalKLi2l47NFXAez0eQjoj7p R/z2x4jGDDf4ceDbd2+eeKcxrgsbB16nNmS769PIOMIaMdgMrvEs9Ct3aZbXGayDsrW5 kXhm3Tf7cz/xDTM3bnxjsio0vWTSJLQ+DGJ27OQVqeJRKTZQJdUiDIVIB8wEeHVEAOzB rI4Tw4AGVRWL+YDH6EPIF6mwjIBSroixQxo7O/TIdH0uwjodQdpeAgGlcDin2Q2ncwNv zGyQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version :dkim-signature; bh=CId8l++bF1WbidsZgfUdrq2sFSuYdMJqej+cLSoUVXU=; fh=VtY3kxkqe0A7AUDTolBsvgGLp2kMjmsenbiyWtQTgxY=; b=WpahcR0GmX9hDD89uinhHGhRn/8V3Hsy1iWpZUfi6qbgMN32bWKULhy+oDwhsgSZ7O s6rfa6QMXZJfJ9ga0ZjdM5ukZA2ec7QlzhlrpwVzfhhjzFzUsxELDz6WvrhRKt7q2nes 5LXE3P6kKZZdwqqj7mNC9uFioyJ9Voi89leMGM/62Mg+aYrLnnK5PTKfUwFXTJ2zdJa2 j6mjtFu+bAvSc1OoG34Mfxxuz4gpc+qgEI4bZDrx0u60qmkgsQb4PNbQPrRfR4lAyPPe WTMN4hVeN5aagYl5M3KRTBvLUglSmzAtbh+zzqYFtL7+GmKHD0AOGEyoGbXoUvDjQBff YH6Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f4Jjroqs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x19-20020aa7d6d3000000b00524035e56afsi7127400edr.105.2023.08.22.06.23.23; Tue, 22 Aug 2023 06:23:49 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=f4Jjroqs; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233490AbjHVHiv (ORCPT + 99 others); Tue, 22 Aug 2023 03:38:51 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34228 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233486AbjHVHir (ORCPT ); Tue, 22 Aug 2023 03:38:47 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 04B7F180; Tue, 22 Aug 2023 00:38:46 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 8A58464E8B; Tue, 22 Aug 2023 07:38:45 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D0F27C433C7; Tue, 22 Aug 2023 07:38:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1692689924; bh=MQApJLZQiaBacJ4HEhPwClptAaaYHhUax1QrCn1x/QU=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=f4JjroqsUXa2UiQzAA75eu6sfBbBGSnL4i407W5Wi1jaPRIWtBP/i/iovGj52Gw22 0mtjsnnut5yKEkBPhTn7HO5x90LiFtiBgfdb0HN9bJgof1VK+l4H4M+60GR4dzsdN3 78W6jMp8AjWabTPjMyG+rOPN3dcIw37AVLrQL9aikpLefGzmVei9SJHBIKnYaT2dsT WCDbUXEpkzsS8tyRPi+QahH0ZDmJveXTnk0W/0XI9aupZvHDLMMUNUYcnk4PjLffAn 06Ej3pV/XXPDrQPG6vKETeJViF44NY9llRbRn9Io0z/2r6/HjWu/0zTu9b3H7zghMZ gCodYv9hfTtSg== Received: by mail-ej1-f45.google.com with SMTP id a640c23a62f3a-99bed101b70so537887966b.3; Tue, 22 Aug 2023 00:38:44 -0700 (PDT) X-Gm-Message-State: AOJu0YzAN6gvfI1Hs5k0uu+FiTww/eTVu0fMVDdbdx/amZkInwas/8P5 idsCXAoQcOsiGSO4ofpag112fVDzJOUNx7f5FuY= X-Received: by 2002:a17:906:73dc:b0:9a1:bd82:de24 with SMTP id n28-20020a17090673dc00b009a1bd82de24mr498348ejl.12.1692689922984; Tue, 22 Aug 2023 00:38:42 -0700 (PDT) MIME-Version: 1.0 References: <1692434183-2054-1-git-send-email-yangtiezhu@loongson.cn> <1692434183-2054-4-git-send-email-yangtiezhu@loongson.cn> <467fb231-4b0a-478e-0f68-358d0651fc05@loongson.cn> In-Reply-To: <467fb231-4b0a-478e-0f68-358d0651fc05@loongson.cn> From: Huacai Chen Date: Tue, 22 Aug 2023 15:38:30 +0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v4 3/4] MIPS: Return earlier in die() if notify_die() returns NOTIFY_STOP To: Tiezhu Yang Cc: Thomas Bogendoerfer , "Maciej W. Rozycki" , linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, loongson-kernel@lists.loongnix.cn Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, Aug 21, 2023 at 10:29=E2=80=AFAM Tiezhu Yang wrote: > > > > On 08/20/2023 04:53 PM, Huacai Chen wrote: > > Hi, Tiezhu, > > > > On Sun, Aug 20, 2023 at 7:21=E2=80=AFAM Tiezhu Yang 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 > >> Signed-off-by: Tiezhu Yang > >> --- > >> 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 =3D=3D 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 !=3D 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 =3D=3D NOTIFY_STOP), so die() is a return > function now, please see objdump -d arch/mips/kernel/traps.o. Then should loongarch patches need to be updated, too? Huacai > > Thanks, > Tiezhu >