Received: by 2002:a17:90a:bc8d:0:0:0:0 with SMTP id x13csp1549178pjr; Mon, 18 May 2020 16:07:19 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyX/dzsY1ND4BQNE+5XPZmWRTYYwPyfPSXbJgwHFc/ncMoTFY2RCHs2o3QfxyB3YIoTrg+H X-Received: by 2002:a17:907:4096:: with SMTP id nm6mr17487072ejb.30.1589843239122; Mon, 18 May 2020 16:07:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589843239; cv=none; d=google.com; s=arc-20160816; b=w+nLA4nLl8ZO8oxIZU99WnwGFY0taCexmPggenyCbYysNF9OHNY8UsZwcYl/B+9A67 ZVKwZEPfuL/9tS3nolSsYdzx3l8uORSGLVtlJic5m7oFvD9w7R7bb7c2GbMtHM3NKUyt qEmUanFyZN6YGnG67ie8ULJtrD9yqX/yR9zJTR1CBLQ3QxGdY/sYKDGto7pF7siwqmZv 3dmI0IVPGQuOf7ebRWxL0MGnJfO/M6SQ1uKqXxs+fF/4tHY2zriADf/ALMN1XEKqZW43 Bx6wnGjUfMHjx61Rdnzjhjucq7wE2SPntvgJkqhvsnLBf8cGQltFmYQhkEy3eZjWUn5K At8g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date :dkim-signature; bh=r1Le0nR4tySg2kT1BHFLkI6EUe6Y+WJSI4SzoGFWd78=; b=gt8MdR+hVKMf25NCfg85t+UpVmg93dw6TmL6LHU3awqIxt0L0AFjMdR2Hlv9aUO+1A iDbre4ltI3HfUHwkTq8Yy7rAjaJQo/VZbeAHLnnjgqUzai/Yu+nhVb9kpe8IbQgcJ8d/ 7HHECWvewW7einxhHQDdLys4AFh/ObcZwNha065SbNc15eC7SBWeLQtMK2IEXP/B11XZ 0aDJ4TWOwastNunPAKEGrk3giHlalgHJ8rBWgdBZZbYIzk3HiKgg8rQZbBqfjNgsuVC9 /uBbvlqCzgEBotGVijdDtsKtVwrL5zeAL743ACsfD6Ph+syFro8OnL++jtFKRtyHQaYK X6qg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=X8YMwEb7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id z13si6650762ede.147.2020.05.18.16.06.56; Mon, 18 May 2020 16:07:19 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=X8YMwEb7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=chromium.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728445AbgERXEl (ORCPT + 99 others); Mon, 18 May 2020 19:04:41 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53844 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726539AbgERXEk (ORCPT ); Mon, 18 May 2020 19:04:40 -0400 Received: from mail-pg1-x543.google.com (mail-pg1-x543.google.com [IPv6:2607:f8b0:4864:20::543]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 71D46C05BD09 for ; Mon, 18 May 2020 16:04:40 -0700 (PDT) Received: by mail-pg1-x543.google.com with SMTP id p21so5507887pgm.13 for ; Mon, 18 May 2020 16:04:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=r1Le0nR4tySg2kT1BHFLkI6EUe6Y+WJSI4SzoGFWd78=; b=X8YMwEb7Lw6MWj/O2T9yVdzE4Qn1LZvj16YoPpFa5Bi9kpMAY6JEpRegNVtbbNZZln KaAi1nbXmSCB4kMjiVjJAR72mczRt1j1ih6NIC8arnMSF3X7aErbEVibKj2suB6EpYAR RG79hUO+hsivoJncAPGCJZq+f0OcKGtG0P49o= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=r1Le0nR4tySg2kT1BHFLkI6EUe6Y+WJSI4SzoGFWd78=; b=FdGQ94r6xQQYw7MUKnXyik7dUvcMlpMWcnbAlLSOamuf92I+4hbUA+XkHMK9EqAgBZ 3BGtqPxKWJ7FKgdMFCj2cuu5Y/GqKrP9/uh0YczxfBHKNSb6167sRgjU20SZJTONAnRX q3mi+9wzpzAgQ1JQQyuyeH2RP4SkCEsJnq28UxdT0UZKtDXJV2N3UqvsdxKPWgR88eTu ygCgiFeakA2531szrnc1kqfPCnWe/B7rdzLOm5rc2q1jeiTAHO18eFMDmZXsGHv+QH4p QlOLJZvZguvHyK9zSlYElr4zvuxAoRu/AjtItp6H87DTq+We4j29/1zsj+062P6GHmDr D2jQ== X-Gm-Message-State: AOAM531sqBYmo/O+F98+9Rrd8IqWuflGgcYYx8tNgVqZ3Rm9idf2I26v Rh8bJaTu0HJevZKUjed13tZnBw== X-Received: by 2002:a63:ef03:: with SMTP id u3mr3765193pgh.254.1589843079916; Mon, 18 May 2020 16:04:39 -0700 (PDT) Received: from www.outflux.net (smtp.outflux.net. [198.145.64.163]) by smtp.gmail.com with ESMTPSA id mn19sm478872pjb.8.2020.05.18.16.04.38 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 18 May 2020 16:04:39 -0700 (PDT) Date: Mon, 18 May 2020 16:04:37 -0700 From: Kees Cook To: Rob Herring Cc: Pavel Tatashin , Petr Mladek , Anton Vorontsov , Colin Cross , Tony Luck , Jonathan Corbet , Benson Leung , Michael Ellerman , Benjamin Herrenschmidt , Paul Mackerras , Enric Balletbo i Serra , Sergey Senozhatsky , Steven Rostedt , Linux Doc Mailing List , "linux-kernel@vger.kernel.org" , devicetree@vger.kernel.org, linuxppc-dev Subject: Re: [PATCH v4 6/6] ramoops: Add max_reason optional field to ramoops DT node Message-ID: <202005181603.C8CBA854@keescook> References: <20200515184434.8470-1-keescook@chromium.org> <20200515184434.8470-7-keescook@chromium.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Mon, May 18, 2020 at 04:45:32PM -0600, Rob Herring wrote: > On Fri, May 15, 2020 at 12:44 PM Kees Cook wrote: > > > > From: Pavel Tatashin > > Subject still has 'max_reason'. > > > > > Currently, it is possible to dump kmsges for panic, or oops. > > With max_reason it is possible to dump messages for other > > And here. Ah yeah, this was, I think, describing the internal field name, but I see it would be less confusing to refer to this by the DT name. I will adjust it. Thanks! -Kees > > > 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 > > And here (3 times). > > > + (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 > > -- Kees Cook