Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp3473760pxp; Tue, 8 Mar 2022 15:22:50 -0800 (PST) X-Google-Smtp-Source: ABdhPJxPb8Hc0BDdkU3Y7VR7NuFlyx8H52Z4JYYYO1JCOBLLoVN/JMHzPzEHj5zu43n8R7+pTr3c X-Received: by 2002:a17:90a:1197:b0:1bf:65ff:f542 with SMTP id e23-20020a17090a119700b001bf65fff542mr7314314pja.5.1646781770465; Tue, 08 Mar 2022 15:22:50 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646781770; cv=none; d=google.com; s=arc-20160816; b=Ny9HVCxuqTL4Xrtu6yhBARRYV6m5V/7isYCfl104G/yCoAQUgGoVbWtwZw43VxBCbj FE8IbovtSE2abcY0X7P5EaUje8KDdbax/9Uz57lc+/wVYfg2RlWt3DM/8Ep6eLVUOg8A 43XKbPzmxMFeHGd5W5/4CIBra7s+Uz0ZpYnRN97e9e5I951iL6mILPoiQ+huiopudlGN 0CtwFbsE2cs48BFF5sl3773DoxzcfkAVJSpc0h0cZJ6VWIeoWFCV6iUXoyGeQ36SwSXJ UKHacg60YgM2zXEi8+0xDTvnI+th1OuPkUfFnrkK0yIH9Eu0sMkt0ilZT0v0cKnEFKCx 5Qaw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=OYNiKYESHbJzHK2pSiTjx95k/lbxvnxmuLbmGVL/AhY=; b=dvyyEiIhhGxWbMbohWWOcnRk77WAAz9QSR/+v0pJJH+CU+M74QyoKeQuaOwZLCM3xR NP2kzol412jknXklv+m/xO2MLmvIt69XEnYh7zmh1v7n6gDPOnFC8vb8Bf6bkbdBVQL7 NtgQzASEjWyn2FX2qdw108J7j+a8vQmynWEcvGvQEdeADFdjhkXxk98N3w3Wp12WpUJf n0Y2UYE1ycBON1yDSGr3A7VxvrytiwXISXPL2mc1T1O7H+PrSA4lAD+s7cPGhEIjE/Je V5oyYudXhe0peEkrtJz3OIKD85FIfvkwFQZhZnJAhQABehm/2gvkoAo0UzC0vSfUPuNY 1jTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=i5zRFdrp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id p34-20020a056a000a2200b004f114dbdafcsi193907pfh.132.2022.03.08.15.22.50 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 08 Mar 2022 15:22:50 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@alien8.de header.s=dkim header.b=i5zRFdrp; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=alien8.de Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id E1D0486E02; Tue, 8 Mar 2022 15:14:43 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349565AbiCHTeI (ORCPT + 99 others); Tue, 8 Mar 2022 14:34:08 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38154 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1349436AbiCHTeH (ORCPT ); Tue, 8 Mar 2022 14:34:07 -0500 Received: from mail.skyhub.de (mail.skyhub.de [5.9.137.197]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id A435553B4F; Tue, 8 Mar 2022 11:33:09 -0800 (PST) Received: from nazgul.tnic (dynamic-002-247-253-133.2.247.pool.telefonica.de [2.247.253.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.skyhub.de (SuperMail on ZX Spectrum 128k) with ESMTPSA id F22091EC064E; Tue, 8 Mar 2022 20:33:03 +0100 (CET) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=alien8.de; s=dkim; t=1646767984; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:in-reply-to:in-reply-to: references:references; bh=OYNiKYESHbJzHK2pSiTjx95k/lbxvnxmuLbmGVL/AhY=; b=i5zRFdrpK8KYCCl8uZHUc22dp9WKizOpoyWUJ4RJliF3+o+PPYjT+OBbElgNpC/jB2oEW+ cFaB+4Z4oSt5TSdxPJNUi5+Qrz+HXaBnD7qjfjYKgVcGgw5QPVMBbd0G0z6uPNBLWCx3uH /YFY29m4pUSU7HRMhFYMxje1kcbyhlA= Date: Tue, 8 Mar 2022 20:32:51 +0100 From: Borislav Petkov To: Carlos Bilbao Cc: tglx@linutronix.de, mingo@redhat.com, dave.hansen@linux.intel.com, x86@kernel.org, yazen.ghannam@amd.com, linux-kernel@vger.kernel.org, linux-edac@vger.kernel.org, bilbao@vt.edu Subject: Re: [PATCH] x86/mce: Unify vendors grading logic and provide AMD machine error checks Message-ID: References: <20220308184133.712761-1-carlos.bilbao@amd.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20220308184133.712761-1-carlos.bilbao@amd.com> X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Mar 08, 2022 at 12:41:34PM -0600, Carlos Bilbao wrote: > AMD's severity grading covers very few machine errors. In the graded cases > there are no user-readable messages, complicating debugging of critical > hardware errors. Furthermore, with the current implementation AMD MCEs have > no support for the severities-coverage file. Adding new severities for AMD > with the current logic would be too convoluted. > > Fix the above issues including AMD severities to the severity table, in > combination with Intel MCEs. Unify the severity grading logic of both > vendors. Label the vendor-specific cases (e.g. cases with different > registers) where checks cannot be implicit with the available features. > > Signed-off-by: Carlos Bilbao > --- > arch/x86/include/asm/mce.h | 7 ++ > arch/x86/kernel/cpu/mce/severity.c | 188 +++++++++++++++-------------- > 2 files changed, 103 insertions(+), 92 deletions(-) Sorry, maybe you're too new to this and you probably haven't read the old discussions we have had about the severity grading turd. In order to save you some time: adding more to that macro insanity is not going to happen. The AMD severity grading functions are *actually* readable vs this abomination which I hate with passion. If you want to add more logic, you should add to mce_severity_amd(), perhaps call other helper functions which grade based on a certain aspect of the error type, split the logic, use comments, etc, but *definitely* not this. Thx. -- Regards/Gruss, Boris. https://people.kernel.org/tglx/notes-about-netiquette