Re: [RFC v3 06/19] arch: um: enable running kunit from User Mode Linux

2018-11-30 Thread Rob Herring
On Thu, Nov 29, 2018 at 9:37 PM Luis Chamberlain wrote: > > On Wed, Nov 28, 2018 at 03:26:03PM -0600, Rob Herring wrote: > > On Wed, Nov 28, 2018 at 1:37 PM Brendan Higgins > > wrote: > > > > > > Make minimum number of changes outside of the KUnit directories for > > > KUnit to build and run usin

Re: [PATCH] dax: Fix Xarray conversion of dax_unlock_mapping_entry()

2018-11-30 Thread Matthew Wilcox
On Thu, Nov 29, 2018 at 04:13:46PM -0800, Dan Williams wrote: > Internal to dax_unlock_mapping_entry(), dax_unlock_entry() is used to > store a replacement entry in the Xarray at the given xas-index with the > DAX_LOCKED bit clear. When called, dax_unlock_entry() expects the unlocked > value of the

Re: [PATCH] dax: Fix Xarray conversion of dax_unlock_mapping_entry()

2018-11-30 Thread Dan Williams
On Fri, Nov 30, 2018 at 7:49 AM Matthew Wilcox wrote: > > On Thu, Nov 29, 2018 at 04:13:46PM -0800, Dan Williams wrote: > > Internal to dax_unlock_mapping_entry(), dax_unlock_entry() is used to > > store a replacement entry in the Xarray at the given xas-index with the > > DAX_LOCKED bit clear. Wh

Re: [PATCH] dax: Fix Xarray conversion of dax_unlock_mapping_entry()

2018-11-30 Thread Matthew Wilcox
On Fri, Nov 30, 2018 at 07:54:49AM -0800, Dan Williams wrote: > Looks good to me, although can we make that cookie an actual type? I > think it's mostly ok to pass around (void *) for 'entry' inside of > fs/dax.c, but once an entry leaves that file I'd like it to have an > explicit type to catch pe

Re: [PATCH] dax: Fix Xarray conversion of dax_unlock_mapping_entry()

2018-11-30 Thread Dan Williams
On Fri, Nov 30, 2018 at 8:24 AM Matthew Wilcox wrote: > > On Fri, Nov 30, 2018 at 07:54:49AM -0800, Dan Williams wrote: > > Looks good to me, although can we make that cookie an actual type? I > > think it's mostly ok to pass around (void *) for 'entry' inside of > > fs/dax.c, but once an entry le

Re: [PATCH] dax: Fix Xarray conversion of dax_unlock_mapping_entry()

2018-11-30 Thread Dan Williams
On Fri, Nov 30, 2018 at 8:33 AM Dan Williams wrote: > > On Fri, Nov 30, 2018 at 8:24 AM Matthew Wilcox wrote: > > > > On Fri, Nov 30, 2018 at 07:54:49AM -0800, Dan Williams wrote: > > > Looks good to me, although can we make that cookie an actual type? I > > > think it's mostly ok to pass around

Re: [RFC v3 06/19] arch: um: enable running kunit from User Mode Linux

2018-11-30 Thread Luis Chamberlain
On Fri, Nov 30, 2018 at 08:05:34AM -0600, Rob Herring wrote: > On Thu, Nov 29, 2018 at 9:37 PM Luis Chamberlain wrote: > > > > On Wed, Nov 28, 2018 at 03:26:03PM -0600, Rob Herring wrote: > > > On Wed, Nov 28, 2018 at 1:37 PM Brendan Higgins > > > wrote: > > > > > > > > Make minimum number of cha

Re: [PATCH] dax: Fix Xarray conversion of dax_unlock_mapping_entry()

2018-11-30 Thread Matthew Wilcox
On Fri, Nov 30, 2018 at 09:01:07AM -0800, Dan Williams wrote: > On Fri, Nov 30, 2018 at 8:33 AM Dan Williams wrote: > > > > On Fri, Nov 30, 2018 at 8:24 AM Matthew Wilcox wrote: > > > > > > On Fri, Nov 30, 2018 at 07:54:49AM -0800, Dan Williams wrote: > > > > Looks good to me, although can we mak

Re: [PATCH] dax: Fix Xarray conversion of dax_unlock_mapping_entry()

2018-11-30 Thread Dan Williams
On Fri, Nov 30, 2018 at 11:50 AM Matthew Wilcox wrote: > > On Fri, Nov 30, 2018 at 09:01:07AM -0800, Dan Williams wrote: > > On Fri, Nov 30, 2018 at 8:33 AM Dan Williams > > wrote: > > > > > > On Fri, Nov 30, 2018 at 8:24 AM Matthew Wilcox > > > wrote: > > > > > > > > On Fri, Nov 30, 2018 at 0

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

2018-11-30 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

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

2018-11-30 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 ++- Documentation/ndctl/ndctl-freeze-sec

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

2018-11-30 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 secur

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

2018-11-30 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 | 35 ++

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

2018-11-30 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 | 191 ++ 2 files changed, 195 insertions(+) create mode 100755 test/security.sh diff --

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

2018-11-30 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 | 32 ++

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

2018-11-30 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 ++ Documentation/ndctl/ndctl-disable-passphra

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

2018-11-30 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. Signed-off-

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

2018-11-30 Thread Dave Jiang
Adding a monitoring command to ndctl in order to wait on the progress of overwrite. Signed-off-by: Dave Jiang --- Documentation/ndctl/Makefile.am |3 + Documentation/ndctl/ndctl-wait-overwrite.txt | 31 ++ builtin.h|1 ndctl/dim

[PATCH v5 07/12] ndctl: setup modprobe rules

2018-11-30 Thread Dave Jiang
Adding reference config file for modprobe.d in order to trigger the reference script that will inject keys associated with the nvdimms into the kernel user ring for unlock. Signed-off-by: Dave Jiang --- Makefile.am | 10 ++ contrib/ndctl-loadkeys.sh| 24 +

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

2018-11-30 Thread Dave Jiang
Adding the theory of operation for Intel DSM operations. Signed-off-by: Dave Jiang --- Documentation/ndctl/intel-nvdimm-security.txt| 129 ++ Documentation/ndctl/ndctl-disable-passphrase.txt |2 Documentation/ndctl/ndctl-enable-passphrase.txt |2 Documentation

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

2018-11-30 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 v5 11/12] ndctl: add master secure erase support

2018-11-30 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

[mm PATCH v6 4/7] mm: Initialize MAX_ORDER_NR_PAGES at a time instead of doing larger sections

2018-11-30 Thread Alexander Duyck
Add yet another iterator, for_each_free_mem_range_in_zone_from, and then use it to support initializing and freeing pages in groups no larger than MAX_ORDER_NR_PAGES. By doing this we can greatly improve the cache locality of the pages while we do several loops over them in the init and freeing pro

[mm PATCH v6 1/7] mm: Use mm_zero_struct_page from SPARC on all 64b architectures

2018-11-30 Thread Alexander Duyck
Use the same approach that was already in use on Sparc on all the architectures that support a 64b long. This is mostly motivated by the fact that 7 to 10 store/move instructions are likely always going to be faster than having to call into a function that is not specialized for handling page init

[mm PATCH v6 0/7] Deferred page init improvements

2018-11-30 Thread Alexander Duyck
This patchset is essentially a refactor of the page initialization logic that is meant to provide for better code reuse while providing a significant improvement in deferred page initialization performance. In my testing on an x86_64 system with 384GB of RAM and 3TB of persistent memory per node I

[mm PATCH v6 5/7] mm: Move hot-plug specific memory init into separate functions and optimize

2018-11-30 Thread Alexander Duyck
Combine the bits in memmap_init_zone and memmap_init_zone_device that are related to hotplug into a single function called __memmap_init_hotplug. Also take the opportunity to integrate __init_single_page's functionality into this function. In doing so we can get rid of some of the redundancy such

[mm PATCH v6 6/7] mm: Add reserved flag setting to set_page_links

2018-11-30 Thread Alexander Duyck
Modify the set_page_links function to include the setting of the reserved flag via a simple AND and OR operation. The motivation for this is the fact that the existing __set_bit call still seems to have effects on performance as replacing the call with the AND and OR can reduce initialization time.

[mm PATCH v6 2/7] mm: Drop meminit_pfn_in_nid as it is redundant

2018-11-30 Thread Alexander Duyck
As best as I can tell the meminit_pfn_in_nid call is completely redundant. The deferred memory initialization is already making use of for_each_free_mem_range which in turn will call into __next_mem_range which will only return a memory range if it matches the node ID provided assuming it is not NU

[mm PATCH v6 3/7] mm: Implement new zone specific memblock iterator

2018-11-30 Thread Alexander Duyck
Introduce a new iterator for_each_free_mem_pfn_range_in_zone. This iterator will take care of making sure a given memory range provided is in fact contained within a zone. It takes are of all the bounds checking we were doing in deferred_grow_zone, and deferred_init_memmap. In addition it should h

[mm PATCH v6 7/7] mm: Use common iterator for deferred_init_pages and deferred_free_pages

2018-11-30 Thread Alexander Duyck
Create a common iterator to be used by both deferred_init_pages and deferred_free_pages. By doing this we can cut down a bit on code overhead as they will likely both be inlined into the same function anyway. This new approach allows deferred_init_pages to make use of __init_pageblock. By doing th

Re: [driver-core PATCH v7 1/9] driver core: Move async_synchronize_full call

2018-11-30 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 04:32:11PM -0800, Alexander Duyck wrote: > Move the async_synchronize_full call out of __device_release_driver and > into driver_detach. > > The idea behind this is that the async_synchronize_full call will only > guarantee that any existing async operations are flushed. Th

Re: [driver-core PATCH v7 2/9] driver core: Establish clear order of operations for deferred probe and remove

2018-11-30 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 04:32:16PM -0800, Alexander Duyck wrote: > Add an additional bit flag to the device struct named async_probe. This > additional flag allows us to guarantee ordering between probe and remove > operations. > > This allows us to guarantee that if we execute a remove operation

Re: [driver-core PATCH v7 3/9] device core: Consolidate locking and unlocking of parent and device

2018-11-30 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 04:32:21PM -0800, Alexander Duyck wrote: > Try to consolidate all of the locking and unlocking of both the parent and > device when attaching or removing a driver from a given device. > > To do that I first consolidated the lock pattern into two functions > __device_driver_

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-11-30 Thread Brendan Higgins
On Thu, Nov 29, 2018 at 7:14 PM Luis Chamberlain wrote: > > On Wed, Nov 28, 2018 at 11:36:18AM -0800, Brendan Higgins wrote: > > +#define module_test(module) \ > > + static int module_kunit_init##module(void) \ > > + { \ > > + return kunit_run_tests(&mod

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-11-30 Thread Brendan Higgins
On Thu, Nov 29, 2018 at 7:28 PM Luis Chamberlain wrote: > > > +static void kunit_run_case_internal(struct kunit *test, > > + struct kunit_module *module, > > + struct kunit_case *test_case) > > +{ > > + int ret; > > + > > + if

Re: [RFC v3 03/19] kunit: test: add string_stream a std::stream like string builder

2018-11-30 Thread Brendan Higgins
On Thu, Nov 29, 2018 at 7:29 PM Luis Chamberlain wrote: > > On Wed, Nov 28, 2018 at 11:36:20AM -0800, Brendan Higgins wrote: > > A number of test features need to do pretty complicated string printing > > where it may not be possible to rely on a single preallocated string > > with parameters. > >

Re: [driver-core PATCH v7 4/9] driver core: Probe devices asynchronously instead of the driver

2018-11-30 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 04:32:26PM -0800, Alexander Duyck wrote: > Probe devices asynchronously instead of the driver. > +static void __driver_attach_async_helper(void *_dev, async_cookie_t cookie) > +{ > + struct device *dev = _dev; > + struct device_driver *drv; > + > + __device_driv

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-11-30 Thread Luis Chamberlain
On Fri, Nov 30, 2018 at 05:51:11PM -0800, Brendan Higgins wrote: > On Thu, Nov 29, 2018 at 7:14 PM Luis Chamberlain wrote: > > > > On Wed, Nov 28, 2018 at 11:36:18AM -0800, Brendan Higgins wrote: > > > +#define module_test(module) \ > > > + static int module_kunit_init##module(void) \

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-11-30 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 11:36:18AM -0800, Brendan Higgins wrote: > +int kunit_run_tests(struct kunit_module *module) > +{ > + bool all_passed = true, success; > + struct kunit_case *test_case; > + struct kunit test; > + int ret; > + > + ret = kunit_init_test(&test, module->name)

Re: [RFC v3 01/19] kunit: test: add KUnit test runner core

2018-11-30 Thread Luis Chamberlain
On Fri, Nov 30, 2018 at 06:08:36PM -0800, Brendan Higgins wrote: > On Thu, Nov 29, 2018 at 7:28 PM Luis Chamberlain wrote: > > > > > +static void kunit_run_case_internal(struct kunit *test, > > > + struct kunit_module *module, > > > +

Re: [RFC v3 03/19] kunit: test: add string_stream a std::stream like string builder

2018-11-30 Thread Luis Chamberlain
On Fri, Nov 30, 2018 at 06:14:17PM -0800, Brendan Higgins wrote: > On Thu, Nov 29, 2018 at 7:29 PM Luis Chamberlain wrote: > > > > On Wed, Nov 28, 2018 at 11:36:20AM -0800, Brendan Higgins wrote: > > > A number of test features need to do pretty complicated string printing > > > where it may not b