Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2534769imu; Thu, 17 Jan 2019 16:27:38 -0800 (PST) X-Google-Smtp-Source: ALg8bN7kKhOHjoL6RmcpNQ8yQEsvS8DDXcZKr0C7ie6JDd1GFczIwoVFBS7RTp/uLLlrXmu8Cd0Z X-Received: by 2002:a62:546:: with SMTP id 67mr16716502pff.99.1547771258933; Thu, 17 Jan 2019 16:27:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547771258; cv=none; d=google.com; s=arc-20160816; b=JQ0sg5KrGmxxfIeRG3XB+X1+M9GE/H7t5RRR0eYt1awTXbxa1OZ1fyT+NlXU8/vMNl V6G+6Sy7P0VumatMsNAiLCnUtV9XI+RU9M2wQLborgBBAgU3jIddo8sj9kNaL8fxsW0p qrEEZvDLdbRUfKCeuDEKl4cFXf/4lX8zN2crXZ3n+1N/5o7Zu/3vcYbACQQzQMtvYb6l u8wWSBCCGpd+zIT0dkPDmz0qQa8MPs/tfXVMRW6p0aJSrFUi4C39mpDyUgup7G9PyNig mAqIiuSRPereL8uD/guWMaHpnLsp6eyAs+E+v78CxqcKNAC3HADakozMzAUrODYX2L1d RjGQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=t0gqUl4mUi5tlZDzoaHQ9fvC2be2sR+pQiCoQd+FlXA=; b=TvJkDpBS1tn43qkjLcCPdwZlZzUbOLKPVfA2at3tY5Dwd//waqTFCvCGhZCyuUINC8 AkkI44+4OXs0ZRVEOUphVSF9mxi4iApvh7fBJR7TCgsAXPAOgqY5d39KvUWHhgXqRb6e nD6KMuV0EeZE3DuqohtyHONvZ2Qcno6/yyeNvcHEUuk424Qx4SJ4RQPS7KnQqnrZ7NQj Xp79upylERJ6yCztdkY6hhQQwTNxSyI2zvExK73fdJMgGOe3CzE9M43tSX8Fit9Dnbai oi4FL1+6mbNomk4xUGCEngJFEtTbUN5n8HuK/VoHMf4TaIxVAPMYDIjTECCWXRtKz7iE uZQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=b0K32N0L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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. [209.132.180.67]) by mx.google.com with ESMTP id v3si2696649pgh.305.2019.01.17.16.27.22; Thu, 17 Jan 2019 16:27:38 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=b0K32N0L; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 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 S1726821AbfARAVv (ORCPT + 99 others); Thu, 17 Jan 2019 19:21:51 -0500 Received: from mail-ua1-f68.google.com ([209.85.222.68]:47053 "EHLO mail-ua1-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726081AbfARAVs (ORCPT ); Thu, 17 Jan 2019 19:21:48 -0500 Received: by mail-ua1-f68.google.com with SMTP id v24so4111187uap.13 for ; Thu, 17 Jan 2019 16:21:47 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=t0gqUl4mUi5tlZDzoaHQ9fvC2be2sR+pQiCoQd+FlXA=; b=b0K32N0LcrQbySCxkqcm6WmnouvQhncJ8aVd8LzQUACWYBUvUvdQ5GelUCEPSXO41U 8tfUN4lcKVFtWNYu310QFw7iUkg/9XL+403rqBqm8QVsMMKsSAN+k4pyXg4qF2DceVmz ExeGdh0wbLLRg2EWWT/38DpwKMwEG68aqTdeo= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=t0gqUl4mUi5tlZDzoaHQ9fvC2be2sR+pQiCoQd+FlXA=; b=ffCFcqeK8u5Ks8UKDkvLoCxRpvluGzG0TZrbSRxb0eDjTOaDWZSn4Hl8xq6fZV+W0F NcWzvG/PAAuSKfo58G13+bIvd0X+veWSp7dyp92zbAIr0l+aIQRHrWNG4f05bYjOnPvP Kc2qcE7opmpiLMV9/u1VrBMDL1vAanPjOgzBmmqsb7kwRqqtncku3OFp5JBvUJaHFmze I5VOcFhav3LExWRF3NxkUTWGpN4Rv84pps9QCIO7NyEdvB2XxERmFtQr55sQ2KRrRUWm sxWnLXf/1UECpDbfbjPo2wGFDO8igO0JZxzNawEScXSWKXErk6D35oWeqKp8+3Bt03cy xwIg== X-Gm-Message-State: AJcUukeuWVGOUuUe/VcBUf5mxs2437QJTdqU10/BVZIcweqdfd07iY4C 0GMH+psizHPJw6H0DKEVo2ac59gIPRw= X-Received: by 2002:ab0:1058:: with SMTP id g24mr1163275uab.58.1547770907246; Thu, 17 Jan 2019 16:21:47 -0800 (PST) Received: from mail-vk1-f169.google.com (mail-vk1-f169.google.com. [209.85.221.169]) by smtp.gmail.com with ESMTPSA id l197sm75125964vke.18.2019.01.17.16.21.44 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 17 Jan 2019 16:21:44 -0800 (PST) Received: by mail-vk1-f169.google.com with SMTP id y14so2692742vky.9 for ; Thu, 17 Jan 2019 16:21:44 -0800 (PST) X-Received: by 2002:a1f:3d10:: with SMTP id k16mr6446389vka.13.1547770903638; Thu, 17 Jan 2019 16:21:43 -0800 (PST) MIME-Version: 1.0 References: <1546862462-19640-1-git-send-email-liaoweixiong@allwinnertech.com> <1546862462-19640-3-git-send-email-liaoweixiong@allwinnertech.com> In-Reply-To: From: Kees Cook Date: Thu, 17 Jan 2019 16:21:31 -0800 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC v5 2/4] pstore/blk: add sample for pstore_blk To: liaoweixiong Cc: Anton Vorontsov , Colin Cross , Tony Luck , Jonathan Corbet , Mauro Carvalho Chehab , Greg Kroah-Hartman , "David S. Miller" , Andrew Morton , Nicolas Ferre , Arnd Bergmann , "open list:DOCUMENTATION" , LKML Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Jan 17, 2019 at 4:15 PM Kees Cook wrote: > > On Mon, Jan 7, 2019 at 4:01 AM liaoweixiong > wrote: > > > > It is a sample for pstore_blk, using general ram rather than block device. > > According to pstore_blk, the data will be saved to ram buffer if not > > register device path and apis for panic. So, it can only used to dump > > Oops and some things will not reboot. > > I'm not sure I see the purpose of this implementation? Doesn't this > just cause all the pstore machinery to skip any actions? i.e. without > bzinfo->part_path, won't blkz_sample_write() just return -EINVAL, etc? Say, instead of a no-op driver, can you build something like the how ramoops processes module parameters, so that a person can define an arbitrary device at boot time for blkoops? This also allows for easier runtime testing too. This all looks good, with some minor tweaks as mentioned. And on closer review, yeah, it doesn't look like it shares much with ramoops. :) Thanks for sending this series; I look forward to the next version. :) -Kees -- Kees Cook