Received: by 10.223.185.116 with SMTP id b49csp1723934wrg; Thu, 22 Feb 2018 01:58:18 -0800 (PST) X-Google-Smtp-Source: AH8x225oZJ2FEmHul4yOZDx/k5slMSByVvhysIRiNLxm+8TloC11dabcw8MmYF55JwiXaJ01W80e X-Received: by 2002:a17:902:28c3:: with SMTP id f61-v6mr6142529plb.264.1519293498710; Thu, 22 Feb 2018 01:58:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519293498; cv=none; d=google.com; s=arc-20160816; b=bm543bck/TT+cOjEgD4WRM7f7hJpuM/ocUs0YCF3gYUfPJRqIGIlv6ifCUqM7xKJvf nDr4byc8HvWnX4T5slc+02TG9gP4J4zd4PLDejeqbRiTfYIBxIDvTrTSR7YfI+xJw4zl aMFOJZWTXxZnIwGNK5AfzM9zaezUcbDxe3AwNwDyqZssLC57KTdkOfvEQI+83d0+o3J3 Dnsn/CAfR0OmYnO+Ycp8PQmGa+sFcaDKmA8dGRZiXTLKj2jw9Jx827CY9h290wwAb5To ZzbC8gtdcHJ137RPqkGyX1TXBB3ybmK2pl8hFAZ/aFZGvW2HlA05lzThHKiSVoKDfauw npRA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from:arc-authentication-results; bh=1w9RfInwAswr4ju36SRSyMRDb+lqiwo0xKxKd/Bytq4=; b=HhfpaEzxW4hlaE2+fakKRv+2817efS2PR9C8IxwIW60DRUj9fpwYWfjP3ysgpoWS+1 p5pK2RcWkACUusVFjAOA2WMgwnqaZKN1+grFzbG2mfU1pj6zW6tHqaaj63bBRE1ORozc m+Hot21c39rCzhlh2H89V9ywY6ehlFduQTp7r7bVonV9OPBoZ+V143Hnxutr4afXTjaW 96/q22B0fFami+Mph0xhMtbQywb26kXuicYIwXE+q3e/xBY/CB5vmME1przeXlx/4bJZ Urr8iUiHUk2KGXzAIZ9C7f0X2pF5RWrW6l03ihms2O96UElRXw/QpKLkyIlww7QOJWyG ootw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l18si3054457pfi.300.2018.02.22.01.58.04; Thu, 22 Feb 2018 01:58:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753225AbeBVJ4o (ORCPT + 99 others); Thu, 22 Feb 2018 04:56:44 -0500 Received: from szxga04-in.huawei.com ([45.249.212.190]:5659 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753076AbeBVJ4n (ORCPT ); Thu, 22 Feb 2018 04:56:43 -0500 Received: from DGGEMS411-HUB.china.huawei.com (unknown [172.30.72.59]) by Forcepoint Email with ESMTP id 5E8F461AD3B4; Thu, 22 Feb 2018 17:56:28 +0800 (CST) Received: from localhost.localdomain (10.143.28.90) by DGGEMS411-HUB.china.huawei.com (10.3.19.211) with Microsoft SMTP Server id 14.3.361.1; Thu, 22 Feb 2018 17:56:21 +0800 From: Dongjiu Geng To: , , , , , , , CC: , Subject: [PATCH] arm64: rename the function arm64_is_ras_serror() to avoid confusion Date: Fri, 23 Feb 2018 02:02:32 +0800 Message-ID: <1519322552-7374-1-git-send-email-gengdongjiu@huawei.com> X-Mailer: git-send-email 1.9.1 MIME-Version: 1.0 Content-Type: text/plain X-Originating-IP: [10.143.28.90] X-CFilter-Loop: Reflected Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The RAS SError Syndrome can be Implementation-Defined, arm64_is_ras_serror() is used to judge whether it is RAS SError, but arm64_is_ras_serror() does not include this judgement. In order to avoid function name confusion, we rename the arm64_is_ras_serror() to arm64_is_categorized_ras_serror(), this function is used to judge whether it is categorized RAS Serror. Change some code notes, unrecoverable RAS errors is imprecise, but Recoverable RAS errors is precise. Signed-off-by: Dongjiu Geng --- arch/arm64/include/asm/traps.h | 20 ++++++++------------ arch/arm64/kernel/traps.c | 9 +++++---- arch/arm64/kvm/handle_exit.c | 3 ++- 3 files changed, 15 insertions(+), 17 deletions(-) diff --git a/arch/arm64/include/asm/traps.h b/arch/arm64/include/asm/traps.h index 178e338..2a02b64 100644 --- a/arch/arm64/include/asm/traps.h +++ b/arch/arm64/include/asm/traps.h @@ -72,18 +72,23 @@ static inline int in_entry_text(unsigned long ptr) * CPUs with the RAS extensions have an Implementation-Defined-Syndrome bit * to indicate whether this ESR has a RAS encoding. CPUs without this feature * have a ISS-Valid bit in the same position. - * If this bit is set, we know its not a RAS SError. + * If this bit is set, we know it is not a categorized RAS SError. * If its clear, we need to know if the CPU supports RAS. Uncategorized RAS * errors share the same encoding as an all-zeros encoding from a CPU that * doesn't support RAS. */ -static inline bool arm64_is_ras_serror(u32 esr) +static inline bool arm64_is_categorized_ras_serror(u32 esr) { WARN_ON(preemptible()); + /* This is Implementation-Defined Syndrome */ if (esr & ESR_ELx_IDS) return false; + if ((esr & ESR_ELx_FSC) != ESR_ELx_FSC_SERROR) + /* No severity information : Uncategorized */ + return false; + if (this_cpu_has_cap(ARM64_HAS_RAS_EXTN)) return true; else @@ -101,20 +106,11 @@ static inline u32 arm64_ras_serror_get_severity(u32 esr) { u32 aet = esr & ESR_ELx_AET; - if (!arm64_is_ras_serror(esr)) { + if (!arm64_is_categorized_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]' - */ - if ((esr & ESR_ELx_FSC) != ESR_ELx_FSC_SERROR) { - /* No severity information : Uncategorized */ - return ESR_ELx_AET_UC; - } - return aet; } diff --git a/arch/arm64/kernel/traps.c b/arch/arm64/kernel/traps.c index bbb0fde..e88096a 100644 --- a/arch/arm64/kernel/traps.c +++ b/arch/arm64/kernel/traps.c @@ -689,12 +689,12 @@ bool arm64_is_fatal_ras_serror(struct pt_regs *regs, unsigned int esr) * a more severe error. */ return false; - + /* The exception has been imprecise */ case ESR_ELx_AET_UEU: /* Uncorrected Unrecoverable */ + /* The exception is precise */ case ESR_ELx_AET_UER: /* Uncorrected Recoverable */ /* - * The CPU can't make progress. The exception may have - * been imprecise. + * The CPU can't make progress. */ return true; @@ -710,7 +710,8 @@ asmlinkage void do_serror(struct pt_regs *regs, unsigned int esr) nmi_enter(); /* non-RAS errors are not containable */ - if (!arm64_is_ras_serror(esr) || arm64_is_fatal_ras_serror(regs, esr)) + if (!arm64_is_categorized_ras_serror(esr) || + arm64_is_fatal_ras_serror(regs, esr)) arm64_serror_panic(regs, esr); nmi_exit(); diff --git a/arch/arm64/kvm/handle_exit.c b/arch/arm64/kvm/handle_exit.c index e5e741b..913c19e 100644 --- a/arch/arm64/kvm/handle_exit.c +++ b/arch/arm64/kvm/handle_exit.c @@ -40,7 +40,8 @@ static void kvm_handle_guest_serror(struct kvm_vcpu *vcpu, u32 esr) { - if (!arm64_is_ras_serror(esr) || arm64_is_fatal_ras_serror(NULL, esr)) + if (!arm64_is_categorized_ras_serror(esr) || + arm64_is_fatal_ras_serror(NULL, esr)) kvm_inject_vabt(vcpu); } -- 1.9.1