From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.6 required=3.0 tests=BAYES_00,DKIM_INVALID, DKIM_SIGNED,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 9C856C4338F for ; Tue, 24 Aug 2021 06:40:52 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [112.213.38.117]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id B9AA061265 for ; Tue, 24 Aug 2021 06:40:51 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B9AA061265 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=ellerman.id.au Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.ozlabs.org Received: from boromir.ozlabs.org (localhost [IPv6:::1]) by lists.ozlabs.org (Postfix) with ESMTP id 4GtzyT6t5sz2yNQ for ; Tue, 24 Aug 2021 16:40:49 +1000 (AEST) Authentication-Results: lists.ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=WLu+SR/r; dkim-atps=neutral Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=ellerman.id.au (client-ip=2401:3900:2:1::2; helo=ozlabs.org; envelope-from=mpe@ellerman.id.au; receiver=) Authentication-Results: lists.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=ellerman.id.au header.i=@ellerman.id.au header.a=rsa-sha256 header.s=201909 header.b=WLu+SR/r; dkim-atps=neutral Received: from ozlabs.org (ozlabs.org [IPv6:2401:3900:2:1::2]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by lists.ozlabs.org (Postfix) with ESMTPS id 4Gtzxk05VVz2xqy for ; Tue, 24 Aug 2021 16:40:09 +1000 (AEST) Received: from authenticated.ozlabs.org (localhost [127.0.0.1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mail.ozlabs.org (Postfix) with ESMTPSA id 4Gtzxb3dWYz9sXk; Tue, 24 Aug 2021 16:40:03 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ellerman.id.au; s=201909; t=1629787203; bh=vCuiZFSJ6cWBv+pHZHkJiirLDqi57AbEb2sqYmRf84Q=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=WLu+SR/r3TeUbm9uCVDcIyHKv0SFDsyfeGVmd8TTePK1SDGcYydUIgwGoklwXPZvB 6nosheQoq+tqeHmtqAV0lBUQheIkqVv53P/6fIe0eknIZ9M+Ete1cm3bn9/bozzxhe hdcNkptQR4bWcaa5NWEJHT4XUP6tfhPZX+a8rif9wBhmaEbD8pKsyP29xZgF/jQ7kc lhl9ROtekSK6xOlhnPMVmafFm1ock4Q1vNgqccnNPi6cwfFwT+k9rYc0v1UbJxpZ/V hAp8zj3W9ODOIm804R4h63H6dCnVx3wRNX6QWdGc1FvRPy1IVzXj7cDohUFQCkmU8r PihwvB9LAx/gA== From: Michael Ellerman To: Ganesh Goudar , linuxppc-dev@lists.ozlabs.org Subject: Re: [PATCH v2 1/3] powerpc/pseries: Parse control memory access error In-Reply-To: <20210805092025.272871-1-ganeshgr@linux.ibm.com> References: <20210805092025.272871-1-ganeshgr@linux.ibm.com> Date: Tue, 24 Aug 2021 16:39:57 +1000 Message-ID: <87eeajcpmq.fsf@mpe.ellerman.id.au> MIME-Version: 1.0 Content-Type: text/plain X-BeenThere: linuxppc-dev@lists.ozlabs.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Linux on PowerPC Developers Mail List List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: mikey@neuling.org, Ganesh Goudar , mahesh@linux.ibm.com, npiggin@gmail.com Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" Hi Ganesh, Some comments below ... Ganesh Goudar writes: > Add support to parse and log control memory access > error for pseries. > > Signed-off-by: Ganesh Goudar > --- > v2: No changes in this patch. > --- > arch/powerpc/platforms/pseries/ras.c | 21 +++++++++++++++++++++ > 1 file changed, 21 insertions(+) > > diff --git a/arch/powerpc/platforms/pseries/ras.c b/arch/powerpc/platforms/pseries/ras.c > index 167f2e1b8d39..608c35cad0c3 100644 > --- a/arch/powerpc/platforms/pseries/ras.c > +++ b/arch/powerpc/platforms/pseries/ras.c > @@ -80,6 +80,7 @@ struct pseries_mc_errorlog { > #define MC_ERROR_TYPE_TLB 0x04 > #define MC_ERROR_TYPE_D_CACHE 0x05 > #define MC_ERROR_TYPE_I_CACHE 0x07 > +#define MC_ERROR_TYPE_CTRL_MEM_ACCESS 0x08 ... > > +#define MC_ERROR_CTRL_MEM_ACCESS_PTABLE_WALK 0 > +#define MC_ERROR_CTRL_MEM_ACCESS_OP_ACCESS 1 Where do the above values come from? > + > static inline u8 rtas_mc_error_sub_type(const struct pseries_mc_errorlog *mlog) > { > switch (mlog->error_type) { > @@ -112,6 +116,8 @@ static inline u8 rtas_mc_error_sub_type(const struct pseries_mc_errorlog *mlog) > case MC_ERROR_TYPE_ERAT: > case MC_ERROR_TYPE_TLB: > return (mlog->sub_err_type & 0x03); > + case MC_ERROR_TYPE_CTRL_MEM_ACCESS: > + return (mlog->sub_err_type & 0x70) >> 4; Can you add to the comment above sub_err_type explaining what these bits are. > default: > return 0; > } > @@ -699,6 +705,21 @@ static int mce_handle_err_virtmode(struct pt_regs *regs, > case MC_ERROR_TYPE_I_CACHE: > mce_err.error_type = MCE_ERROR_TYPE_ICACHE; > break; > + case MC_ERROR_TYPE_CTRL_MEM_ACCESS: > + mce_err.error_type = MCE_ERROR_TYPE_RA; > + if (mce_log->sub_err_type & 0x80) This appears many times in the file. Can we add eg. MC_EFFECTIVE_ADDR_PROVIDED? > + eaddr = be64_to_cpu(mce_log->effective_address); > + switch (err_sub_type) { > + case MC_ERROR_CTRL_MEM_ACCESS_PTABLE_WALK: > + mce_err.u.ra_error_type = > + MCE_RA_ERROR_PAGE_TABLE_WALK_LOAD_STORE_FOREIGN; That name is ridiculously long, but I guess that's not your fault :) We can fix it up in a later patch. > + break; > + case MC_ERROR_CTRL_MEM_ACCESS_OP_ACCESS: > + mce_err.u.ra_error_type = > + MCE_RA_ERROR_LOAD_STORE_FOREIGN; > + break; > + } > + break; cheers