Received: by 2002:a05:7412:419a:b0:f3:1519:9f41 with SMTP id i26csp4784250rdh; Wed, 29 Nov 2023 10:29:44 -0800 (PST) X-Google-Smtp-Source: AGHT+IFjUTLSdVAIfNIXDLW9EFa3QDhcge9xcF00ZTvE8nAPsbukjI0Q5/1oUcALVUsfw3MuaWTb X-Received: by 2002:a17:902:f68d:b0:1cf:fc5c:75c4 with SMTP id l13-20020a170902f68d00b001cffc5c75c4mr7270057plg.55.1701282583884; Wed, 29 Nov 2023 10:29:43 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1701282583; cv=pass; d=google.com; s=arc-20160816; b=Bd6UR/CSr9+qLAZPOUF87GaalUBsBYXgAkMnQIiEc+AkvqY4aU/cOTDhT3VxB2lKa4 pnxl/AKsBZvxiqgtPdcyL3LKKQs0A3MHBQZWzH8Ct5wKZ75Eg5A0Xcd6JIxCjIVa5MV0 VoR7L2ecMH4RRGNfxhdevgTrMtYb69OGqCX1dEMTlTCLuTDRfBRgXwlo6nYCaDsPPgTW hw65j+VSKkUaDvys/CEzYeQSenH6fX12KtE4KzNGyBkIgLdebuUUOph1m95pL3uQu2xD N/t3VHCYf9DTT5B27I8XwdNmSPP9O13GtIIMmTVeUKaBs6sI5npoNbXzQqwWoXgAh6g5 QpLw== 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=OAj9A0pS/RN3NxF/wWzy6OWBsZQlJ6qt/eNQBJIg5go=; fh=U39n5h8MosaXw7x+l5WIBnCtbH4xODXqF4gL8XYpnxw=; b=NJNVteBtqZRoLSAcFZgtimUKIvxUfTaU3LWzrS82ifl+J23Mp7whdWokVdiV+MAkad fjmek3xaVaO0wu7dWof3x/bzXq3ra98qkZ/YMyIsrIkoDK3M6SX7pIJqUzWaw9m+UL0+ YGuhMnhgvZcmzo3n+Pfi/N5/0idPYRXX+fGZL4Nz7Y0PwVQpMkbjI6+TJL+pNpitgIkU Ci4GhBEdx+WrEYeWRxVtmXGu7Y0z+wEt7ysdqGMQmgF+Ou07hr8Qh+T6H14iopNNxZC1 exUCv5RLH1djIuyRBHyAxdEXydb6ytQJs23CCIoIdfkKITrC9iygnAjw33DwhY4TW9fM CIpQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=qEQRHdvt; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 lipwig.vger.email (lipwig.vger.email. [23.128.96.33]) by mx.google.com with ESMTPS id n18-20020a170902f61200b001bbf293f45esi15558993plg.625.2023.11.29.10.29.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 29 Nov 2023 10:29:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 as permitted sender) client-ip=23.128.96.33; Authentication-Results: mx.google.com; dkim=pass header.i=@amd.com header.s=selector1 header.b=qEQRHdvt; arc=pass (i=1 spf=pass spfdomain=amd.com dkim=pass dkdomain=amd.com dmarc=pass fromdomain=amd.com); spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.33 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 out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by lipwig.vger.email (Postfix) with ESMTP id 19EDA8088A60; Wed, 29 Nov 2023 10:29:41 -0800 (PST) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.11 at lipwig.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229741AbjK2S3T (ORCPT + 99 others); Wed, 29 Nov 2023 13:29:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49134 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229509AbjK2S3S (ORCPT ); Wed, 29 Nov 2023 13:29:18 -0500 Received: from NAM12-BN8-obe.outbound.protection.outlook.com (mail-bn8nam12on2048.outbound.protection.outlook.com [40.107.237.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF6A3111; Wed, 29 Nov 2023 10:29:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=kmy6V29JecQjH9DUbBWLFUwI3+XBmYzjrGy3y1Ky0E9q0h6k5QXPDqW4jfiUxsGpXnDTybllGXDXXKGjfkUsRGCOrA4tiK4AqkyoV1sC8k+acX24QtUU3cuLeYTFBnLJonK2gReadiqwfGIWkx5We//Ha9dDsUrddVSZcT2IuWOx/5iSd9RknPXjGzJ8bPQiN2oeK61CruxypRTBJedekLi9jZ7dyw8FguYlaWRysLMgC1Ou0/skz7E9F3s+BjTlxw18vBgIQU8NWWuKzAVfxGUtL23PjefMhsutO5vB6k4L8nygq+eYuYGkWqUKcZj0Maij7GPN/pPAQC/r6xuILw== 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=OAj9A0pS/RN3NxF/wWzy6OWBsZQlJ6qt/eNQBJIg5go=; b=GV8QzsJZkj+9yjPtq22V1yM8B50SrMQMBJp4OTjexP8NlHG2mXeDsA0gDCmN51UI07HyBurtsucneNnrRs05NJ1nf9eDJuQD0gB9NiPr4NczdFemHHTlsFAldt+a+IuvCQI7hqPS4FoqhGEcpYTfFQ8llxeWzy/oau1D0HTlyF7ANxgSC0tQbeCeBTJAoscg2ee6yRj67ZqSZpomAYRoaDmwbAQyYkSVlRT8CP5zM47AcKox/61Mopt/JpWXeSXMNpJ+nJxbvC2fiV4UrBZ4DGqci6ztdPXFo1MHz9zA/nCUd18FF4SQD3BS36Oib54+IcCRco7OJNTlHrpHXNxFTA== 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=OAj9A0pS/RN3NxF/wWzy6OWBsZQlJ6qt/eNQBJIg5go=; b=qEQRHdvtGQzVBIpT0zDdsx5wHi9QpjH3a1KYz0VLT1rNneRhyJplrrum9LiSK9ShCBpZdrGm5BACOTrGpoKHavaKbSRyzvLb3paE2476J49g8TMIzU0bqYtqbTxfpEOTtV1b+s2bBoYS2xuBDPrSnB5VHHxeDVxQyHdXg3J8QpY= Authentication-Results: dkim=none (message not signed) header.d=none;dmarc=none action=none header.from=amd.com; Received: from CH3PR12MB8403.namprd12.prod.outlook.com (2603:10b6:610:133::14) by SA1PR12MB7295.namprd12.prod.outlook.com (2603:10b6:806:2b6::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7025.29; Wed, 29 Nov 2023 18:29:18 +0000 Received: from CH3PR12MB8403.namprd12.prod.outlook.com ([fe80::e2:9f06:b82e:9a0f]) by CH3PR12MB8403.namprd12.prod.outlook.com ([fe80::e2:9f06:b82e:9a0f%3]) with mapi id 15.20.7025.022; Wed, 29 Nov 2023 18:29:18 +0000 Message-ID: Date: Wed, 29 Nov 2023 12:29:16 -0600 User-Agent: Mozilla Thunderbird Subject: [RESEND v2] ACPI: APEI: Skip initialization of GHES_ASSIST structures for Machine Check Architecture Content-Language: en-US To: linux-acpi@vger.kernel.org Cc: rafael@kernel.org, lenb@kernel.org, james.morse@arm.com, tony.luck@intel.com, bp@alien8.de, linux-kernel@vger.kernel.org, yazen.ghannam@amd.com, Avadhut Naik References: <20231106201340.434878-1-avadhut.naik@amd.com> From: Avadhut Naik In-Reply-To: <20231106201340.434878-1-avadhut.naik@amd.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-ClientProxiedBy: DM5PR08CA0041.namprd08.prod.outlook.com (2603:10b6:4:60::30) To CH3PR12MB8403.namprd12.prod.outlook.com (2603:10b6:610:133::14) MIME-Version: 1.0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: CH3PR12MB8403:EE_|SA1PR12MB7295:EE_ X-MS-Office365-Filtering-Correlation-Id: 44b90468-465e-4fad-b8a8-08dbf10918ea X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0; X-Microsoft-Antispam-Message-Info: pX5a8qrz9Twf0A3Ea6zhYuS9LCnLUtKhz0kuM66sCjNdCC2V/bEpsIB9Htq9fkehWEi125PVbQ4LKW/xppaAzrp69qWsUiasQFYYPPFnSQVnqDHHX7fFZmLWpvw9xjd9JF5EfsmRg/87krvqPRFeBTy8OHL8XCf+r6r3ahMTRXWiirroDqkF5ZbM9nx0q5UmN0Ob8OzG6ST50IhwAJBsPMuHCTTP6Sf8gR4oTE+FHTLmuyY7bHLsKt9mUmnHOUdEGQfP8lBw2XTtDGet6LYcM9KKmKXg8c4jeFiZmdmr7WwOB2ei02HMJ8pCC9eRPL/HNK3tomIey82Pk4gZFOPI+6fR8grsjdVs9kQCwC7BMIssjbDEvOUdcb3/8yI+T+DCra5lX9/cOZ5nwepJvMwoERxz4VhMWRNk+MJzW3iOlWMX0ehbPNI0V2oBtgtg55WtvygOwNxJXypOFJmuxOxzluRXDLN2EOdAXfmKdZKyPP4PfCAKegZRggTwjQMPd7ZHI9HHbzNe19LXCVbiUjlUjzAo3WCa3ne+chpHPmZnucUz+UzofuDcJDV+bM08ZSSFnHfERu92TkzkhuY+recLU0p5f1S0uSCjzhMQY/6sRnhhl34Wogd5u9Q+5QEkpurY1u6usBbFcvQz1oiWNxuphBS0d0YjgmI2t/FJqre1TGdwP4oIDo8Kp6kvgXKg5K9OcAmU6pI3tVZDOpkucRf1WA== X-Forefront-Antispam-Report: CIP:255.255.255.255;CTRY:;LANG:en;SCL:1;SRV:;IPV:NLI;SFV:NSPM;H:CH3PR12MB8403.namprd12.prod.outlook.com;PTR:;CAT:NONE;SFS:(13230031)(376002)(346002)(136003)(366004)(39860400002)(396003)(230922051799003)(451199024)(64100799003)(1800799012)(186009)(31686004)(478600001)(2616005)(26005)(6512007)(38100700002)(36756003)(31696002)(83380400001)(41300700001)(2906002)(53546011)(5660300002)(6506007)(66556008)(66476007)(316002)(4326008)(6916009)(8676002)(66946007)(8936002)(6486002)(45980500001)(43740500002);DIR:OUT;SFP:1101; X-MS-Exchange-AntiSpam-MessageData-ChunkCount: 1 X-MS-Exchange-AntiSpam-MessageData-0: =?utf-8?B?ZkkrM2p4ejJXS0p5bUxLZzlEczk5QlRsT3h5U3dGOFlNWVNGWk5Gc2JHaW9r?= =?utf-8?B?Z1JVcmpCSnlOWExna3ZWVHdXU1dNUk9mNFFPMzZ2REdaa1QyL1ZFZE1oYmR5?= =?utf-8?B?NUhCSHQ4NU5RVFppYTU5VUthV2duSDN2N21Bd2hZRDVTcWYrVDZXTVozVDFj?= =?utf-8?B?ZnVSQWRjWUFwMVhlZFREOTgrcGRnOC9qUkdUZDdEb3lXdFU5MnhGMnkyUEts?= =?utf-8?B?QjY0ZHBsZDNLUGxCaGNYdVJVdysyVlFRRFZBR3k0L0Izc0NqQjdabi9oalRZ?= =?utf-8?B?ZjRnV2MzM2JiejNHSFJsOUFzZ1FhNmdTR0twbWhaMFhsOXRvcmpVSGRX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X?= X-OriginatorOrg: amd.com X-MS-Exchange-CrossTenant-Network-Message-Id: 44b90468-465e-4fad-b8a8-08dbf10918ea X-MS-Exchange-CrossTenant-AuthSource: CH3PR12MB8403.namprd12.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Internal X-MS-Exchange-CrossTenant-OriginalArrivalTime: 29 Nov 2023 18:29:17.9553 (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: vVeGyhoOKaVuMEj+aoHJ2qX5gZHC59b5lxFq9a/tM7x8cOOC3TBUjtlm8gUyem5I6ejLOHErrvgTCMVYscVKcw== X-MS-Exchange-Transport-CrossTenantHeadersStamped: SA1PR12MB7295 X-Spam-Status: No, score=-0.9 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lipwig.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (lipwig.vger.email [0.0.0.0]); Wed, 29 Nov 2023 10:29:41 -0800 (PST) Hi, Any further feedback on this patch? On 11/6/2023 14:13, Avadhut Naik wrote: > To support GHES_ASSIST on Machine Check Architecture (MCA) error sources, > a set of GHES structures is provided by the system firmware for each MCA > error source. Each of these sets consists of a GHES structure for each MCA > bank on each logical CPU, with all structures of a set sharing a common > Related Source ID, equal to the Source ID of one of the MCA error source > structures.[1] On SOCs with large core counts, this typically equates to > tens of thousands of GHES_ASSIST structures for MCA under > "/sys/bus/platform/drivers/GHES". > > Support for GHES_ASSIST however, hasn't been implemented in the kernel. As > such, the information provided through these structures is not consumed by > Linux. Moreover, these GHES_ASSIST structures for MCA, which are supposed > to provide supplemental information in context of an error reported by > hardware, are setup as independent error sources by the kernel during HEST > initialization. > > Additionally, if the Type field of the Notification structure, associated > with these GHES_ASSIST structures for MCA, is set to Polled, the kernel > sets up a timer for each individual structure. The duration of the timer > is derived from the Poll Interval field of the Notification structure. On > SOCs with high core counts, this will result in tens of thousands of > timers expiring periodically causing unnecessary preemptions and wastage > of CPU cycles. The problem will particularly intensify if Poll Interval > duration is not sufficiently high. > > Since GHES_ASSIST support is not present in kernel, skip initialization > of GHES_ASSIST structures for MCA to eliminate their performance impact. > > [1] ACPI specification 6.5, section 18.7 > > Signed-off-by: Avadhut Naik > Reviewed-by: Yazen Ghannam > --- > Changes in v2: > 1. Since is_ghes_assist_struct() returns if any of the conditions is hit > if-else-if chain is redundant. Replace it with just if statements. > 2. Fix formatting errors. > 3. Add Reviewed-by: Yazen Ghannam > --- > drivers/acpi/apei/hest.c | 51 ++++++++++++++++++++++++++++++++++++++++ > 1 file changed, 51 insertions(+) > > diff --git a/drivers/acpi/apei/hest.c b/drivers/acpi/apei/hest.c > index 6aef1ee5e1bd..99db7621adb7 100644 > --- a/drivers/acpi/apei/hest.c > +++ b/drivers/acpi/apei/hest.c > @@ -37,6 +37,20 @@ EXPORT_SYMBOL_GPL(hest_disable); > > static struct acpi_table_hest *__read_mostly hest_tab; > > +/* > + * Since GHES_ASSIST is not supported, skip initialization > + * of GHES_ASSIST structures for MCA. > + * During HEST parsing, detected MCA error sources are cached. > + * Flags and Source Id fields from these cached values are > + * then referred to determine if the encountered GHES_ASSIST > + * structure should be initialized. > + */ > +static struct { > + struct acpi_hest_ia_corrected *cmc; > + struct acpi_hest_ia_machine_check *mc; > + struct acpi_hest_ia_deferred_check *dmc; > +} mces; > + > static const int hest_esrc_len_tab[ACPI_HEST_TYPE_RESERVED] = { > [ACPI_HEST_TYPE_IA32_CHECK] = -1, /* need further calculation */ > [ACPI_HEST_TYPE_IA32_CORRECTED_CHECK] = -1, > @@ -70,22 +84,54 @@ static int hest_esrc_len(struct acpi_hest_header *hest_hdr) > cmc = (struct acpi_hest_ia_corrected *)hest_hdr; > len = sizeof(*cmc) + cmc->num_hardware_banks * > sizeof(struct acpi_hest_ia_error_bank); > + mces.cmc = cmc; > } else if (hest_type == ACPI_HEST_TYPE_IA32_CHECK) { > struct acpi_hest_ia_machine_check *mc; > mc = (struct acpi_hest_ia_machine_check *)hest_hdr; > len = sizeof(*mc) + mc->num_hardware_banks * > sizeof(struct acpi_hest_ia_error_bank); > + mces.mc = mc; > } else if (hest_type == ACPI_HEST_TYPE_IA32_DEFERRED_CHECK) { > struct acpi_hest_ia_deferred_check *mc; > mc = (struct acpi_hest_ia_deferred_check *)hest_hdr; > len = sizeof(*mc) + mc->num_hardware_banks * > sizeof(struct acpi_hest_ia_error_bank); > + mces.dmc = mc; > } > BUG_ON(len == -1); > > return len; > }; > > +/* > + * GHES and GHESv2 structures share the same format, starting from > + * Source Id and ending in Error Status Block Length (inclusive). > + */ > +static bool is_ghes_assist_struct(struct acpi_hest_header *hest_hdr) > +{ > + struct acpi_hest_generic *ghes; > + u16 related_source_id; > + > + if (hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR && > + hest_hdr->type != ACPI_HEST_TYPE_GENERIC_ERROR_V2) > + return false; > + > + ghes = (struct acpi_hest_generic *)hest_hdr; > + related_source_id = ghes->related_source_id; > + > + if (mces.cmc && mces.cmc->flags & ACPI_HEST_GHES_ASSIST && > + related_source_id == mces.cmc->header.source_id) > + return true; > + if (mces.mc && mces.mc->flags & ACPI_HEST_GHES_ASSIST && > + related_source_id == mces.mc->header.source_id) > + return true; > + if (mces.dmc && mces.dmc->flags & ACPI_HEST_GHES_ASSIST && > + related_source_id == mces.dmc->header.source_id) > + return true; > + > + return false; > +} > + > typedef int (*apei_hest_func_t)(struct acpi_hest_header *hest_hdr, void *data); > > static int apei_hest_parse(apei_hest_func_t func, void *data) > @@ -114,6 +160,11 @@ static int apei_hest_parse(apei_hest_func_t func, void *data) > return -EINVAL; > } > > + if (is_ghes_assist_struct(hest_hdr)) { > + hest_hdr = (void *)hest_hdr + len; > + continue; > + } > + > rc = func(hest_hdr, data); > if (rc) > return rc; -- Thanks, Avadhut Naik