Received: by 10.223.185.116 with SMTP id b49csp3920380wrg; Mon, 26 Feb 2018 08:14:04 -0800 (PST) X-Google-Smtp-Source: AH8x226SC9ynl4FJCNU84HdCLnGPl+8dU4Ri8wMOVp/sc2wIKsnF1JVpTM+QQiahtNYs/zNbc3A+ X-Received: by 10.98.134.10 with SMTP id x10mr11085876pfd.78.1519661644394; Mon, 26 Feb 2018 08:14:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519661644; cv=none; d=google.com; s=arc-20160816; b=UZ2vTsFfRFMz6FexZiVbikDZbVDHmpKs1hztANFMS13D6BvAi+KU8NNZlq52r5GbBW IOZvzxrH8cByQker4KjO1UP4UiHPIX5ZWv8yiP3meZLQiJCyvGGZeEkNjOGlaXWrsqho LIf9rLD8EQMnX87WxhfZmegrj1WJqA4CzfbP105l9f6vH2eFnHN578bxVHxChqnKiUPp +GuXjpBx9jI1cx+U3+ie1XTyOzaggTNiGx4ejebimuQtWL0cdCUUq/eTpmQRiMzI1yfj R8kEBiAao4vc7R0W5RKwuLw/6uuljC+xH56YillNoQKBgie4kTYd3bTRL3tely1wxmVy VXoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :references:in-reply-to:mime-version:dkim-signature :arc-authentication-results; bh=u/QOgajatseOCYWhkteqTbKuQu8JazHY7vu1xfDDLOw=; b=gdjPBy3lFzRdzH6BWeIONSvN77CzPBGGVZMJPtlScvn5JLe38uMHJZu0Vr5Iv4CDxC BwDpG2CAX6CFWKkrNlpH0bMwGK582V9/29AUE1XpvS8T1bP6wfOC1ZtQo9kt1tbsQUdA halyry433VQVB/4mgj9UPHNYyZyoUTDb+K3/jax/8/6yq8rTBuiyWF/CM43MmqIztodF CIAIHiOJw2co/XTZW1a7zSUuiByfYTXBQvhzXCm+uoKeLFtT0AdQe1TJtQ48ComBoB26 LfB+KmV46b29JWMlLDJy7CzV0wqgDPDM9VA+ehw472beXsGL5gxbAgC6FOGQ5Ouo1Szi gtmQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rywXRgMB; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13-v6si6923033pln.750.2018.02.26.08.13.49; Mon, 26 Feb 2018 08:14:04 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=rywXRgMB; 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; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751575AbeBZQNG (ORCPT + 99 others); Mon, 26 Feb 2018 11:13:06 -0500 Received: from mail-ua0-f195.google.com ([209.85.217.195]:38299 "EHLO mail-ua0-f195.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750876AbeBZQNE (ORCPT ); Mon, 26 Feb 2018 11:13:04 -0500 Received: by mail-ua0-f195.google.com with SMTP id f5so4831300uam.5 for ; Mon, 26 Feb 2018 08:13:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=u/QOgajatseOCYWhkteqTbKuQu8JazHY7vu1xfDDLOw=; b=rywXRgMBuJxWma7HlbgMoifHV/TBvHJk90JjuadGY2w7W4hIrSmgzYppGXgdE+Fzfc waxqgDF2jULyP9zQid660ObPF0o0Vw7D3fZXWate7LvjOqoKjHpjMit8R0tJcOu2yXWl uUdpIqoMdufGTHMMvfBvFY6KQx8gwrOt45YQOtWtYGAeECXiZ1piQQsEJS+Zp0deN0Dw YMXcsYmiFpXIwYpYpHR9ZiqVdqmUyAdIyPAMEFzv/ZpBpWjWq8PNJjPSmYyFfZubyjt3 eX66znEw6AUkhqqcdPx+z7MCAeLTDRxUDpDLLDzWrvGUJb/brOvQswGKO02keHaavqbx SYgw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=u/QOgajatseOCYWhkteqTbKuQu8JazHY7vu1xfDDLOw=; b=qUt+JmB7okK8fHriVe8prum1Pk4SUyZ7t0GOOIlLVqikuyxa9aYq9kB+WwLkJI4ruJ 0IvNklJcVfo/g922j3yJhv3wRu+vatzm7aWrZYR3HeFN9S+h50zi0KMo+rl05iX+KcXq /hEHgIKtbydtDwJg9BM40A9ZcQxnEzT5BmRemHQ4KUk+9sAFovcsa8MZ69jzyor3fEc7 H2I3ERaJZCIKmUm0KWCz0aQvWTHdTMtev7C1RIiOvMzXsST145f0pbj4WBa2VVK365XR arU5CPkZ/T3PnogTOGGbea4lUZIZuJJqbshBRVtZCA5NKEyDSZyySJadpt1Tkl3X6DaA NlcA== X-Gm-Message-State: APf1xPAsW/QqnUGjdJWIPsOsH/Ug7Utfd13Mt4/LojIwuqloNhOW91id DZCISPyKp4XKo/p1KRrSknOJcrQ73hDUBdYdPIk6Aw== X-Received: by 10.176.95.81 with SMTP id z17mr8628029uah.29.1519661584018; Mon, 26 Feb 2018 08:13:04 -0800 (PST) MIME-Version: 1.0 Received: by 10.176.35.193 with HTTP; Mon, 26 Feb 2018 08:13:03 -0800 (PST) In-Reply-To: <5A90563E.4020608@arm.com> References: <1519322552-7374-1-git-send-email-gengdongjiu@huawei.com> <5A90563E.4020608@arm.com> From: gengdongjiu Date: Tue, 27 Feb 2018 00:13:03 +0800 Message-ID: Subject: Re: [PATCH] arm64: rename the function arm64_is_ras_serror() to avoid confusion To: James Morse Cc: Dongjiu Geng , Catalin Marinas , Will Deacon , Christoffer Dall , Marc Zyngier , Linux Kernel Mailing List , arm-mail-list , kvmarm@lists.cs.columbia.edu, Huangshaoyu Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi James, Thanks a lot for your review. 2018-02-24 1:58 GMT+08:00 James Morse : > Hi Dongjiu Geng, > > On 22/02/18 18:02, Dongjiu Geng wrote: >> 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. > > I don't see how 'categorized' is relevant. The most significant ISS bit is used > to determine if this is an IMP-DEF ESR, or one that uses the architected layout. From the name arm64_is_ras_serror(), it used to judge whether this is RAS Serror, but arm64_is_ras_serror() think the IMP-DEF SError is not RAS SError, as shown the code note and code in[1]. In fact the IMP-DEF SError is also RAS SError, so when I read the code, it looks like confusion, so I rename it to arm64_is_categorized_ras_serror(), then this function is only used to judge whether this is categorized RAS SError, if it is categorized, the code will continue judge its Asynchronous Error Type. if it is uncategorized, the code will panic(this is the original code logic) or not panic when we support kernel-first or can isolate the SError [1]: /* * ................................................... *CPUs with the RAS extensions have an Implementation-Defined-Syndrome bit - * If this bit is set, we know its not a RAS SError. * ............................................................................... */ static inline bool arm64_is_ras_serror(u32 esr) { WARN_ON(preemptible()); if (esr & ESR_ELx_IDS) return false; ......................... } > > DFSC of zero means uncategorised. What should we do with an uncategorised SError? yes, so it returns false because it is uncategorised. > > From 2.4.3 "ESB and other physical errors" of [0] > | It is IMPLEMENTATION DEFINED whether [..]uncategorized SError interrupts > | are containable or Uncontainable, and whether they can be synchronized by an > | Error Synchronization Barrier. > > We treat uncategorized as uncontainable as that's the worst thing it could be. in original code, system will panic if it is uncategorized, I do not change this logic. I only rename this function name to make it less confusion it no need to panic for uncontainable if we can isolate this error. > > On aarch32 uncontainable and uncategorized even share an encoding. > (AET:00 in G7.2.43 "DFSR, Data Fault Status Register", 'state of the PE after > taking the SError interrupt exception') > > >> Change some code notes, unrecoverable RAS errors is imprecise, but >> Recoverable RAS errors is precise. > > Unrecoverable and Recoverable (but we don't know where it is) are both grouped > into 'can't make progress'. The comment says: > | The exception may have been imprecise. > because one of those two is imprecise. > > If anyone cares which one is which, they can read the spec. > > I expect this code will one day be replaced with proper kernel-first support, > its only here to avoid panic()ing due to corrected errors. Ok, thanks for the explanation. > > > Thanks, > > James > > [0] > https://static.docs.arm.com/ddi0587/a/RAS%20Extension-release%20candidate_march_29.pdf