Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp894310ybs; Mon, 25 May 2020 01:46:16 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyrkIzvrdj7L0uiKfWH9q59ZpGL+P7Cun3uHM7V/3kfUYAYP5sD7Y3WhEjvcULJ6qkj45ET X-Received: by 2002:a17:906:cecb:: with SMTP id si11mr17504993ejb.122.1590396376324; Mon, 25 May 2020 01:46:16 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590396376; cv=none; d=google.com; s=arc-20160816; b=LzJWhIUu0XzJoD1YaSm2QgBaKcyYD/w6LG71RmO2krJrKPOmaf+hzGq/Zy+U/2lS8i 0sTLO6BCBfI1y9a7lizHidlJeExz9SLhQcQAy8D1jPNcJdKiWQWnj7HHgfwHKwV3PsbC ++d7I3ZCTCemYaef5B9rJql3ByGUz3LkIgS6q1/wbWl726HJucijUmghvL7wkNAdCAKa OEgoZC9nJa4VfTU1eiKNBvRcW6Mi/m0274pJ8aKT1za07iOnFhH9yxJxGVJq/psoFlQo H1WzlqrRiCEiuMGT5Y7NyDpXcTiUOm7rvx8IuKSwmiBxTFeKv9vwU0vpiYSLXGvZ6Upp SAlA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=N7xeHYXp9DmQHu8BXTZDoVAVnT/+eOjHu1xCbikRmEk=; b=CMps4ps2Ju/zrHByPkfj1zjKct5jUFn3zHFearX/4D090MEkGf23BQoKrDxJ0v4nsa t18yZFa9X3ZL+3uUXjtfeYUU4DtBIm/MF/ilt3ci5atRphnf9heSAftaAMLor/riEVNf 3r8Iv+LAF7mfagfw62Tv3atLGVe3wxJhdSQX1/14vYUrXUW7ZxNZPPKNkjNjqtH+zVTG 9BAodn897XS7MtkqU/zj9MoHGv+CLen1v5lUMTYuorLDF3sIZwYFkRu6hhJMywbX+/m0 paQIWE0shxh1h4bJaVZ9RTC6kK4rbBQO87dlJOyBfoCvCd9SPbS0zGlfmGAThi1Tjq8L XhRA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id la5si8891925ejb.229.2020.05.25.01.45.53; Mon, 25 May 2020 01:46:16 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2389165AbgEYInZ (ORCPT + 99 others); Mon, 25 May 2020 04:43:25 -0400 Received: from elvis.franken.de ([193.175.24.41]:38038 "EHLO elvis.franken.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388465AbgEYInZ (ORCPT ); Mon, 25 May 2020 04:43:25 -0400 Received: from uucp (helo=alpha) by elvis.franken.de with local-bsmtp (Exim 3.36 #1) id 1jd8hc-0005hs-00; Mon, 25 May 2020 10:43:20 +0200 Received: by alpha.franken.de (Postfix, from userid 1000) id 9337CC01DC; Mon, 25 May 2020 10:42:34 +0200 (CEST) Date: Mon, 25 May 2020 10:42:34 +0200 From: Thomas Bogendoerfer To: YuanJunQing Cc: paulburton@kernel.org, chenhc@lemote.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, liulichao@loongson.cn Subject: Re: [PATCH] MIPS: Fix IRQ tracing when call handle_fpe() Message-ID: <20200525084234.GA5057@alpha.franken.de> References: <20200525033123.13114-1-yuanjunqing66@163.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20200525033123.13114-1-yuanjunqing66@163.com> User-Agent: Mutt/1.5.23 (2014-03-12) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 25, 2020 at 11:31:23AM +0800, YuanJunQing wrote: > Register "a1" is unsaved in this function, > when CONFIG_TRACE_IRQFLAGS is enabled, > the TRACE_IRQS_OFF macro will call trace_hardirqs_off(), > and this may change register "a1". > The variment of register "a1" may send SIGFPE signal > to task when call do_fpe(),and this may kill the task. > > Signed-off-by: YuanJunQing > --- > arch/mips/kernel/genex.S | 6 ++++-- > 1 file changed, 4 insertions(+), 2 deletions(-) > > diff --git a/arch/mips/kernel/genex.S b/arch/mips/kernel/genex.S > index 8236fb291e3f..956a76429773 100644 > --- a/arch/mips/kernel/genex.S > +++ b/arch/mips/kernel/genex.S > @@ -480,16 +480,18 @@ NESTED(nmi_handler, PT_SIZE, sp) > /* gas fails to assemble cfc1 for some archs (octeon).*/ \ > .set mips1 > SET_HARDFLOAT > - cfc1 a1, fcr31 > + cfc1 s0, fcr31 > .set pop > CLI > TRACE_IRQS_OFF > + move a1,s0 > .endm do we realy need to read fcr31 that early ? Wouldn't it work to just move the cfc1 below TRACE_IRQS_OFF ? Thomas. -- Crap can work. Given enough thrust pigs will fly, but it's not necessarily a good idea. [ RFC1925, 2.3 ]