Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp764575pxp; Fri, 11 Mar 2022 14:30:59 -0800 (PST) X-Google-Smtp-Source: ABdhPJzMdoXA2hSq7pfCoy0l2dj2hvUiowiGtVYyDraCdeGIFvu6iv6I0JvHeD9KyupRfCTK9bCF X-Received: by 2002:a17:90b:1bc5:b0:1bf:1c96:66ac with SMTP id oa5-20020a17090b1bc500b001bf1c9666acmr23682923pjb.167.1647037859127; Fri, 11 Mar 2022 14:30:59 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1647037859; cv=pass; d=google.com; s=arc-20160816; b=ofdY5wKy9uLbCwjhq7PRa1BpgzVW9rkw/FIwkkMxfe3VSmrWNiHK2BE0ISqVWlPp7h uRYPNqX1/OOWW51RgU9cTUr78bQOguQrOb4TMfZ3EYxkS9EX84em4t1++PWqDIISHNCv MBYZOuY4OJufc02qcAjvEKqRDjpCHMkAlex0RlLZwEEw4P4RP/bcpfIjNW4WfC0vM+/K vDtaly4RY7sXU2rEuFAbhmGDlDcakj1yLDOvWZQKruOqV+GmktdLKTql9c6X2xSor3td Lhl/Bbrtm2UbcnPDdRqvY7WJEPSTSxFQsQiKf3RrSncC7pO0Uyc8EW1GqypYOnUWTHop BEqQ== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:content-transfer-encoding :in-reply-to:from:references:cc:to:content-language:subject :user-agent:date:message-id:dkim-signature; bh=TJKkJ9qHZMpNx3e7wNIQRu2nWtssvgmX31byrMdYDr0=; b=gJs85lscan4Gf/rrhlgP2sNwMz9WOoVVpQjn4k9y0UOX8R2rxL0uweQuezHeqaOgZj b5MCOACmo8l0fXAmJLJOzb6hp9Ug3qrhgOiDSXxb/j4Xo8IvH9B5cxQRLEyP5wQgnd5g j+Njh9UbOEuJTrG5lu0pP68UoQKJQT07pi5uwAHkXlfsuefdbKS8UzONPBZ+gCL9b0IF Z+hsFlYkdgKz51fHFg24CNCYxP01PaWtbejMS1kwLcuYyLOfN6T4aoBd4CAX+k+cE3hb 0FiBmetaU3JbzJuFAuPwrvfhCC6l961RoheOktSvbIxFSSVq6Gj4qZvdhx+6I8+/D645 gUgQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=eXuXdC1S; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [23.128.96.19]) by mx.google.com with ESMTPS id y16-20020a634950000000b0036c3c3eeb1bsi8976650pgk.722.2022.03.11.14.30.58 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Mar 2022 14:30:59 -0800 (PST) Received-SPF: softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) client-ip=23.128.96.19; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=eXuXdC1S; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=softfail (google.com: domain of transitioning linux-kernel-owner@vger.kernel.org does not designate 23.128.96.19 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=amd.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id A7D832A2BA5; Fri, 11 Mar 2022 13:36:26 -0800 (PST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242462AbiCJSZT (ORCPT + 99 others); Thu, 10 Mar 2022 13:25:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38998 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239692AbiCJSZR (ORCPT ); Thu, 10 Mar 2022 13:25:17 -0500 Received: from NAM11-BN8-obe.outbound.protection.outlook.com (mail-bn8nam11on2052.outbound.protection.outlook.com [40.107.236.52]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 4BB8A615E; Thu, 10 Mar 2022 10:24:15 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=mRjoTbepPy7iy0eCtO9ah1iNtaMe8StedSBR5J2Xljp7Y3GYAB80Ax6h1MsLNh9cAeOVbt+Yh3lEmLavg/vuvhliwfrAa1XEPWmk6jY8FUR8CEgjYBMQzJIIucPAc0jWa5BmjwcgETT1Jzp4+UEXTM6mdJSL77Wg0fPtsrc4al7jiLMmIDohCQlW2+0lepNNhcDWcFJ7BmOTWYTwGRa1xCGzTCLkJT+Pz04JJsqpLlsry945LQ1xhVsaXGGCMwV8k0CH4P5WO3VwMiEjozYi65xpY+V6OP3vBbfa/NBCFWDY2Bywcx5Ps2gW57xtb63ctv7EqmaDe3//xTKV6FHgig== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=TJKkJ9qHZMpNx3e7wNIQRu2nWtssvgmX31byrMdYDr0=; b=Pda1s0DB//p4xulpWk/P2RY69KiQgqv8pC+w3A1EhxDO/A8LklNkEt2sKejBx98ENdeaQUTjTF1mJsT2f4RSOGVYj4t1Bjc3dyehKYZnxFW6DNtimMHnqUmMXcrE7T3HKj09h+rqOow1wWMAlSF0vXHNv4OOiR5/D3cKHUU9HiM6dL+qKUEsoVu34vDAtsf+9YB+tyb2gzzsOxGMM1hIXfJcBog3pK0EXvUMCeRgKLfF/ZidSNbLfiCGREm4hTWyDvxO/6DHzVo74W9FO88JbZxxXAL/twvznd93cPD7CZNAPITL7ii6O8aDwkl2r7imXI0iRE46SRn4jP7AnoLDcg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass smtp.mailfrom=amd.com; dmarc=pass action=none header.from=amd.com; dkim=pass header.d=amd.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=amd.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=TJKkJ9qHZMpNx3e7wNIQRu2nWtssvgmX31byrMdYDr0=; b=eXuXdC1SFjXZtL8OOLYqnMJYgHpxhWi3cJXAopt7pMFoS5OGUCut68kKRt0q/OPDUrIeZ0ESU5HT1qPHfKCHO+cXzz0uUaMY6fEaju3YTgh4ZeI13Rxm5GKxM7Us2mF+5DaWMzwpbJH6MwSDNV1hNAExfqitY8aj3Ad4w3j/xQI= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from BL1PR12MB5874.namprd12.prod.outlook.com (2603:10b6:208:396::17) by BN8PR12MB3169.namprd12.prod.outlook.com (2603:10b6:408:69::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.5038.19; Thu, 10 Mar 2022 18:24:13 +0000 Received: from BL1PR12MB5874.namprd12.prod.outlook.com ([fe80::8940:cfde:90ac:b008]) by BL1PR12MB5874.namprd12.prod.outlook.com ([fe80::8940:cfde:90ac:b008%6]) with mapi id 15.20.5061.022; Thu, 10 Mar 2022 18:24:11 +0000 Message-ID: <4a345de2-6a2c-fe26-c55c-34ce6ea431d4@amd.com> Date: Thu, 10 Mar 2022 12:24:08 -0600 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:91.0) Gecko/20100101 Thunderbird/91.6.2 Subject: Re: [PATCH] x86/mce: Cover grading of AMD machine error checks Content-Language: en-US To: Borislav Petkov 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 References: <20220309174107.6113-1-carlos.bilbao@amd.com> From: Carlos Bilbao In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: CH2PR20CA0006.namprd20.prod.outlook.com (2603:10b6:610:58::16) To BL1PR12MB5874.namprd12.prod.outlook.com (2603:10b6:208:396::17) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: dc75723d-3117-481d-8f2b-08da02c32c3f X-MS-TrafficTypeDiagnostic: BN8PR12MB3169:EE_ X-Microsoft-Antispam-PRVS: X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: T8VV2DOEiD2X9zcNsREJBOP3Q5bN8Jsjo2mo/1e81efkWDJtYGC354THt6DUgkV0UZqBFoFaN6CU1UKeUE1uqatyYVUgZIwdiCxjIxGRhA9eMhLyJF2/2murmugOxrqxoLj+h2G98vluFCLoIACeUi9NGbRx0ZIxNlokGsah3mWwDWRs1fVJADPzt6DxWRG1Fd6LR5v4wZiWYij7ep/3vHpFUtL9FXdfmUBlUTQFRst6emOA8SR6caYV8lKp+I8mb9YzhDk0/ZFtxbYuKhtNtKjfBgM3dR5p09O7/m519LscoDglPOjLiZ6+WrcuT82qionuXFeYD0wphnGdTMVNr8z1iAlUvw/VkAIyThFYehTdGioId7mpLhcqe6dd6h65eTIGSwEmciyAB94NKtUf7A8vPgDPDTYC0NeIxhdcq8kJlF66k3ctAfRQPq8QH7S7O1CgyK3EXPuDXaP7L2Y9W9ekw9Lz/J9zPwDTw2qEij90pG/1Sni0Y8vD4feFsQWTgKOSkDGcU7RhAKPq+JwdDn02s/CWVba7cazzlavGti7tV3tB5hZSiDtYUllPIxhMX4vEnqsVk3VyHVpsG+RQ73Q8wOSeALXvuxn+rH/Tlq01AaoUZO5PjxXEaG+uLtVOShe2IH7HfOSulHJZn8dhbKmrDgdk6VyFV7VObdX4uEaz56N9yr+GB1CZMtSANw3DM3S6obAUzF39M8CjrVfzo21zsX8bnNvwcEi9YsnK1gA= X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:BL1PR12MB5874.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230001)(4636009)(366004)(86362001)(6506007)(186003)(26005)(5660300002)(53546011)(66476007)(66556008)(4326008)(8676002)(38100700002)(8936002)(31696002)(66946007)(2616005)(44832011)(31686004)(2906002)(36756003)(6916009)(508600001)(6512007)(316002)(83380400001)(6666004)(6486002)(43740500002)(45980500001);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?Y28zMFVHdE45eUc5ODQzNm02VzBVNXNlN0ljZERXeWdNNHFZZ1pxL2luMWJ4?= =?utf-8?B?OHRjTzA1YzRvNXB6UVdKRWlSUWJXQ2laVEl1T204eUV5Mi8rVHV6eVRNY2Fo?= =?utf-8?B?TkpsSXdQdTBMNUJvOW8wM3hoQ2NMVU5tS3d0dStMV1dXb2tiR3RTTzRQM2Uz?= =?utf-8?B?TkVNcy9uaXRCenVHWXBySmEycGltTFZraDJQWmY3S0x3dUd6Z1ZtV2prRDNm?= =?utf-8?B?ZGVDNzJobytpeVZoeWNBZ3hxY1pMVi9Cb0x4V2g2Y2p3d1AvbmRWdjVIeFVC?= =?utf-8?B?cE1jUVdCTzRnelVNMHdzSDBtbEJXditrL2NBY1lmcVlnWk4vc1ZnRysycGxC?= =?utf-8?B?bGtiZGt3K2hVdlFzRTV5emgwaFV0b2Zic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Q?jgm6ibj7eggRCOx03JxCZ84=3D?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: dc75723d-3117-481d-8f2b-08da02c32c3f X-MS-Exchange-CrossTenant-AuthSource: BL1PR12MB5874.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 10 Mar 2022 18:24:11.1849 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-CrossTenant-Id: 3dd8961f-e488-4e60-8e11-a82d994e183d X-MS-Exchange-CrossTenant-MailboxType: HOSTED X-MS-Exchange-CrossTenant-UserPrincipalName: Y3OILAjF4LVUoSf33Rh2zZJwbzrbjRSEmK627H8bAM7UgFfLUNivDx9jnSRYV7JE5x9cXkp8ayPYH28m7jYuOg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN8PR12MB3169 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,NICE_REPLY_A,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 3/9/2022 12:37 PM, Borislav Petkov wrote: > Definitely a step in the right direction. > > Now... > > On Wed, Mar 09, 2022 at 11:41:07AM -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. > > That's too generic. What is the actual use case here you're spending all > this time for? > We will cover grading of MCEs like deferred memory scrub errors, attempts to access poisonous data, etc. I could list all new covered cases in the commit message if you think that'd be positive. >> Fix the above issues extending the current grading logic for AMD with cases >> not previously considered and their corresponding messages. >> >> Signed-off-by: Carlos Bilbao >> --- >> arch/x86/include/asm/mce.h | 6 + >> arch/x86/kernel/cpu/mce/severity.c | 232 +++++++++++++++++++++++++---- >> 2 files changed, 205 insertions(+), 33 deletions(-) > > Now, looking at the whole thing, AFAICT all you're interested in is > getting some strings out from those error types. But but, we already > have something like that. That's even mentioned in the patch: > >> + * Default return values. The poll handler catches these and passes >> + * responsibility of decoding them to EDAC > > So there's a big fat module mce_amd.c which does convert MCEs to > strings. So why can't that be used and extended instead of adding more > strings to more places in the kernel? > > Thx. > The severity grading logic has a double functionality: (1) Grade the machine errors and (2) Assign them a severity message. The first task is arguably more important because depending on the severity we assign, the MCE handler do_machine_check() will do things differently. The part of this patch that grades new errors is needed for (1). But -as you mention- why do we need these new strings if we have the EDAC driver? If we grade the error as a PANIC, the handler will not notify EDAC, and the kernel will use our new severity messages when displaying the error with mce_panic(). If the machine error is not graded as PANIC, the notification chain will come into play, and EDAC will eventually decode the machine errors without using the severity message. Hence, you have a good point, these new strings will be unnecessary -We should send a new version of the patch that only includes msgs for PANIC cases. We probably won't need helper functions by then. I'll also take some time to think of any other error cases we might not be covering yet. Hope that helps clarify, Carlos