lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Wed, 12 Aug 2020 19:09:18 +0800
From:   Liguang Zhang <zhangliguang@...ux.alibaba.com>
To:     Catalin Marinas <catalin.marinas@....com>,
        Will Deacon <will@...nel.org>
Cc:     linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: [PATCH] arm64: traps: clean up arm64_ras_serror_get_severity()

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 <zhangliguang@...ux.alibaba.com>
---
 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

Powered by blists - more mailing lists