From: Scott Bauer <scott.bauer@intel.com> To: linux-nvme@lists.infradead.org Cc: Rafael.Antognolli@intel.com, axboe@fb.com, keith.busch@intel.com, jonathan.derrick@intel.com, viro@zeniv.linux.org.uk, hch@infradead.org, linux-kernel@vger.kernel.org, sagi@grimberg.me Subject: [PATCH v3 0/5] SED OPAL Library Date: Mon, 19 Dec 2016 12:35:44 -0700 [thread overview] Message-ID: <1482176149-2257-1-git-send-email-scott.bauer@intel.com> (raw) Changes from v2->v3: 1) Removed the necessity of passing around block devices into the opal code. We now pass around a sed_context structure which contains a previously allocated opal_dev structure, sec_ops fn pointers, and opaque data for the send/recv functions to use. 2) Removed the allocation of the opal_dev structure from the opal_code to the driver wishing to use opal. The driver will use a sed_context, structure and allocate an opal_dev structure for each device. In the case of NVMe we store the sed_context structure in the control struct. When someone wishes to issue opal commands down to the controller they open the char dev. In the NVMe open implementation we assign our sed_context into the file structure. Pushing the burden of allocating and storing the opal_dev into the driver alleviates a bunch of look up code we had in v1/v2. Now by the time we get into the sed-opal code the driver has assigned us a sed_context and we operate directly on that. This should help with in-kernel use cases as well. 3) Since Opal will operate on the entire device, not per-namespace, we moved from block/ to fs/ and will operate on the nvme character driver. Because of that the sed "guts" have moved from block/ back to lib/. 4) Numerous code clean ups in sed-opal.c to shorten the file. ~700 lines reduced 5) Removed the variadic test_and_add_va for a hopefully easier to understand and maintain ADD_TOKEN macro that assigns values into the flat buffer and does error checking. -------------------------------------------------------------------- This Patch series implements a large portion of the Opal protocol for self encrypting devices. The driver has the capability of storing a locking range's password. The password can then be replayed during a resume from previous suspend-to-RAM. The driver also supports logic to bring the device out of a factory default-inactive state into a functional Opal state. The following logic is supported in order to bring the tper into a working state: 1) Taking Ownership of the drive (Setting the Admin CPIN). 2) Activating the Locking SP (In Single User Mode or Normal Mode). 3) Setting up Locking Ranges (Single User or Normal Mode). 4) Adding users to Locking Ranges (Normal Mode Only). 5) Locking or Unlocking Locking Ranges (Single User Mode or Normal Mode). 6) Reverting the TPer (Restore to factory default). 7) Setting LR/User passwords (Single User Mode or Normal Mode). 8) Enabling/disabling Shadow MBR. 9) Enabling Users in the LockingSP (Normal Mode Only). 10) Saving Password for resume from suspend. 11) Erase and Secure erasing locking ranges. All commands are exported through the Fs ioctl. Scott Bauer (5): include: Add definitions for sed lib: Add Sed-opal library fs: Wire up SED/Opal to ioctl nvme: Implement resume_from_suspend and SED Allocation code. Maintainers: Add Information for SED Opal library MAINTAINERS | 10 + drivers/nvme/host/core.c | 67 ++ drivers/nvme/host/nvme.h | 8 +- drivers/nvme/host/pci.c | 10 +- fs/ioctl.c | 3 + include/linux/fs.h | 2 + include/linux/sed-opal.h | 38 + include/linux/sed.h | 76 ++ include/uapi/linux/sed-opal.h | 94 ++ include/uapi/linux/sed.h | 64 ++ lib/Makefile | 2 +- lib/sed-opal.c | 2376 +++++++++++++++++++++++++++++++++++++++++ lib/sed-opal_internal.h | 601 +++++++++++ lib/sed.c | 197 ++++ 14 files changed, 3545 insertions(+), 3 deletions(-) create mode 100644 include/linux/sed-opal.h create mode 100644 include/linux/sed.h create mode 100644 include/uapi/linux/sed-opal.h create mode 100644 include/uapi/linux/sed.h create mode 100644 lib/sed-opal.c create mode 100644 lib/sed-opal_internal.h create mode 100644 lib/sed.c
WARNING: multiple messages have this Message-ID (diff)
From: scott.bauer@intel.com (Scott Bauer) Subject: [PATCH v3 0/5] SED OPAL Library Date: Mon, 19 Dec 2016 12:35:44 -0700 [thread overview] Message-ID: <1482176149-2257-1-git-send-email-scott.bauer@intel.com> (raw) Changes from v2->v3: 1) Removed the necessity of passing around block devices into the opal code. We now pass around a sed_context structure which contains a previously allocated opal_dev structure, sec_ops fn pointers, and opaque data for the send/recv functions to use. 2) Removed the allocation of the opal_dev structure from the opal_code to the driver wishing to use opal. The driver will use a sed_context, structure and allocate an opal_dev structure for each device. In the case of NVMe we store the sed_context structure in the control struct. When someone wishes to issue opal commands down to the controller they open the char dev. In the NVMe open implementation we assign our sed_context into the file structure. Pushing the burden of allocating and storing the opal_dev into the driver alleviates a bunch of look up code we had in v1/v2. Now by the time we get into the sed-opal code the driver has assigned us a sed_context and we operate directly on that. This should help with in-kernel use cases as well. 3) Since Opal will operate on the entire device, not per-namespace, we moved from block/ to fs/ and will operate on the nvme character driver. Because of that the sed "guts" have moved from block/ back to lib/. 4) Numerous code clean ups in sed-opal.c to shorten the file. ~700 lines reduced 5) Removed the variadic test_and_add_va for a hopefully easier to understand and maintain ADD_TOKEN macro that assigns values into the flat buffer and does error checking. -------------------------------------------------------------------- This Patch series implements a large portion of the Opal protocol for self encrypting devices. The driver has the capability of storing a locking range's password. The password can then be replayed during a resume from previous suspend-to-RAM. The driver also supports logic to bring the device out of a factory default-inactive state into a functional Opal state. The following logic is supported in order to bring the tper into a working state: 1) Taking Ownership of the drive (Setting the Admin CPIN). 2) Activating the Locking SP (In Single User Mode or Normal Mode). 3) Setting up Locking Ranges (Single User or Normal Mode). 4) Adding users to Locking Ranges (Normal Mode Only). 5) Locking or Unlocking Locking Ranges (Single User Mode or Normal Mode). 6) Reverting the TPer (Restore to factory default). 7) Setting LR/User passwords (Single User Mode or Normal Mode). 8) Enabling/disabling Shadow MBR. 9) Enabling Users in the LockingSP (Normal Mode Only). 10) Saving Password for resume from suspend. 11) Erase and Secure erasing locking ranges. All commands are exported through the Fs ioctl. Scott Bauer (5): include: Add definitions for sed lib: Add Sed-opal library fs: Wire up SED/Opal to ioctl nvme: Implement resume_from_suspend and SED Allocation code. Maintainers: Add Information for SED Opal library MAINTAINERS | 10 + drivers/nvme/host/core.c | 67 ++ drivers/nvme/host/nvme.h | 8 +- drivers/nvme/host/pci.c | 10 +- fs/ioctl.c | 3 + include/linux/fs.h | 2 + include/linux/sed-opal.h | 38 + include/linux/sed.h | 76 ++ include/uapi/linux/sed-opal.h | 94 ++ include/uapi/linux/sed.h | 64 ++ lib/Makefile | 2 +- lib/sed-opal.c | 2376 +++++++++++++++++++++++++++++++++++++++++ lib/sed-opal_internal.h | 601 +++++++++++ lib/sed.c | 197 ++++ 14 files changed, 3545 insertions(+), 3 deletions(-) create mode 100644 include/linux/sed-opal.h create mode 100644 include/linux/sed.h create mode 100644 include/uapi/linux/sed-opal.h create mode 100644 include/uapi/linux/sed.h create mode 100644 lib/sed-opal.c create mode 100644 lib/sed-opal_internal.h create mode 100644 lib/sed.c
next reply other threads:[~2016-12-19 19:43 UTC|newest] Thread overview: 70+ messages / expand[flat|nested] mbox.gz Atom feed top 2016-12-19 19:35 Scott Bauer [this message] 2016-12-19 19:35 ` [PATCH v3 0/5] SED OPAL Library Scott Bauer 2016-12-19 19:35 ` [PATCH v3 1/5] include: Add definitions for sed Scott Bauer 2016-12-19 19:35 ` Scott Bauer 2016-12-20 6:46 ` Christoph Hellwig 2016-12-20 6:46 ` Christoph Hellwig 2016-12-25 14:15 ` Jethro Beekman 2016-12-25 14:15 ` Jethro Beekman 2016-12-27 22:14 ` Scott Bauer 2016-12-27 22:14 ` Scott Bauer 2016-12-19 19:35 ` [PATCH v3 2/5] lib: Add Sed-opal library Scott Bauer 2016-12-19 19:35 ` Scott Bauer 2016-12-19 21:34 ` Keith Busch 2016-12-19 21:34 ` Keith Busch 2016-12-20 6:07 ` Christoph Hellwig 2016-12-20 6:07 ` Christoph Hellwig 2016-12-20 3:21 ` kbuild test robot 2016-12-20 3:21 ` kbuild test robot 2016-12-20 3:48 ` kbuild test robot 2016-12-20 3:48 ` kbuild test robot 2016-12-20 6:50 ` Al Viro 2016-12-20 6:50 ` Al Viro 2016-12-20 7:28 ` Christoph Hellwig 2016-12-20 7:28 ` Christoph Hellwig 2016-12-20 21:55 ` Scott Bauer 2016-12-20 21:55 ` Scott Bauer 2016-12-21 9:42 ` Christoph Hellwig 2016-12-21 9:42 ` Christoph Hellwig 2016-12-20 22:07 ` Jon Derrick 2016-12-20 22:07 ` Jon Derrick 2016-12-21 9:47 ` Christoph Hellwig 2016-12-21 9:47 ` Christoph Hellwig 2016-12-19 19:35 ` [PATCH v3 3/5] fs: Wire up SED/Opal to ioctl Scott Bauer 2016-12-19 19:35 ` Scott Bauer 2016-12-20 6:21 ` Christoph Hellwig 2016-12-20 6:21 ` Christoph Hellwig 2016-12-19 19:35 ` [PATCH v3 4/5] nvme: Implement resume_from_suspend and SED Allocation code Scott Bauer 2016-12-19 19:35 ` Scott Bauer 2016-12-19 21:59 ` Keith Busch 2016-12-19 21:59 ` Keith Busch 2016-12-19 22:23 ` Scott Bauer 2016-12-19 22:23 ` Scott Bauer 2016-12-20 6:17 ` Christoph Hellwig 2016-12-20 6:17 ` Christoph Hellwig 2016-12-20 15:49 ` Keith Busch 2016-12-20 15:49 ` Keith Busch 2016-12-20 15:46 ` Christoph Hellwig 2016-12-20 15:46 ` Christoph Hellwig 2016-12-20 16:05 ` Scott Bauer 2016-12-20 16:05 ` Scott Bauer 2016-12-21 9:01 ` Christoph Hellwig 2016-12-21 9:01 ` Christoph Hellwig 2016-12-20 17:52 ` Scott Bauer 2016-12-20 17:52 ` Scott Bauer 2016-12-21 9:37 ` Christoph Hellwig 2016-12-21 9:37 ` Christoph Hellwig 2016-12-20 4:11 ` kbuild test robot 2016-12-20 4:11 ` kbuild test robot 2016-12-20 6:21 ` Christoph Hellwig 2016-12-20 6:21 ` Christoph Hellwig 2016-12-20 6:49 ` Christoph Hellwig 2016-12-20 6:49 ` Christoph Hellwig 2016-12-25 14:15 ` Jethro Beekman 2016-12-25 14:15 ` Jethro Beekman 2016-12-27 22:12 ` Scott Bauer 2016-12-27 22:12 ` Scott Bauer 2016-12-28 8:39 ` Christoph Hellwig 2016-12-28 8:39 ` Christoph Hellwig 2016-12-19 19:35 ` [PATCH v3 5/5] Maintainers: Add Information for SED Opal library Scott Bauer 2016-12-19 19:35 ` Scott Bauer
Reply instructions: You may reply publicly to this message via plain-text email using any one of the following methods: * Save the following mbox file, import it into your mail client, and reply-to-all from there: mbox Avoid top-posting and favor interleaved quoting: https://en.wikipedia.org/wiki/Posting_style#Interleaved_style * Reply using the --to, --cc, and --in-reply-to switches of git-send-email(1): git send-email \ --in-reply-to=1482176149-2257-1-git-send-email-scott.bauer@intel.com \ --to=scott.bauer@intel.com \ --cc=Rafael.Antognolli@intel.com \ --cc=axboe@fb.com \ --cc=hch@infradead.org \ --cc=jonathan.derrick@intel.com \ --cc=keith.busch@intel.com \ --cc=linux-kernel@vger.kernel.org \ --cc=linux-nvme@lists.infradead.org \ --cc=sagi@grimberg.me \ --cc=viro@zeniv.linux.org.uk \ /path/to/YOUR_REPLY https://kernel.org/pub/software/scm/git/docs/git-send-email.html * If your mail client supports setting the In-Reply-To header via mailto: links, try the mailto: linkBe sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes, see mirroring instructions on how to clone and mirror all data and code used by this external index.