Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp753225ybs; Sun, 24 May 2020 20:49:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJycsBmt3DxOBgCaNxmChGn5m4h4b/aL0g6qpAsWpBxU7l2zXF0JIbVtVokZiTXt23BH3Ico X-Received: by 2002:a17:906:b5c1:: with SMTP id ep1mr16285317ejb.528.1590378595671; Sun, 24 May 2020 20:49:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590378595; cv=none; d=google.com; s=arc-20160816; b=KWMB0MvURHoN3Pf73MINe253zLplv4JlgSsdSjptkB8TODfebrHNddTdrZ5Y9xuZ7u FKlRzrRyz5vR0lk+7IeEWY30Uk3MSOJe4HZDv+vKNkOk6JDMEAL08KrOUOpMFXYQh8js u2c7aVn4L3SsMWsMCRQ2J1RILSpNjuDxd0DqpRJbV31kOy+I1GExWTBedu61RnSxItwR ck9SKe16YMUu9S+4jPh0Ka1TWDH3CfnjKMR0OWOqQ/5H9SwzqD8cCBkOz6kunXbr4h+1 Xg2IOiQWkwNDsfu8WqDixQfHhS754y3nF3uTdkpCAOPkzH/W9NBAhrDo7zTLYiMGzHce SiLg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=6IIXyf48wsHgqxd09cIS/+VIQjuoiphPvmEZfA1FK2I=; b=ub8K2ox6NNMebfeaPZvNOz6iTi4CabQWVHwqPFrDD5A0cBfiCYST/jztqO/OQC8AzA wn/k22gDJXd+0HLf8ZlbpBxR7+iyvFd7bBgKAggu/SjuKspCDy/YJyMiJo9pQ0GdEHCP 5uJY8bZnznNzAjzBn7Oa5hP47wdXbb0h1dGSLkSN71TuvJ3vFzOCs6SAX5bRo5A0qicb 74YvHZIXOuo1rSxFrxGzUBSZD00J/pUGsfLzUjUL/PvcKCSaJsaHEZBpj5mCt/nHradE GXVCie1+PYXGL4M/hq7cNfCzylysew5qLaLaE3lekco7s3MCmtX1APH00wR3lD5funsH lhhQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=VM98ejsh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z10si8838347ejw.152.2020.05.24.20.49.32; Sun, 24 May 2020 20:49:55 -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; dkim=pass header.i=@163.com header.s=s110527 header.b=VM98ejsh; 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; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=163.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728867AbgEYDrL (ORCPT + 99 others); Sun, 24 May 2020 23:47:11 -0400 Received: from mail-m973.mail.163.com ([123.126.97.3]:46642 "EHLO mail-m973.mail.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728324AbgEYDrL (ORCPT ); Sun, 24 May 2020 23:47:11 -0400 X-Greylist: delayed 911 seconds by postgrey-1.27 at vger.kernel.org; Sun, 24 May 2020 23:47:10 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:Subject:Date:Message-Id; bh=6IIXyf48wsHgqxd09c IS/+VIQjuoiphPvmEZfA1FK2I=; b=VM98ejsh2KJDz3pcVRV6fzBVHFQbSmIFiG NxRiHdZH4PeEeRGgqy9+ZXOVxTv89q5goD/dvubwCXFHPBGmLmCnPFysdYAz+Xl1 5Lr570BxzahWFxtLl7Y9sIilGAM50wJuNJIBbo6NTWkkYyJfJZsXtjHCEcd20rfY IfztGiQ4I= Received: from localhost.localdomain (unknown [124.64.17.235]) by smtp3 (Coremail) with SMTP id G9xpCgA3pKwbPMte3DLsAg--.227S4; Mon, 25 May 2020 11:31:48 +0800 (CST) From: YuanJunQing To: tsbogend@alpha.franken.de Cc: paulburton@kernel.org, chenhc@lemote.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, liulichao@loongson.cn, YuanJunQing Subject: [PATCH] MIPS: Fix IRQ tracing when call handle_fpe() Date: Mon, 25 May 2020 11:31:23 +0800 Message-Id: <20200525033123.13114-1-yuanjunqing66@163.com> X-Mailer: git-send-email 2.17.1 X-CM-TRANSID: G9xpCgA3pKwbPMte3DLsAg--.227S4 X-Coremail-Antispam: 1Uf129KBjvdXoW7XrWUurykKryUurWrCF17KFg_yoWDXwc_Kr 4Iq3yj9rn8GwsxWF1xtw4rWr92gw4SgF9akryq9w4Yyr15urn09r4kWFykX3Z3Wr4SkFWI y3s8CFn3CF1xtjkaLaAFLSUrUUUUUb8apTn2vfkv8UJUUUU8Yxn0WfASr-VFAUDa7-sFnT 9fnUUvcSsGvfC2KfnxnUUI43ZEXa7IUUHUqUUUUUU== X-Originating-IP: [124.64.17.235] X-CM-SenderInfo: h1xd0ypxqtx0rjwwqiywtou0bp/1tbiNgQvXFWBjPQihAAAsL Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 .macro __build_clear_msa_fpe - _cfcmsa a1, MSA_CSR + _cfcmsa s0, MSA_CSR CLI TRACE_IRQS_OFF + move a1,s0 .endm .macro __build_clear_ade -- 2.17.1