Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp867427pxp; Wed, 9 Mar 2022 14:35:09 -0800 (PST) X-Google-Smtp-Source: ABdhPJy/PpHPvcsXlo0DudowuXb6OVpIuoAmkJThlFzhAVa2xyVH0JIFslO6oCkzCisZgdGtruoi X-Received: by 2002:a17:906:40da:b0:6ce:51b:a593 with SMTP id a26-20020a17090640da00b006ce051ba593mr1795475ejk.604.1646865309459; Wed, 09 Mar 2022 14:35:09 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1646865309; cv=none; d=google.com; s=arc-20160816; b=btgldc4cf5zxfwlW+nCSH8zH/AlWgC9hyCf7u5x83ACyv2cIKS9buW1uS15dTQJBiX JJZzFOy1/0zAVFw26648AStj+45D85XJeBv/R0HToZSdt1qmhyRQ3OsTE392cjklwRvv 6snKrPO4myg2mhnIXJ9fR5wFTLwnJ4fFEO01tNa8CBC/miHgKUUsP+32d5HkWr5WI8uY DZD1eoDy5jRRb6/cw/bCopawSEdHyeh70/vSn9reReYWcWSlNOz1/a4W+Hz5F5W4t0P7 n3fevUIqpsXSU6CP2yZ8yEG5O8bVzxCtxAtYZeohpnrZyzmjfSz7zDMREG8ckKNiTfGP KkRQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=Y61mRCKE3zM9b3wOa8ze9bCmXMfmsVduldNuViZnA4k=; b=V4BbA1wcNbSXYgoHEqoeYFfR216gZTCRsILJ/SRrJIqN1j1chP/WxUviAPD966dL5N lTKZcY1Ogsu+9ALQYWcGgrFDlnM3+zrgCDxe1DzAmvaYi70hEsTuavI0i/rk2rCJ1oBi XDz0Px/AGI8PpZVteRTAWYJX8nhrJGsJbMwJZjnBfLSgfW2D0ZfBwkkhPboc0WBuh5sT 9OrxdqP5VUBKgY67+N2ueRNaSXMnNC/NBdxsF0kuRyg+/88Hl/PpaIsnMEPqZzsdTPt4 sZljPydsBE8XrZcRTDSXLouV8iAqNGiN9+oTo2VJ2xYgKQ2vYuSMlvkdBRDSTHQbVZ8o HG9Q== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id v9-20020a056402348900b004169073c606si2096604edc.545.2022.03.09.14.34.47; Wed, 09 Mar 2022 14:35:09 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236697AbiCISnk (ORCPT + 99 others); Wed, 9 Mar 2022 13:43:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:59634 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231269AbiCISni (ORCPT ); Wed, 9 Mar 2022 13:43:38 -0500 Received: from mail-yw1-f171.google.com (mail-yw1-f171.google.com [209.85.128.171]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id AF7EB1403D; Wed, 9 Mar 2022 10:42:37 -0800 (PST) Received: by mail-yw1-f171.google.com with SMTP id 00721157ae682-2dbd97f9bfcso33212037b3.9; Wed, 09 Mar 2022 10:42:37 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=Y61mRCKE3zM9b3wOa8ze9bCmXMfmsVduldNuViZnA4k=; b=GE95ESInc2IO8KVquGpLPySZ/+w308ZgkRCbYhr/mdez6s10atGaEEOcXQNqF3yOzs 7or9LjOeJNNZhBLWPPqqHkRY96Siescs1oPn5ngD0J51AS0agRTYkTYwPapikrj3jumj QAw/GTvMHddtmjsXUPcL3Zw1EKf/3ZSv5Zgbyw4wsoaDs/PiJe/ewE30VZl+iyXwImhw Lf3ZzrJIpEVszDT8UAzgX28bYH5lgyZygdgfnwUfaEXisJYYHq4+ItkgxDeCs0iamHGn EuAHLMWkwiFLka24HjPmofayoBwRbYTgWn6XtkCmgAacUOHy0ymn/zKKoxoIQMda3YQZ hrpA== X-Gm-Message-State: AOAM532aKd7EdlPF04nB4xyuJKmDe5EnFI5tkuJmiXJpZ0QzZaHHSRRV ljRivgTtoSkwmCpjnUIGuOikuMdw0K96HUDL090= X-Received: by 2002:a81:1b97:0:b0:2db:640f:49d8 with SMTP id b145-20020a811b97000000b002db640f49d8mr971245ywb.326.1646851356977; Wed, 09 Mar 2022 10:42:36 -0800 (PST) MIME-Version: 1.0 References: <43dfaba0646d498fe94c1a8479b812346133f438.1646765290.git.darren@os.amperecomputing.com> In-Reply-To: <43dfaba0646d498fe94c1a8479b812346133f438.1646765290.git.darren@os.amperecomputing.com> From: "Rafael J. Wysocki" Date: Wed, 9 Mar 2022 19:42:26 +0100 Message-ID: Subject: Re: [PATCH] ACPI/APEI: Limit printable size of BERT table data To: Darren Hart Cc: LKML , Linux ACPI , "Rafael J. Wysocki" , Len Brown , James Morse , Tony Luck , Borislav Petkov , Doug Rady Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.4 required=5.0 tests=BAYES_00, FREEMAIL_FORGED_FROMDOMAIN,FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS, 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 8, 2022 at 7:51 PM Darren Hart wrote: > > Platforms with large BERT table data can trigger soft lockup errors > while attempting to print the entire BERT table data to the console at > boot: > > watchdog: BUG: soft lockup - CPU#160 stuck for 23s! [swapper/0:1] > > Observed on Ampere Altra systems with a single BERT record of ~250KB. > > The original bert driver appears to have assumed relatively small table > data. Since it is impractical to reassemble large table data from > interwoven console messages, and the table data is available in > > /sys/firmware/acpi/tables/data/BERT > > limit the size for tables printed to the console to 1024 (for no reason > other than it seemed like a good place to kick off the discussion, would > appreciate feedback from existing users in terms of what size would > maintain their current usage model). > > Alternatively, we could make printing a CONFIG option, use the > bert_disable boot arg (or something similar), or use a debug log level. > However, all those solutions require extra steps or change the existing > behavior for small table data. Limiting the size preserves existing > behavior on existing platforms with small table data, and eliminates the > soft lockups for platforms with large table data, while still making it > available. > > Cc: "Rafael J. Wysocki" > Cc: Len Brown > Cc: James Morse > Cc: Tony Luck > Cc: Borislav Petkov > Cc: Doug Rady > Signed-off-by: Darren Hart Not that I have a particularly strong opinion here, but this looks reasonable to me, so I've queued it up for 5.18. APEI reviewers, please chime in if you disagree with the above. > --- > drivers/acpi/apei/bert.c | 8 ++++++-- > 1 file changed, 6 insertions(+), 2 deletions(-) > > diff --git a/drivers/acpi/apei/bert.c b/drivers/acpi/apei/bert.c > index 19e50fcbf4d6..ad8ab3f12cf3 100644 > --- a/drivers/acpi/apei/bert.c > +++ b/drivers/acpi/apei/bert.c > @@ -29,6 +29,7 @@ > > #undef pr_fmt > #define pr_fmt(fmt) "BERT: " fmt > +#define ACPI_BERT_PRINT_MAX_LEN 1024 > > static int bert_disable; > > @@ -58,8 +59,11 @@ static void __init bert_print_all(struct acpi_bert_region *region, > } > > pr_info_once("Error records from previous boot:\n"); > - > - cper_estatus_print(KERN_INFO HW_ERR, estatus); > + if (region_len < ACPI_BERT_PRINT_MAX_LEN) > + cper_estatus_print(KERN_INFO HW_ERR, estatus); > + else > + pr_info_once("Max print length exceeded, table data is available at:\n" > + "/sys/firmware/acpi/tables/data/BERT"); > > /* > * Because the boot error source is "one-time polled" type, > -- > 2.31.1 >