From patchwork Mon Dec 11 16:05:36 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dongjiu Geng X-Patchwork-Id: 10105487 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A777660360 for ; Mon, 11 Dec 2017 16:06:34 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id A96A929783 for ; Mon, 11 Dec 2017 16:06:34 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 9E23F29792; Mon, 11 Dec 2017 16:06:34 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.2 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,RCVD_IN_DNSWL_MED autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 31D7829783 for ; Mon, 11 Dec 2017 16:06:33 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-ID:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=ShcD026iTKHclefZtWb6siHd+MJARNGHk1gybaw0Chc=; b=I2oruIYsOxoX5I UrR7zZGY1E8P1sWRzP8FXbS2HZVn1z/Lquw2PTEAls2vLQxP3I95LUXRj1FGZSK7ifIgtsirunwyw xCPpDc0yIo8DPsaKC7oK/LhSE4xWaEAStFCHip6Vy6j5/FgU6xBUayDn7FFKfiDyP2fxZQP1/d12L UG5r+DmvcHipiUk4yVcvT3oxGJIqez81wfV1RC4lwtkZJd+6EFQCri8aFRjn96NqjMAq/FxpCZMRl PSwne6sI6dBqPqXHA4wAuy7bJhUgx8ejp2kHYLy77lIuXTaZHKJ9yWi/IfEKLTNfvFSllfTPmMw3m uEuVBscuebTH4I8GuehQ==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1eOQb9-0007Ec-94; Mon, 11 Dec 2017 16:06:31 +0000 Received: from szxga05-in.huawei.com ([45.249.212.191]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1eOQb1-0007DN-VH for linux-arm-kernel@lists.infradead.org; Mon, 11 Dec 2017 16:06:29 +0000 Received: from 172.30.72.58 (EHLO DGGEMS405-HUB.china.huawei.com) ([172.30.72.58]) by dggrg05-dlp.huawei.com (MOS 4.4.6-GA FastPath queued) with ESMTP id DMB15776; Tue, 12 Dec 2017 00:05:55 +0800 (CST) Received: from SHA150392835-N.china.huawei.com (10.45.59.108) by DGGEMS405-HUB.china.huawei.com (10.3.19.205) with Microsoft SMTP Server id 14.3.361.1; Tue, 12 Dec 2017 00:05:47 +0800 From: Dongjiu Geng To: , , , , , , , , Subject: [RESEND PATCH V2] arm64: fault: avoid send SIGBUS two times Date: Tue, 12 Dec 2017 00:05:36 +0800 Message-ID: <20171211160536.11600-1-gengdongjiu@huawei.com> X-Mailer: git-send-email 2.11.0.windows.1 MIME-Version: 1.0 X-Originating-IP: [10.45.59.108] X-CFilter-Loop: Reflected X-Mirapoint-Virus-RAPID-Raw: score=unknown(0), refid=str=0001.0A020206.5A2EACE4.0005, ss=1, re=0.000, recu=0.000, reip=0.000, cl=1, cld=1, fgs=0, ip=0.0.0.0, so=2014-11-16 11:51:01, dmn=2013-03-21 17:37:32 X-Mirapoint-Loop-Id: 8ab3bffbe5abff19a076ff9fffb3b5ab X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20171211_080624_399415_C752D46C X-CRM114-Status: UNSURE ( 9.43 ) X-CRM114-Notice: Please train this message. X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP do_sea() calls arm64_notify_die() which will always signal user-space. It also returns whether APEI claimed the external abort as a RAS notification. If it returns failure do_mem_abort() will signal user-space too. do_mem_abort() wants to know if we handled the error, we always call arm64_notify_die() so can always return success. Signed-off-by: Dongjiu Geng Reviewed-by: Xie XiuQi Reviewed-by: James Morse --- 1. Address James's comments to update the commit messages 2. Address James's comments to not change the si_code for SIGBUS --- arch/arm64/mm/fault.c | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) -- 2.10.1 diff --git a/arch/arm64/mm/fault.c b/arch/arm64/mm/fault.c index b64958b..38b9f3e 100644 --- a/arch/arm64/mm/fault.c +++ b/arch/arm64/mm/fault.c @@ -610,7 +610,6 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) { struct siginfo info; const struct fault_info *inf; - int ret = 0; inf = esr_to_fault_info(esr); pr_err("Synchronous External Abort: %s (0x%08x) at 0x%016lx\n", @@ -625,7 +624,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) if (interrupts_enabled(regs)) nmi_enter(); - ret = ghes_notify_sea(); + ghes_notify_sea(); if (interrupts_enabled(regs)) nmi_exit(); @@ -640,7 +639,7 @@ static int do_sea(unsigned long addr, unsigned int esr, struct pt_regs *regs) info.si_addr = (void __user *)addr; arm64_notify_die("", regs, &info, esr); - return ret; + return 0; } static const struct fault_info fault_info[] = {