From patchwork Fri May 15 18:44:34 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kees Cook X-Patchwork-Id: 1291558 Return-Path: X-Original-To: incoming-dt@patchwork.ozlabs.org Delivered-To: patchwork-incoming-dt@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=vger.kernel.org (client-ip=23.128.96.18; helo=vger.kernel.org; envelope-from=devicetree-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=chromium.org Authentication-Results: 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 vger.kernel.org (vger.kernel.org [23.128.96.18]) by ozlabs.org (Postfix) with ESMTP id 49Ny552NFyz9sTZ for ; Sat, 16 May 2020 04:44:57 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726813AbgEOSop (ORCPT ); Fri, 15 May 2020 14:44:45 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46664 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726786AbgEOSoo (ORCPT ); Fri, 15 May 2020 14:44:44 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81A37C05BD0A for ; Fri, 15 May 2020 11:44:44 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id b8so1384349pgi.11 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=OBJ+ubk1kGWdTEMXlTKUEZuAefqroHS2WHVUF/9M8xuvwmKUigc4rOjRBRyLhacVee ruKYSaOD94Z3RYPb2ew6el0Qff/j1ne5hp/MiFlInQDx9zSzG7g9zuQI1EYGpDn3nHF4 9S1fby0KrEu9oZtvD+Tzan8t0aD4UzbOQiX7rYBjcGc6iFlAaAEooui0YeaBYdgoQnYY P1S3E8U8p/SwHAvYWpKXRpKT4QmZjBKR6g+Z9Fp7dywoEFMj6cxStoXkhirGqMz/dMxp uvwUHENDiS7RuiAIP1pO9AxDnpL+mob7es95Fys+yOqncwJcP3IDYvVo5mOhRTP1VVCn TcTw== X-Gm-Message-State: AOAM530c1WVarSkWghtp0CcI7wq2sN/LAIXZ0LGqQevgFm1t2QzhQggc 3yTiKgFUbmkdKIaha3ETI/uJVQ== 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 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@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).