Received: by 2002:ac0:98c7:0:0:0:0:0 with SMTP id g7-v6csp2563257imd; Fri, 2 Nov 2018 13:40:48 -0700 (PDT) X-Google-Smtp-Source: AJdET5dw7Zwo+XNE5EqAr1XSb5SyLYmKQ9VaUWuF5RUgF0bvG+0d3NbmdU1zdkMpG2c6WifJXFB4 X-Received: by 2002:a17:902:b7cc:: with SMTP id v12-v6mr12483661plz.278.1541191248925; Fri, 02 Nov 2018 13:40:48 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1541191248; cv=none; d=google.com; s=arc-20160816; b=HDj/SYL96G5ugWmxLr/X+xZmJg6hVkrgj0jyicruR5dvwnV36eXdVdF6xkJkTn7DXh jPkKsFLF2hBhni6B3ZLJadhasIGsOFc7Z8k9vQPq4cPtW5ac3fkc/dGCnsxeUEqC/MTt ZH1Z9vWti2HETN7cY1lyCV2WFAKN9K8zNep/YRYYeQaf96eNWye6WSUnQRMTeUOcmZrP aX7HLtaDiR235pK0DCO+iu5W+rEVwQlvZtkmzajmtclJSNfQSLvwQBzrrhA5dB5tAdhc lL+WdbVCSfr/Gi5kL0clCS7Ockn77eKz+Q3ozc5zGGR2/QTCSBBMG8zm60WoWVGWF+kP 13pQ== 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 :references:in-reply-to:mime-version:dkim-signature; bh=+Jgq1QIk/eMF0hEP86NUtXenU1DTPf58qugXA8kezIo=; b=FzrXXEjGomAG+06/7/VgOeUc6rngntw2rfPyKYj5QHBblnN3EZhrYUL4XX3Mm5vFfZ jOQsiwmeOvS6orZ154eQk057lh97gsW3T4LHuE6pGbDV4E/ey35xZYUA2hv0n3JA53Xy slv63vSSSSeFKSgptnvRkTeX0MiMldU0HDVkN8XBkisPLTbOqCjYis3GheBpT32eMUSb U2PekIzwMW9duir++MaV1vvd7gJgKLKQ+ScF308sUOn0fp3jkahEGdd1PYDPjSn7VZL5 lYkqWdJruVlyoMGOK6ixyBrj8QFDum8q8/iUVW2L1zTFNjtpOLO3SjXdjqZPk9Z7DiHX Rrvg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@chromium.org header.s=google header.b=QjBcxRsq; 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 v184si19873528pgd.295.2018.11.02.13.40.33; Fri, 02 Nov 2018 13:40:48 -0700 (PDT) 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=QjBcxRsq; 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 S1726910AbeKCFss (ORCPT + 99 others); Sat, 3 Nov 2018 01:48:48 -0400 Received: from mail-yw1-f65.google.com ([209.85.161.65]:43009 "EHLO mail-yw1-f65.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726705AbeKCFss (ORCPT ); Sat, 3 Nov 2018 01:48:48 -0400 Received: by mail-yw1-f65.google.com with SMTP id j75-v6so1270748ywj.10 for ; Fri, 02 Nov 2018 13:40:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=chromium.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=+Jgq1QIk/eMF0hEP86NUtXenU1DTPf58qugXA8kezIo=; b=QjBcxRsqRl4vNLorboGZWnzBSjNVD8E3oQZy06bV1/EMxDOQYSzOJwoKqSrjYcqA7P XdQL40MvTQCVQ7CwJGPAyx26sdH8OS7+Z2lAp/cVV4aG3kC/bGqg2mtnyHakc3BLKM9l YS8OJf1X2Y+/a+oL6pOt8QbIfqYmkjajYxSpw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=+Jgq1QIk/eMF0hEP86NUtXenU1DTPf58qugXA8kezIo=; b=ix4BUVNXVIcD6BmDWVNXbif2BtgIJZXOxOqev3QnX6I1AMkOcOu26izU76/mOZqhuu ThQbII4pd6qysb+oLYMaBL1125rGSEvCuTpCskM8E67qTAfEYWR6lbUD7EBfFDCGITMO aDuiLz3bgzhaJ9n67mwE0Kvtx9m9DnuNOUAPSpOtQJbb8uNeabQUE/ghjEXIqK/XVUPg 8Tx3sj00x+owU4NmswprUZhJ4NQXOCcX03XiJHRny7yXCLdC985D5z8/hxNTP3fRNhCa 9aJtge4LkLftGh720Y62WM+IJRzVibMpT90NnlmTQ48xic1Ce5L1gh033PR+fAlkYdN+ H28Q== X-Gm-Message-State: AGRZ1gKSwI0Fxgk9v2khnJ7TS5CTWiNgxc9GKYmmfII3gOlpwkgNSJwB CrcGSy9hVM3ZveFhfoqZ+eMnpfmkZ+s= X-Received: by 2002:a0d:cacf:: with SMTP id m198-v6mr13145350ywd.145.1541191210666; Fri, 02 Nov 2018 13:40:10 -0700 (PDT) Received: from mail-yb1-f176.google.com (mail-yb1-f176.google.com. [209.85.219.176]) by smtp.gmail.com with ESMTPSA id a189-v6sm8582967ywf.49.2018.11.02.13.40.08 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 02 Nov 2018 13:40:09 -0700 (PDT) Received: by mail-yb1-f176.google.com with SMTP id v92-v6so1320229ybi.5 for ; Fri, 02 Nov 2018 13:40:08 -0700 (PDT) X-Received: by 2002:a25:3588:: with SMTP id c130-v6mr13271369yba.410.1541191207949; Fri, 02 Nov 2018 13:40:07 -0700 (PDT) MIME-Version: 1.0 Received: by 2002:a25:3990:0:0:0:0:0 with HTTP; Fri, 2 Nov 2018 13:40:06 -0700 (PDT) In-Reply-To: <20181102183204.GC14942@google.com> References: <20181101235200.28584-1-keescook@chromium.org> <20181101235200.28584-8-keescook@chromium.org> <20181102183204.GC14942@google.com> From: Kees Cook Date: Fri, 2 Nov 2018 13:40:06 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 7/8] pstore: Remove needless lock during console writes To: Joel Fernandes Cc: LKML , Anton Vorontsov , Colin Cross , Tony Luck 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 Fri, Nov 2, 2018 at 11:32 AM, Joel Fernandes wrote: > On Thu, Nov 01, 2018 at 04:51:59PM -0700, Kees Cook wrote: >> Since commit 70ad35db3321 ("pstore: Convert console write to use >> ->write_buf"), the console writer does not use the preallocated crash >> dump buffer any more, so there is no reason to perform locking around it. > > Out of curiosity, what was the reason for having this preallocated crash > buffer in the first place? I thought the 'console' type only did regular > kernel console logging, not crash dumps. The primary reason is that the dumper needs to write to somewhere and we don't know the state of the system (memory allocation may not work for example). The other frontends tend to run at "sane" locations in the kernel. The dumper, however, is quite fragile. > I looked at all the patches and had some minor nits, with the nits addressed > (if you agree with them), feel free to add my Reviewed-by on future respins: > > Reviewed-by: Joel Fernandes (Google) Thanks! > Also I wonder if Namhyung is still poking around that virtio pstore driver he > mentioned in the commit mentioned above. :) Did that never land? I thought it mostly had to happen at the qemu end? With nvdimm emulation, we can just use ramoops. :) -Kees -- Kees Cook