Received: by 2002:a25:2c96:0:0:0:0:0 with SMTP id s144csp1692633ybs; Tue, 26 May 2020 00:59:48 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxndYT88uiSpBfBfi2Wq6wkpShY1q+12nkUfoNTnxfpI+etldyzRMB0It88BZsdR1kq03Bx X-Received: by 2002:a17:906:5906:: with SMTP id h6mr68184ejq.262.1590479987860; Tue, 26 May 2020 00:59:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1590479987; cv=none; d=google.com; s=arc-20160816; b=JJAFn8tZPWJFTfZR+xxtt3OMrSmeDNuqDCbSJkfR+7aMICaWujNQsokw2DEKpmgTWO TZfkvQy6LOkrybqoBhbco2eekLDg40hixDiF+aVhaFUMFLN7DjKg9LkLhW1UeYasZS7b Q7vzUraTBOY1k3EZ52xK2kEJ9W8nwRl3sb0MI2nOHfObyCBiD2+l4okI0DBQOdfO72Xw 42uVBwcjtVsv5rOifiMBK3uYUfkKPpzRrjx8ojn5iAywC6RHoGEQla+EwyncKI0Ui9/l tw/oDPyl/9ijDg9Isidyc5GUAX096XWzuOL611CibIqHbmE9p0PqpCsYAXsV7oAxtAoI n93w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-language :content-transfer-encoding:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=bkSJjPRUKYUDwFkyPzThVgbKD1YuAi6I43MZcpH/s8I=; b=Ni7ZV0v2LTIrKbQYWxmcrbZ58pnh4sanAlzNFy7dyxqF9k1xRd9WrREZWYUm7RQApz xQPnQdVXegyKbuhVFRw7m6I0uoI3lYMCIDWtVYsvckfCV6hHdWWOkTMyukc3wjIh0cYV xsX6Cd+iBH9PEnMF7NyfljZeXl28a1k197U7ClZi/mfX5Ytv01GjTXfnRraPyHKpolGx NCqC43rmMLrOhO+LO6FuyyejYlmKRpJzIrSDOKiASCryC43cgKwWbkqSKCgmhIO4/mu2 VWtG0KsVD+fM7guWd3s5/MPjJOEnCXW1zcAOtGXAB7Wwh3bFeUWNBUepzWPoARfFZmoF yslA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@163.com header.s=s110527 header.b=Vqh+9szH; 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 df5si11057274edb.44.2020.05.26.00.59.24; Tue, 26 May 2020 00:59:47 -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=Vqh+9szH; 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 S1728083AbgEZHWv (ORCPT + 99 others); Tue, 26 May 2020 03:22:51 -0400 Received: from mail-m972.mail.163.com ([123.126.97.2]:33580 "EHLO mail-m972.mail.163.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726768AbgEZHWu (ORCPT ); Tue, 26 May 2020 03:22:50 -0400 X-Greylist: delayed 910 seconds by postgrey-1.27 at vger.kernel.org; Tue, 26 May 2020 03:22:50 EDT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=Subject:From:Message-ID:Date:MIME-Version; bh=bkSJj PRUKYUDwFkyPzThVgbKD1YuAi6I43MZcpH/s8I=; b=Vqh+9szHVRs6SKbD3K4o3 O11U5YVtsRU8DxAs4N+AHZvRZvG2y1XxuOnULRU5qi0Hh82c2ESl7Ke/DZHYQZfu FInuwilB9rNwQOy1wgQcSWsRei6YoZcY3V6bEcPcRqEKjUGGy3oKyWO6kapcfqT3 Rg4E0uJQYY3VZSNlFFFBoc= Received: from [172.20.10.2] (unknown [124.64.17.235]) by smtp2 (Coremail) with SMTP id GtxpCgAXauInwMxeX977Bg--.54S2; Tue, 26 May 2020 15:07:28 +0800 (CST) Subject: Re: [PATCH] MIPS: Fix IRQ tracing when call handle_fpe() To: Thomas Bogendoerfer Cc: paulburton@kernel.org, chenhc@lemote.com, linux-mips@vger.kernel.org, linux-kernel@vger.kernel.org, liulichao@loongson.cn References: <20200525033123.13114-1-yuanjunqing66@163.com> <20200525084234.GA5057@alpha.franken.de> From: yuanjunqing Message-ID: <76f2c756-0ae4-83f5-becf-6f1b3319f6fd@163.com> Date: Tue, 26 May 2020 15:07:16 +0800 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.7.0 MIME-Version: 1.0 In-Reply-To: <20200525084234.GA5057@alpha.franken.de> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Content-Language: en-US X-CM-TRANSID: GtxpCgAXauInwMxeX977Bg--.54S2 X-Coremail-Antispam: 1Uf129KBjvJXoW7KF1ruF4rtw4rJrWkXw4Utwb_yoW8Jw47p3 y8C3Z5KF4qgrWjvrW7Cwn5GrW5Kw4kArWY9Fs5tay5X3WrXF4ktF4IqwsIgryq9r1kua1f KFyqg34j9FsxA3JanT9S1TB71UUUUUUqnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x07jN739UUUUU= X-Originating-IP: [124.64.17.235] X-CM-SenderInfo: h1xd0ypxqtx0rjwwqiywtou0bp/xtbBUQowXFaD7O3HBgABsj Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 在 2020/5/25 下午4:42, Thomas Bogendoerfer 写道: > 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. yes, it can work when we just move the cfc1 below TRACE_IRQS_OFF,  and the code is written as follows. CLI TRACE_IRQS_OFF .set mips1 SET_HARDFLOAT cfc1 a1, fcr31 .set pop   .endm