From patchwork Wed Jul 27 15:08:26 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Namhyung Kim X-Patchwork-Id: 9249985 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 0753E607F0 for ; Wed, 27 Jul 2016 15:11:56 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id EDB29269B2 for ; Wed, 27 Jul 2016 15:11:55 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E27EC26D06; Wed, 27 Jul 2016 15:11:55 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 8F7AC269B2 for ; Wed, 27 Jul 2016 15:11:55 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932267AbcG0PLk (ORCPT ); Wed, 27 Jul 2016 11:11:40 -0400 Received: from mail-pa0-f67.google.com ([209.85.220.67]:34197 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932101AbcG0PJq (ORCPT ); Wed, 27 Jul 2016 11:09:46 -0400 Received: by mail-pa0-f67.google.com with SMTP id hh10so1920257pac.1; Wed, 27 Jul 2016 08:09:46 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:from:to:cc:subject:date:message-id:in-reply-to:references; bh=0+XK5wx0LmWkHTqI+9Ccl8GJ/den7PqsjRbG6T8U5t8=; b=fxvrSNlNHNipnrEpnAuJgKA7U+74jQ6ct2ldt8LCMWxdFE2ByAk3+kh6gRvX5rETCP s5PaizhC805ovACou/+e0bYBQ0ulk61BYV397MX9Mwin+/zKSlYp67VIjyF11Ib6O17x JZ2BKgm3PmqKUpRyMs7NUnDyIQUWCj1Mo2rX9pd9LYR6wPKsPkK6ma57ko09iZaosSeL SuZ2LO+p4V92179JI7iEoAWgsu2N/sBi9Q4UKnIgdU8LPOLuK0wLPfanyrb2HCP7ABba oTLcdo7uKsjcoW3Yk1zFGF96YS5pJs5C1MPXzmeYe/eHGaerKAjhnerPQ7Zjrr3ddNBX c//w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :in-reply-to:references; bh=0+XK5wx0LmWkHTqI+9Ccl8GJ/den7PqsjRbG6T8U5t8=; b=Z9rF+NkCL+e7f20bHrXxO+vECmVtmy3qO9rcTeSgWGYz4V7eEujLeXy5P/jybx6Lud dP0QWZHrGna9xGD/oDIInuSGrD3plwvu0ZYpV7MSyKjb9lJiIeFjVzF4ZkUVgW1W57xL AMWzlu6eZ2Crc566b8eUicdl9jhla6mD9eLrDUO0cvW3HLo+4QsHgNDW+Yq+npfdxoKF +2Up1xnXxTNuOHYtqsEB0RybGel3LJYHQD/s0JbHLof6kyBps5gE45ED5DqKl8Gi+O4v O1WEQbUicijFEn8J/T1oiXzx/dUXTALFbI9QBt7LU+W2Oes8mvTOvV39q+jeGrX0zPt8 na4w== X-Gm-Message-State: AEkoouvCUBqFBKzHvTrqniKUqF4+JMDYdMQYy+ITEnfor7e+B8XL6gNBE1jEKn05Rnipzw== X-Received: by 10.66.82.42 with SMTP id f10mr50693965pay.17.1469632185625; Wed, 27 Jul 2016 08:09:45 -0700 (PDT) Received: from danjae.aot.lge.com ([210.100.147.61]) by smtp.gmail.com with ESMTPSA id 15sm10058488pfz.36.2016.07.27.08.09.42 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Wed, 27 Jul 2016 08:09:45 -0700 (PDT) From: Namhyung Kim To: kvm@vger.kernel.org, qemu-devel@nongnu.org, virtualization@lists.linux-foundation.org Cc: LKML , Anton Vorontsov , Colin Cross , Kees Cook , Tony Luck Subject: [PATCH 2/7] pstore/ram: Set pstore flags dynamically Date: Thu, 28 Jul 2016 00:08:26 +0900 Message-Id: <1469632111-23260-3-git-send-email-namhyung@kernel.org> X-Mailer: git-send-email 2.8.0 In-Reply-To: <1469632111-23260-1-git-send-email-namhyung@kernel.org> References: <1469632111-23260-1-git-send-email-namhyung@kernel.org> Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The ramoops can be configured to enable each pstore type by setting their size. In that case, it'd be better not to register disabled types in the first place. Cc: Anton Vorontsov Cc: Colin Cross Cc: Kees Cook Cc: Tony Luck Signed-off-by: Namhyung Kim --- fs/pstore/ram.c | 8 +++++++- include/linux/pstore.h | 2 -- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/fs/pstore/ram.c b/fs/pstore/ram.c index ba19a74e95bc..6c93268f7ced 100644 --- a/fs/pstore/ram.c +++ b/fs/pstore/ram.c @@ -624,7 +624,13 @@ static int ramoops_probe(struct platform_device *pdev) goto fail_clear; } - cxt->pstore.flags = PSTORE_FLAGS_ALL; + cxt->pstore.flags = PSTORE_FLAGS_DMESG; + if (cxt->console_size) + cxt->pstore.flags |= PSTORE_FLAGS_CONSOLE; + if (cxt->ftrace_size) + cxt->pstore.flags |= PSTORE_FLAGS_FTRACE; + if (cxt->pmsg_size) + cxt->pstore.flags |= PSTORE_FLAGS_PMSG; err = pstore_register(&cxt->pstore); if (err) { diff --git a/include/linux/pstore.h b/include/linux/pstore.h index 069b96faf478..9790904de6d2 100644 --- a/include/linux/pstore.h +++ b/include/linux/pstore.h @@ -79,8 +79,6 @@ struct pstore_info { #define PSTORE_FLAGS_FTRACE (1 << 2) #define PSTORE_FLAGS_PMSG (1 << 3) -#define PSTORE_FLAGS_ALL ((1 << 4) - 1) - extern int pstore_register(struct pstore_info *); extern void pstore_unregister(struct pstore_info *); extern bool pstore_cannot_block_path(enum kmsg_dump_reason reason);