Received: by 2002:a05:6a10:a0d1:0:0:0:0 with SMTP id j17csp362596pxa; Wed, 12 Aug 2020 04:10:20 -0700 (PDT) X-Google-Smtp-Source: ABdhPJxKTCaU2pgkttVqiEgTgSPv3vW2PPheLRt6dPIySt8U9fkXC1hAAWNW3/k7kVRVOdTYHRuJ X-Received: by 2002:a17:906:36d7:: with SMTP id b23mr30340855ejc.149.1597230620444; Wed, 12 Aug 2020 04:10:20 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1597230620; cv=none; d=google.com; s=arc-20160816; b=scwIHsVTsqon8kJICz37ev+yrATcna/QtY5HIa260aSM8YRohgad8hPiT+FloHHI5p ic9I814aC0k8/5zZsU/gkJMBSN8X45vMgsY9RWMzeAtE05HnesvxhjnvLJ/91gzyCLTb 610DHb8oWNcFQT7h0Eh/FhfeHATDpjjBn6hyZEI6dyltLRabtc+IyyiikT4b554xDXwN 3UBnX8ngnwE4tzVNofP22P+4iTJKTQrCDdIccSTD0c8ufNtsncCdUsMokwVT7s3ISttZ eidRcksyeX6SHCPxjmJzN1BM9MLt0Gnem5tGgzrvL6BtdjaKXEsr0VpgDeZs9dQIg/o2 m2Mw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=QVGqcHvVYBy/LYlsOoVwOJ3S/QyB8C+fLTzB1bRZ178=; b=NibDVI0BP8VRS2LbPvKREVs/p7KEnfBT1CFH5ITWsCTvMRsZZjojEY65Ki8fuFyeLn EW+hnfzoSVDNDl33kde5XqL1Slj5GCJFm9NoVr3oyJLgNsF3VbbsNbd5Xd2Jm2bAc/vD lXlPIsF8pDMJSo23B5bKHSLgnbArl3UIzAeWocpFw+UreW7Kj12MNzvyu81HywJWOeye V+q/N0lc94PsL3Zxc8shxhKIqwydjSEK1Oye1gKWPs3whLQIvjzS8576p4GvgyR3pFyM rbulsxvoprjxLF/kTjArzPSCyngsBbmk3BehIuLB6I0ky8NFjCftgUkN2HiyJyogJayj 8nbg== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id v19si1045846edx.448.2020.08.12.04.09.56; Wed, 12 Aug 2020 04:10:20 -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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726846AbgHLLJa (ORCPT + 99 others); Wed, 12 Aug 2020 07:09:30 -0400 Received: from out30-132.freemail.mail.aliyun.com ([115.124.30.132]:41856 "EHLO out30-132.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726404AbgHLLJ3 (ORCPT ); Wed, 12 Aug 2020 07:09:29 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R301e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01419;MF=zhangliguang@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0U5YyoLJ_1597230558; Received: from localhost(mailfrom:zhangliguang@linux.alibaba.com fp:SMTPD_---0U5YyoLJ_1597230558) by smtp.aliyun-inc.com(127.0.0.1); Wed, 12 Aug 2020 19:09:25 +0800 From: Liguang Zhang To: Catalin Marinas , Will Deacon Cc: linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] arm64: traps: clean up arm64_ras_serror_get_severity() Date: Wed, 12 Aug 2020 19:09:18 +0800 Message-Id: <20200812110918.18575-1-zhangliguang@linux.alibaba.com> X-Mailer: git-send-email 2.19.1.6.gb485710b MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Function arm64_is_fatal_ras_serror() is always called after arm64_is_ras_serror(), so we should remove some needless arm64_is_ras_serror() call in function arm64_ras_serror_get_severity(). Signed-off-by: Liguang Zhang --- arch/arm64/include/asm/traps.h | 9 +-------- arch/arm64/kernel/traps.c | 2 +- 2 files changed, 2 insertions(+), 9 deletions(-) diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h index cee5928e1b7d..287b4d64dc67 100644 --- a/arch/arm64/include/asm/traps.h +++ b/arch/arm64/include/asm/traps.h @@ -79,13 +79,6 @@ static inline bool arm64_is_ras_serror(u32 esr) */ static inline u32 arm64_ras_serror_get_severity(u32 esr) { - u32 aet = esr & ESR_ELx_AET; - - if (!arm64_is_ras_serror(esr)) { - /* Not a RAS error, we can't interpret the ESR. */ - return ESR_ELx_AET_UC; - } - /* * AET is RES0 if 'the value returned in the DFSC field is not * [ESR_ELx_FSC_SERROR]' @@ -95,7 +88,7 @@ static inline u32 arm64_ras_serror_get_severity(u32 esr) return ESR_ELx_AET_UC; } - return aet; + return esr & ESR_ELx_AET; } bool arm64_is_fatal_ras_serror(struct pt_regs *regs, unsigned int esr); diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index 13ebd5ca2070..635d4cca0a4b 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -913,7 +913,7 @@ bool arm64_is_fatal_ras_serror(struct pt_regs *regs, unsigned int esr) case ESR_ELx_AET_UC: /* Uncontainable or Uncategorized error */ default: /* Error has been silently propagated */ - arm64_serror_panic(regs, esr); + return true; } } -- 2.19.1.6.gb485710b