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=-9.9 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED, USER_AGENT_GIT 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 AD165C433E2 for ; Fri, 15 May 2020 18:44:47 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 8B3302070A for ; Fri, 15 May 2020 18:44:47 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="OF8azeut" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726723AbgEOSor (ORCPT ); Fri, 15 May 2020 14:44:47 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46660 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726797AbgEOSoo (ORCPT ); Fri, 15 May 2020 14:44:44 -0400 Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 80DE3C061A0C for ; Fri, 15 May 2020 11:44:44 -0700 (PDT) Received: by mail-pg1-x541.google.com with SMTP id f23so1395417pgj.4 for ; Fri, 15 May 2020 11:44:44 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rZrZZlEq92Pse6AsQBZ3gt5RG0ZPIDCja3ntEc/+5UQ=; b=OF8azeut5MIuxlonteG99mx9a8Av6BpOuIl5byPuyYv0PuO0UXM/SByDvX2ewPXsPg /og5vzn72KRD56TgC3VrKeifwDs395skcMWCdtpGQCKKj5PJMqovDHzFGlQ73nEVgASR oFyOSxGmQZhWbIGuJ7bgbNsyLESS4/HoKrUm4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rZrZZlEq92Pse6AsQBZ3gt5RG0ZPIDCja3ntEc/+5UQ=; b=G18JkJR/gv50bKDfPfGFU1d1r+LX0vvS08tolgRcU2lRWW/6bfirbAZ7zrq8FWdnn/ latSRS/OI07sb1zi8qFKCD8LBgsrVDS+yIEH8lzVd0IO6Fiv2XW5UoBHuWNFwA8OGYrd F9ZjoGXsFuIwIU+2Ctke1+6Zu8AH0xlq9pQH6gIotityOLnBf7/kFPzVlWES0zy/GiPd T9LNdUG/rd4EolzY4/vKGh49ZPYm1xHoTN3UhJ0jrKxNmmknC9h7CHLQSO0GFxIpullo T7pACqAxp0OT+ae2XgI5ndZ4TUeomSK1vgYq/KiX5g1n0btAq+rYgCi8i/E4Mtu5D7oC mM5g== X-Gm-Message-State: AOAM532EpkrUD7YrHQtOmEp99f16H1YV52MP0w3i7bTpsrDumiMJKVmA lRAie3lpThoWr39rcCYtMx5cyg== X-Google-Smtp-Source: ABdhPJy0Km/ifgMEiePh3m/4wFYQO+7PiRxrK/I+HUaIW+MrdLPTJ2yAIsLPOcL7MweyQmOZrjJPtQ== X-Received: by 2002:a62:2544:: with SMTP id l65mr5284782pfl.288.1589568284068; Fri, 15 May 2020 11:44:44 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a2sm2509003pfl.28.2020.05.15.11.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 11:44:43 -0700 (PDT) From: Kees Cook To: Pavel Tatashin Cc: Kees Cook , Petr Mladek , Anton Vorontsov , Colin Cross , Tony Luck , Jonathan Corbet , Benson Leung , Rob Herring , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Enric Balletbo i Serra , Sergey Senozhatsky , Steven Rostedt , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, devicetree@vger.kernel.org, linuxppc-dev@lists.ozlabs.org Subject: [PATCH v4 6/6] ramoops: Add max_reason optional field to ramoops DT node Date: Fri, 15 May 2020 11:44:34 -0700 Message-Id: <20200515184434.8470-7-keescook@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515184434.8470-1-keescook@chromium.org> References: <20200515184434.8470-1-keescook@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Pavel Tatashin Currently, it is possible to dump kmsges for panic, or oops. With max_reason it is possible to dump messages for other kmesg_dump events, for example reboot, halt, shutdown, kexec. Signed-off-by: Pavel Tatashin Link: https://lore.kernel.org/lkml/20200506211523.15077-6-keescook@chromium.org/ Signed-off-by: Kees Cook --- .../devicetree/bindings/reserved-memory/ramoops.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/reserved-memory/ramoops.txt b/Documentation/devicetree/bindings/reserved-memory/ramoops.txt index 0eba562fe5c6..b7886fea368c 100644 --- a/Documentation/devicetree/bindings/reserved-memory/ramoops.txt +++ b/Documentation/devicetree/bindings/reserved-memory/ramoops.txt @@ -30,7 +30,7 @@ Optional properties: - ecc-size: enables ECC support and specifies ECC buffer size in bytes (defaults to 0: no ECC) -- record-size: maximum size in bytes of each dump done on oops/panic +- record-size: maximum size in bytes of each kmsg dump. (defaults to 0: disabled) - console-size: size in bytes of log buffer reserved for kernel messages @@ -45,7 +45,16 @@ Optional properties: - unbuffered: if present, use unbuffered mappings to map the reserved region (defaults to buffered mappings) -- no-dump-oops: if present, only dump panics (defaults to panics and oops) +- max-reason: if present, sets maximum type of kmsg dump reasons to store + (defaults to 2: log Oopses and Panics). This can be set to INT_MAX to + store all kmsg dumps. See include/linux/kmsg_dump.h KMSG_DUMP_* for other + kmsg dump reason values. Setting this to 0 (KMSG_DUMP_UNDEF), means the + reason filtering will be controlled by the printk.always_kmsg_dump boot + param: if unset, it will be KMSG_DUMP_OOPS, otherwise KMSG_DUMP_MAX. + +- no-dump-oops: deprecated, use max_reason instead. If present, and + max_reason is not specified, it is equivalent to max_reason = 1 + (KMSG_DUMP_PANIC). - flags: if present, pass ramoops behavioral flags (defaults to 0, see include/linux/pstore_ram.h RAMOOPS_FLAG_* for flag values). -- 2.20.1 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=-9.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY, SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable 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 E3242C433DF for ; Fri, 15 May 2020 18:59:41 +0000 (UTC) Received: from lists.ozlabs.org (lists.ozlabs.org [203.11.71.2]) (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 8EF10206D8 for ; Fri, 15 May 2020 18:59:41 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (1024-bit key) header.d=chromium.org header.i=@chromium.org header.b="OF8azeut" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 8EF10206D8 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=chromium.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Received: from bilbo.ozlabs.org (lists.ozlabs.org [IPv6:2401:3900:2:1::3]) by lists.ozlabs.org (Postfix) with ESMTP id 49NyQ33XjhzDr6Y for ; Sat, 16 May 2020 04:59:39 +1000 (AEST) Authentication-Results: lists.ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=chromium.org (client-ip=2607:f8b0:4864:20::541; helo=mail-pg1-x541.google.com; envelope-from=keescook@chromium.org; receiver=) Authentication-Results: lists.ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: lists.ozlabs.org; dkim=pass (1024-bit key; unprotected) header.d=chromium.org header.i=@chromium.org header.a=rsa-sha256 header.s=google header.b=OF8azeut; dkim-atps=neutral Received: from mail-pg1-x541.google.com (mail-pg1-x541.google.com [IPv6:2607:f8b0:4864:20::541]) (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 49Ny4x0RK2zDqHW for ; Sat, 16 May 2020 04:44:45 +1000 (AEST) Received: by mail-pg1-x541.google.com with SMTP id a4so1404551pgc.0 for ; Fri, 15 May 2020 11:44:45 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding; bh=rZrZZlEq92Pse6AsQBZ3gt5RG0ZPIDCja3ntEc/+5UQ=; b=OF8azeut5MIuxlonteG99mx9a8Av6BpOuIl5byPuyYv0PuO0UXM/SByDvX2ewPXsPg /og5vzn72KRD56TgC3VrKeifwDs395skcMWCdtpGQCKKj5PJMqovDHzFGlQ73nEVgASR oFyOSxGmQZhWbIGuJ7bgbNsyLESS4/HoKrUm4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=rZrZZlEq92Pse6AsQBZ3gt5RG0ZPIDCja3ntEc/+5UQ=; b=Y7VYjn9p/19VIK4S602+VEfv2QTVCrjEgQXkmEfsoyfZrewbMdUi9tfSIyOKaB+Vsv OgYkYAcrSMcVFy2CHwheAfsft+SyZsJci1maJqi6FlBY4WxIAA3rkd05Dr1XEpSTmtXN y/Vz2TIMBhykd5t4GIKyu/VHeeiUUZfGdG9Kw84k7hS/i7GNWyGWbvOkLnJzOGrnxAGY UOBOZHGnkP7OgJNvM2XRReWIapZxjUponzu9hiK/1nh54huH+esQUkRcnbI/J9EuiOJe sLU4oJroKZUga+cFdR7p9KMYgbEAXPTGVEX7ODlg6GX1dX7tXMwFaOCy0ayWrpnYv3J7 znwg== X-Gm-Message-State: AOAM532U3qXR3h1Z2OhCpqXYFxKS0osUtPE8PY8J5K4hrW9UOeNNPyMe +DQd/9zEAqRmjHLZgq5eHjCG+A== X-Google-Smtp-Source: ABdhPJy0Km/ifgMEiePh3m/4wFYQO+7PiRxrK/I+HUaIW+MrdLPTJ2yAIsLPOcL7MweyQmOZrjJPtQ== X-Received: by 2002:a62:2544:: with SMTP id l65mr5284782pfl.288.1589568284068; Fri, 15 May 2020 11:44:44 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id a2sm2509003pfl.28.2020.05.15.11.44.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 May 2020 11:44:43 -0700 (PDT) From: Kees Cook To: Pavel Tatashin Subject: [PATCH v4 6/6] ramoops: Add max_reason optional field to ramoops DT node Date: Fri, 15 May 2020 11:44:34 -0700 Message-Id: <20200515184434.8470-7-keescook@chromium.org> X-Mailer: git-send-email 2.20.1 In-Reply-To: <20200515184434.8470-1-keescook@chromium.org> References: <20200515184434.8470-1-keescook@chromium.org> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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: Petr Mladek , Tony Luck , Kees Cook , Jonathan Corbet , Anton Vorontsov , linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, Steven Rostedt , Sergey Senozhatsky , devicetree@vger.kernel.org, Rob Herring , Paul Mackerras , Colin Cross , Enric Balletbo i Serra , linuxppc-dev@lists.ozlabs.org, Benson Leung Errors-To: linuxppc-dev-bounces+linuxppc-dev=archiver.kernel.org@lists.ozlabs.org Sender: "Linuxppc-dev" From: Pavel Tatashin Currently, it is possible to dump kmsges for panic, or oops. With max_reason it is possible to dump messages for other kmesg_dump events, for example reboot, halt, shutdown, kexec. Signed-off-by: Pavel Tatashin Link: https://lore.kernel.org/lkml/20200506211523.15077-6-keescook@chromium.org/ Signed-off-by: Kees Cook --- .../devicetree/bindings/reserved-memory/ramoops.txt | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/Documentation/devicetree/bindings/reserved-memory/ramoops.txt b/Documentation/devicetree/bindings/reserved-memory/ramoops.txt index 0eba562fe5c6..b7886fea368c 100644 --- a/Documentation/devicetree/bindings/reserved-memory/ramoops.txt +++ b/Documentation/devicetree/bindings/reserved-memory/ramoops.txt @@ -30,7 +30,7 @@ Optional properties: - ecc-size: enables ECC support and specifies ECC buffer size in bytes (defaults to 0: no ECC) -- record-size: maximum size in bytes of each dump done on oops/panic +- record-size: maximum size in bytes of each kmsg dump. (defaults to 0: disabled) - console-size: size in bytes of log buffer reserved for kernel messages @@ -45,7 +45,16 @@ Optional properties: - unbuffered: if present, use unbuffered mappings to map the reserved region (defaults to buffered mappings) -- no-dump-oops: if present, only dump panics (defaults to panics and oops) +- max-reason: if present, sets maximum type of kmsg dump reasons to store + (defaults to 2: log Oopses and Panics). This can be set to INT_MAX to + store all kmsg dumps. See include/linux/kmsg_dump.h KMSG_DUMP_* for other + kmsg dump reason values. Setting this to 0 (KMSG_DUMP_UNDEF), means the + reason filtering will be controlled by the printk.always_kmsg_dump boot + param: if unset, it will be KMSG_DUMP_OOPS, otherwise KMSG_DUMP_MAX. + +- no-dump-oops: deprecated, use max_reason instead. If present, and + max_reason is not specified, it is equivalent to max_reason = 1 + (KMSG_DUMP_PANIC). - flags: if present, pass ramoops behavioral flags (defaults to 0, see include/linux/pstore_ram.h RAMOOPS_FLAG_* for flag values). -- 2.20.1