From patchwork Thu Aug 15 01:20:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Dan Williams X-Patchwork-Id: 11094839 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6E0F613B1 for ; Thu, 15 Aug 2019 01:34:33 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 55D1F287D2 for ; Thu, 15 Aug 2019 01:34:33 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 45B90287E8; Thu, 15 Aug 2019 01:34:33 +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=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from ml01.01.org (ml01.01.org [198.145.21.10]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id F3BF6287D2 for ; Thu, 15 Aug 2019 01:34:32 +0000 (UTC) Received: from [127.0.0.1] (localhost [IPv6:::1]) by ml01.01.org (Postfix) with ESMTP id 41B85202EC058; Wed, 14 Aug 2019 18:36:34 -0700 (PDT) X-Original-To: linux-nvdimm@lists.01.org Delivered-To: linux-nvdimm@lists.01.org Received-SPF: Pass (sender SPF authorized) identity=mailfrom; client-ip=134.134.136.65; helo=mga03.intel.com; envelope-from=dan.j.williams@intel.com; receiver=linux-nvdimm@lists.01.org Received: from mga03.intel.com (mga03.intel.com [134.134.136.65]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 000FD202EBECF for ; Wed, 14 Aug 2019 18:36:32 -0700 (PDT) X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2019 18:34:30 -0700 X-IronPort-AV: E=Sophos;i="5.64,387,1559545200"; d="scan'208";a="352096850" Received: from dwillia2-desk3.jf.intel.com (HELO dwillia2-desk3.amr.corp.intel.com) ([10.54.39.16]) by orsmga005-auth.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 14 Aug 2019 18:34:30 -0700 Subject: [PATCH 0/3] libnvdimm/security: Enumerate the frozen state and other cleanups From: Dan Williams To: linux-nvdimm@lists.01.org Date: Wed, 14 Aug 2019 18:20:13 -0700 Message-ID: <156583201347.2815870.4687949334637966672.stgit@dwillia2-desk3.amr.corp.intel.com> User-Agent: StGit/0.18-2-gc94f MIME-Version: 1.0 X-BeenThere: linux-nvdimm@lists.01.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Linux-nvdimm developer list." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: linux-kernel@vger.kernel.org Errors-To: linux-nvdimm-bounces@lists.01.org Sender: "Linux-nvdimm" X-Virus-Scanned: ClamAV using ClamSMTP Jeff reported a scenario where ndctl was failing to unlock DIMMs [1]. Through the course of debug it was discovered that the security interface on the DIMMs was in the 'frozen' state disallowing unlock, or any security operation. Unfortunately the kernel only showed that the DIMMs were 'locked', not 'locked' and 'frozen'. Introduce a new sysfs 'frozen' attribute so that ndctl can reflect the "security-operations-allowed" state independently of the lock status. Then, followup with cleanups related to replacing a security-state-enum with a set of flags. [1]: https://lists.01.org/pipermail/linux-nvdimm/2019-August/022856.html Reviewed-by: Dave Jiang --- Dan Williams (3): libnvdimm/security: Introduce a 'frozen' attribute libnvdimm/security: Tighten scope of nvdimm->busy vs security operations libnvdimm/security: Consolidate 'security' operations drivers/acpi/nfit/intel.c | 65 +++++++----- drivers/nvdimm/bus.c | 2 drivers/nvdimm/dimm_devs.c | 134 ++++++-------------------- drivers/nvdimm/nd-core.h | 51 ++++------ drivers/nvdimm/security.c | 199 +++++++++++++++++++++++++------------- include/linux/libnvdimm.h | 9 +- tools/testing/nvdimm/dimm_devs.c | 19 +--- 7 files changed, 231 insertions(+), 248 deletions(-)