Received: by 2002:a25:868d:0:0:0:0:0 with SMTP id z13csp722181ybk; Fri, 15 May 2020 11:49:05 -0700 (PDT) X-Google-Smtp-Source: ABdhPJySaC7gNtU0z5JiULHuXlGLJ6wnTmXVtixRoQ3DMhXn0+e2sQw0uNni1o+ISqoxs29yaICa X-Received: by 2002:a05:6402:783:: with SMTP id d3mr4092038edy.295.1589568545290; Fri, 15 May 2020 11:49:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1589568545; cv=none; d=google.com; s=arc-20160816; b=gLdaxUZVLYaLLZqZb+y6ZAKT/EDo6V087UdiYKMrlQIfP84dTArBtPLvpPZPznqyVU VJiJwm7hN3JXv/v1YvWHDTdXRnEmr6J39KO8yl4UHWfyUbJEcJdmjZ6fmlUXMPWQxDwu /35E3vsmA71Koql7QZls6KUFz7z38B+bAZ22cv+Sk5H049nbG4puup/es/eBZGDW57HB klzUJ2x/GXmrJYi8AAl0JJ7jVzrVnra/EfwJBG/FhHBncPrJ2W4v4MOX8jM2opQkXYQ7 9rrvS/jiG7cW9HQRHQO4oJyO7b0c5nbSVUzi2bLf93vT965YiYizSRuIBAexfrKfS7Ks 5C9g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=rZrZZlEq92Pse6AsQBZ3gt5RG0ZPIDCja3ntEc/+5UQ=; b=yT7tHgtbiaoS9C6IRI4bHNvwv2/MathIBUPVO9g4uguCqkncJDD9KZPFnGio/yDUYk XihuKXmwgOPH4J1JaWmkjkL+FU7DjwEB/tOTj8pq+K1luoI6nW9SBM5siny+ef2Lli5D 3m1eEGYxkaNNmazH1wTFoeeZ6FOMtQPaVg2y+FllrXz2UHz8G/nY7yAuV3ZgQTAfnlHR tN2UEvL5Fu1+ZZkeDi1R/CJswPc0vwVMg46vR5/OENPhHk4NlWlsIq73due4evYYIcKp go196ZD+ZAitUt86CtvAMj7Hk7g+6XQqdFHnCEu4lM1PfMVIyzpvUxN1vYvLCPHfdSPA VmuQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=OF8azeut; 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 b2si1831089edq.115.2020.05.15.11.48.42; Fri, 15 May 2020 11:49:05 -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=OF8azeut; 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 S1726880AbgEOSoq (ORCPT + 99 others); Fri, 15 May 2020 14:44:46 -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-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