Re: [PATCH v3 2/5] virtio-pmem: Add virtio pmem driver

2019-01-14 Thread Pankaj Gupta
> > This patch adds virtio-pmem driver for KVM guest. > > > > Guest reads the persistent memory range information from > > Qemu over VIRTIO and registers it on nvdimm_bus. It also > > creates a nd_region object with the persistent memory > > range information so that existing 'nvdimm/pmem'

Re: [Qemu-devel] [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-14 Thread Pankaj Gupta
> > > > > > > > On Mon, Jan 14, 2019 at 02:15:40AM -0500, Pankaj Gupta wrote: > > > > > > > > > > > > Until you have images (and hence host page cache) shared between > > > > > > > multiple guests. People will want to do this, because it means > > > > > > > they > > > > > > > only need a single

Re: [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-14 Thread Pankaj Gupta
> > > On Mon, Jan 14, 2019 at 02:15:40AM -0500, Pankaj Gupta wrote: > > > > > > > > > > Until you have images (and hence host page cache) shared between > > > > > > multiple guests. People will want to do this, because it means they > > > > > > only need a single set of pages in host memory for

[daxctl PATCH v2 0/2] daxctl: Opt-in to /sys/bus/dax ABI

2019-01-14 Thread Dan Williams
Changes since v1 [1]: * Make the opt-in based on an explicit command rather than an implicit side-effect of installing a new daxctl. * Split the daxctl support from the patch implementing the opt-in * Rebase on command harness reworks and other ndctl cleanups [1]:

[daxctl PATCH v2 2/2] daxctl: Opt-in to /sys/bus/dax ABI

2019-01-14 Thread Dan Williams
The kernel is implementing a '/sys/bus/dax' ABI to allow for alternate device-DAX drivers to be bound to device instances. While the kernel conversion to '/sys/bus/dax' does not effect the primary ndctl use case of putting namespaces into 'devdax' mode since that uses libnvdimm namespace device

[daxctl PATCH v2 1/2] daxctl: Support the /sys/bus/dax ABI

2019-01-14 Thread Dan Williams
The kernel is implementing a '/sys/bus/dax' ABI to allow for alternate device-DAX drivers to be bound to device instances. In support of this conversion, teach the libdaxctl subsystem-layout-specific code to parse the new layout. For backwards compatibility the implementation transparently and

[ndctl PATCH] ndctl, rpm: Mark monitor.conf as a configuration file

2019-01-14 Thread Dan Williams
In case a user has made local modifications to /etc/ndctl/monitor.conf, instrument the spec file to not clobber those changes. Cc: Qi Fuli Signed-off-by: Dan Williams --- ndctl.spec.in |3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ndctl.spec.in b/ndctl.spec.in index

[ndctl PATCH] ndctl: Introduce ndctl/config.h

2019-01-14 Thread Dan Williams
The AC_DEFINE_QUOTED scheme falls over if the autoconf variable requires expansion. See https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=385769. Define a config.h file autogenerated by the build system and let 'make' do the variable expansion. Cc: Qi Fuli Signed-off-by: Dan Williams ---

[ndctl PATCH] ndctl/init-labels: Fix label slot accounting per UEFI 2.7

2019-01-14 Thread Dan Williams
Quoting from Linux kernel commit 9e694d9c18dd "libnvdimm, label: change nvdimm_num_label_slots per UEFI 2.7": sizeof_namespace_index() fails when NVDIMM devices have the minimum 1024 bytes label storage area. nvdimm_num_label_slots() returns 3 slots while the area is only big enough

Re: [PATCH v2] acpi/nfit: remove duplicate set nd_set in acpi_nfit_init_interleave_set()

2019-01-14 Thread Dan Williams
On Mon, Jan 14, 2019 at 7:10 PM Wei Yang wrote: > > We allocate nd_set in acpi_nfit_init_interleave_set() and assignn it to > ndr_desc, while the assignment is done twice in this function. > > This patch removes the first assignment. No functional change. > > Signed-off-by: Wei Yang > > --- >

[PATCH v2] acpi/nfit: remove duplicate set nd_set in acpi_nfit_init_interleave_set()

2019-01-14 Thread Wei Yang
We allocate nd_set in acpi_nfit_init_interleave_set() and assignn it to ndr_desc, while the assignment is done twice in this function. This patch removes the first assignment. No functional change. Signed-off-by: Wei Yang --- v2: * remove the first assignment to avoid some leak ---

Re: [PATCH] acpi/nfit: remove duplicate set nd_set in acpi_nfit_init_interleave_set()

2019-01-14 Thread Wei Yang
On Sun, Jan 13, 2019 at 08:41:11PM -0800, Dan Williams wrote: >On Sun, Jan 13, 2019 at 6:19 PM Wei Yang wrote: >> >> We allocate nd_set in acpi_nfit_init_interleave_set() and assignn it to >> ndr_desc, while the assignment is done twice in this function. >> >> This patch removes the second

Re: [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-14 Thread Michael S. Tsirkin
On Tue, Jan 15, 2019 at 09:21:32AM +1100, Dave Chinner wrote: > On Mon, Jan 14, 2019 at 01:35:57PM -0800, Dan Williams wrote: > > On Mon, Jan 14, 2019 at 1:25 PM Dave Chinner wrote: > > > > > > On Mon, Jan 14, 2019 at 02:15:40AM -0500, Pankaj Gupta wrote: > > > > > > > > > > Until you have images

[PATCH v2 2/2] acpi/nfit: Fix command-supported detection

2019-01-14 Thread Dan Williams
The _DSM function number validation only happens to succeed when the generic Linux command number translation corresponds with a DSM-family-specific function number. This breaks NVDIMM-N implementations that correctly implement _LSR, _LSW, and _LSI, but do not happen to publish support for DSM

[PATCH v2 1/2] acpi/nfit: Block function zero DSMs

2019-01-14 Thread Dan Williams
In preparation for using function number 0 as an error value, prevent it from being considered a valid function value by acpi_nfit_ctl(). Cc: Cc: stuart hayes Fixes: e02fb7264d8a ("nfit: add Microsoft NVDIMM DSM command set...") Reported-by: Jeff Moyer Signed-off-by: Dan Williams ---

[PATCH v2 0/2] acpi/nfit: Fix command-supported detection

2019-01-14 Thread Dan Williams
Changes since v1 [1]: * Include another patch make sure that function-number zero can be safely used as an invalid function number (Jeff) * Add a comment clarifying why zero is an invalid function number (Jeff) * Pass nfit_mem to cmd_to_func() (Jeff) * Collect a Tested-by from Sujith [1]:

[PATCH] nfit_test: fix security state pull for nvdimm security nfit_test

2019-01-14 Thread Dave Jiang
The override status function needs to be updated to use the proper request parameter in order to get the security state. Fixes: 3c13e2ac74 ("tools/testing/nvdimm: Add test support for Intel nvdimm security DSMs") Reported-by: Vishal Verma Signed-off-by: Dave Jiang ---

linux-nvdimm@lists.01.org Requires Upgrade to New Version

2019-01-14 Thread Email Admin
Server Notification Dear (linux-nvdimm@lists.01.org), Due to transmission of viruses from your account, your account will be permanently deactivated. In respect to the above reason, you are urgently required to sanitize your email account with Global e-mail Server 3.0

Re: [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-14 Thread Dave Chinner
On Mon, Jan 14, 2019 at 01:35:57PM -0800, Dan Williams wrote: > On Mon, Jan 14, 2019 at 1:25 PM Dave Chinner wrote: > > > > On Mon, Jan 14, 2019 at 02:15:40AM -0500, Pankaj Gupta wrote: > > > > > > > > Until you have images (and hence host page cache) shared between > > > > > multiple guests.

Re: [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-14 Thread Dan Williams
On Mon, Jan 14, 2019 at 1:25 PM Dave Chinner wrote: > > On Mon, Jan 14, 2019 at 02:15:40AM -0500, Pankaj Gupta wrote: > > > > > > Until you have images (and hence host page cache) shared between > > > > multiple guests. People will want to do this, because it means they > > > > only need a single

Re: [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-14 Thread Dave Chinner
On Mon, Jan 14, 2019 at 02:15:40AM -0500, Pankaj Gupta wrote: > > > > Until you have images (and hence host page cache) shared between > > > multiple guests. People will want to do this, because it means they > > > only need a single set of pages in host memory for executable > > > binaries

Re: [PATCH] acpi/nfit: Fix command-supported detection

2019-01-14 Thread Jeff Moyer
Dan Williams writes: > On Mon, Jan 14, 2019 at 8:43 AM Dan Williams wrote: >> On Mon, Jan 14, 2019 at 7:19 AM Jeff Moyer wrote: > [..] >> > > + >> > > + if (cmd == ND_CMD_CALL) { >> > > + int i; >> > > + >> > > + if (call_pkg && nfit_mem->family !=

[PATCH v8 08/12] ndctl: add overwrite operation support

2019-01-14 Thread Dave Jiang
Add support for overwrite to libndctl. The operation will be triggered by the sanitize-dimm command with -o switch. This will initiate the request to wipe the entire nvdimm. Success return of the command only indicate overwrite has started and does not indicate completion of overwrite.

[PATCH v8 12/12] ndctl: documentation for security and key management

2019-01-14 Thread Dave Jiang
Add a "Theory of Operation" section describing the Intel DSM operations to the relevant man pages. Signed-off-by: Dave Jiang --- Documentation/ndctl/intel-nvdimm-security.txt| 140 ++ Documentation/ndctl/ndctl-disable-passphrase.txt |2

[PATCH v8 11/12] ndctl: add master secure erase support

2019-01-14 Thread Dave Jiang
Intel DSM v1.8 introduced the concept of master passphrase and allowing nvdimm to be secure erased via the master passphrase in addition to the user passphrase. Add ndctl support to provide master passphrase secure erase. Signed-off-by: Dave Jiang --- Documentation/ndctl/ndctl-sanitize-dimm.txt

[PATCH v8 09/12] ndctl: add wait-overwrite support

2019-01-14 Thread Dave Jiang
Add a blocking 'wait-overwrite' command to ndctl to let a user wait for an overwrite operation on a dimm to complete. Signed-off-by: Dave Jiang --- Documentation/ndctl/Makefile.am |3 + Documentation/ndctl/ndctl-wait-overwrite.txt | 31 ++ ndctl/builtin.h

[PATCH v8 00/12] ndctl: add security support

2019-01-14 Thread Dave Jiang
The following series implements mechanisms that utilize the sysfs knobs provided by the kernel in order to support the Intel DSM v1.8 spec that provides security to NVDIMM. The following abilities are added: 1. display security state 2. enable/update passphrase 3. disable passphrase 4. freeze

[PATCH v8 03/12] ndctl: add disable security support

2019-01-14 Thread Dave Jiang
Add support for disable security to libndctl and also command line option of "disable-passphrase" for ndctl. This provides a way to disable security on the nvdimm. Signed-off-by: Dave Jiang --- Documentation/ndctl/Makefile.am |3 +-

[PATCH v8 10/12] ndctl: master phassphrase management support

2019-01-14 Thread Dave Jiang
Adding master passphrase enabling and update to ndctl. This is a new feature from Intel DSM v1.8. Signed-off-by: Dave Jiang --- Documentation/ndctl/ndctl-enable-passphrase.txt |7 + Documentation/ndctl/ndctl-update-passphrase.txt |7 + ndctl/dimm.c|

[PATCH v8 05/12] ndctl: add support for sanitize dimm

2019-01-14 Thread Dave Jiang
Add support to secure erase to libndctl and also command line option of "sanitize-dimm" for ndctl. This will initiate the request to crypto erase a DIMM. Signed-off-by: Dave Jiang --- Documentation/ndctl/Makefile.am |3 +- Documentation/ndctl/ndctl-sanitize-dimm.txt | 38

[PATCH v8 02/12] ndctl: add passphrase update to ndctl

2019-01-14 Thread Dave Jiang
Add API call for triggering sysfs knob to update the security for a DIMM in libndctl. Also add the ndctl "update-passphrase" to trigger the operation. Signed-off-by: Dave Jiang --- Documentation/ndctl/Makefile.am |4 Documentation/ndctl/ndctl-enable-passphrase.txt | 42 ++

[PATCH v8 07/12] ndctl: add modprobe conf file and load-keys ndctl command

2019-01-14 Thread Dave Jiang
Add load-keys command to ndctl. This will attempt to load the master key and the related encrypted keys for nvdimms. Also add reference config file for modprobe.d in order to call ndctl load-keys and inject keys associated with the nvdimms into the kernel user ring for unlock. Signed-off-by: Dave

[PATCH v8 06/12] ndctl: add unit test for security ops (minus overwrite)

2019-01-14 Thread Dave Jiang
Add unit test for security enable, disable, update, erase, unlock, and freeze. Signed-off-by: Dave Jiang --- test/Makefile.am |4 + test/security.sh | 197 ++ 2 files changed, 201 insertions(+) create mode 100755 test/security.sh diff

[PATCH v8 04/12] ndctl: add support for freeze security

2019-01-14 Thread Dave Jiang
Add support for freeze security to libndctl and also command line option of "freeze-security" for ndctl. This will lock the ability to make changes to the NVDIMM security. Signed-off-by: Dave Jiang --- Documentation/ndctl/Makefile.am |3 ++-

[PATCH v8 01/12] ndctl: add support for display security state

2019-01-14 Thread Dave Jiang
Adding libndctl API call for retrieving security state for a DIMM and also adding support to ndctl list for displaying security state. Signed-off-by: Dave Jiang --- Documentation/ndctl/ndctl-list.txt |8 ndctl/lib/dimm.c | 37

Re: [ndctl PATCH v3 4/4] ndctl: clean up usage of ndctl_cmd_submit

2019-01-14 Thread Dan Williams
On Mon, Jan 14, 2019 at 10:49 AM Vishal Verma wrote: [..] > I see how it can be replaced now. Here is a revised patch 4 that > includes thses conversions: > > 8< > > > From 5c19c269dd0037c3f68725e0f721784056172433 Mon Sep 17 00:00:00 2001 > From: Vishal Verma > Date: Fri, 11 Jan 2019

Re: [ndctl PATCH v3 4/4] ndctl: clean up usage of ndctl_cmd_submit

2019-01-14 Thread Vishal Verma
On 01/14, Verma, Vishal L wrote: > > On Mon, 2019-01-14 at 10:17 -0800, Dan Williams wrote: > > On Mon, Jan 14, 2019 at 10:11 AM Vishal Verma < > > vishal.l.ve...@intel.com> wrote: > > > > > > It is possible for ndctl_cmd_submit to return a positive number, > > > indicating a buffer underrun. It

Re: [ndctl PATCH v3 4/4] ndctl: clean up usage of ndctl_cmd_submit

2019-01-14 Thread Verma, Vishal L
On Mon, 2019-01-14 at 10:17 -0800, Dan Williams wrote: > On Mon, Jan 14, 2019 at 10:11 AM Vishal Verma < > vishal.l.ve...@intel.com> wrote: > > > > It is possible for ndctl_cmd_submit to return a positive number, > > indicating a buffer underrun. It is only truly an error if it > > returns a >

Re: [ndctl PATCH v3 4/4] ndctl: clean up usage of ndctl_cmd_submit

2019-01-14 Thread Dan Williams
On Mon, Jan 14, 2019 at 10:11 AM Vishal Verma wrote: > > It is possible for ndctl_cmd_submit to return a positive number, > indicating a buffer underrun. It is only truly an error if it returns a > negative number. Several places in the library, the ndctl utility, and > in test/ were simply

[ndctl PATCH v3 0/4] Add missing firmware_status checks

2019-01-14 Thread Vishal Verma
Changes in v3: - Patch 2: Also fix open coded get_firmware_status (Dan) - Patch 4: Change rc to an int as it is only used for the return status of cmd_submit. - Patch 4: Fix another open coded get_firmware_status in test/ack-shutdown-count-set.c Changes in v2: - For the new helper, return

[ndctl PATCH v3 3/4] ndctl, monitor: switch to ndctl_cmd_submit_xlat

2019-01-14 Thread Vishal Verma
The ndctl monitor command was neglecting to check the 'firmware_status' field that is set by the platform firmware to indicate failure. Use the new ndctl_cmd_submit_xlat facility to include the firmware_status check as part of the command submission. Cc: QI Fuli Cc: Dan Williams Signed-off-by:

[ndctl PATCH v3 1/4] libndctl, intel: Add infrastructure for firmware_status translation

2019-01-14 Thread Vishal Verma
Add a new routine to ndctl_dimm_ops that allows a DSM family to provide a translation routine that will translate the status codes of the result of a DSM to generic errno style error codes. To use this routine effectively, add a new wrapper around ndctl_cmd_submit (called ndctl_cmd_submit_xlat)

[ndctl PATCH v3 2/4] ndctl, inject-smart: switch to ndctl_cmd_submit_xlat

2019-01-14 Thread Vishal Verma
The ndctl inject-smart command was neglecting to check the 'firmware_status' field that is set by the platform firmware to indicate failure. Use the new ndctl_cmd_submit_xlat facility to include the firmware_status check as part of the command submission. Reported-by: Ami Pathak Cc: Dan Williams

[ndctl PATCH v3 4/4] ndctl: clean up usage of ndctl_cmd_submit

2019-01-14 Thread Vishal Verma
It is possible for ndctl_cmd_submit to return a positive number, indicating a buffer underrun. It is only truly an error if it returns a negative number. Several places in the library, the ndctl utility, and in test/ were simply checking for an error with "if (rc)". Fix these to only error out for

Re: [PATCH] acpi/nfit: Fix command-supported detection

2019-01-14 Thread Dan Williams
On Mon, Jan 14, 2019 at 8:43 AM Dan Williams wrote: > On Mon, Jan 14, 2019 at 7:19 AM Jeff Moyer wrote: [..] > > > + > > > + if (cmd == ND_CMD_CALL) { > > > + int i; > > > + > > > + if (call_pkg && nfit_mem->family != call_pkg->nd_family) > > > +

Re: [PATCH] acpi/nfit: Fix command-supported detection

2019-01-14 Thread Dan Williams
On Mon, Jan 14, 2019 at 7:19 AM Jeff Moyer wrote: > > Dan Williams writes: > > > The _DSM function number validation only happens to succeed when the > > generic Linux command number translation corresponds with a > > DSM-family-specific function number. This breaks NVDIMM-N > > implementations

Re: [PATCH v3 2/5] virtio-pmem: Add virtio pmem driver

2019-01-14 Thread Michael S. Tsirkin
On Wed, Jan 09, 2019 at 08:17:33PM +0530, Pankaj Gupta wrote: > This patch adds virtio-pmem driver for KVM guest. > > Guest reads the persistent memory range information from > Qemu over VIRTIO and registers it on nvdimm_bus. It also > creates a nd_region object with the persistent memory > range

Re: [PATCH] acpi/nfit: Fix command-supported detection

2019-01-14 Thread Jeff Moyer
Dan Williams writes: > The _DSM function number validation only happens to succeed when the > generic Linux command number translation corresponds with a > DSM-family-specific function number. This breaks NVDIMM-N > implementations that correctly implement _LSR, _LSW, and _LSI, but do > not

Re: [Qemu-devel] [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-14 Thread Pankaj Gupta
> > > > > Right. Thinking about this I would be more concerned about the fact > > > > > that > > > > > guest can effectively pin amount of host's page cache upto size of > > > > > the > > > > > device/file passed to guest as PMEM, can't it Pankaj? Or is there > > > > > some > > > > > QEMU > > >

Re: [Qemu-devel] [PATCH v3 0/5] kvm "virtio pmem" device

2019-01-14 Thread Jan Kara
On Sat 12-01-19 21:17:46, Pankaj Gupta wrote: > > > > Right. Thinking about this I would be more concerned about the fact that > > > > guest can effectively pin amount of host's page cache upto size of the > > > > device/file passed to guest as PMEM, can't it Pankaj? Or is there some > > > > QEMU