Re: [RFC v3 16/19] arch: um: make UML unflatten device tree when testing

2018-11-29 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 11:36:33AM -0800, Brendan Higgins wrote: > Make UML unflatten any present device trees when running KUnit tests. > > Signed-off-by: Brendan Higgins > --- > arch/um/kernel/um_arch.c | 4 > 1 file changed, 4 insertions(+) > > diff --git a/arch/um/kernel/um_arch.c

Re: [RFC v3 14/19] Documentation: kunit: add documentation for KUnit

2018-11-29 Thread Luis Chamberlain
On Thu, Nov 29, 2018 at 01:56:37PM +, Kieran Bingham wrote: > Hi Brendan, > > Please excuse the top posting, but I'm replying here as I'm following > the section "Creating a kunitconfig" in Documentation/kunit/start.rst. > > Could the three line kunitconfig file live under say >

Re: [RFC v3 11/19] kunit: add Python libraries for handing KUnit config and kernel

2018-11-29 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 11:36:28AM -0800, Brendan Higgins wrote: > The ultimate goal is to create minimal isolated test binaries; in the > meantime we are using UML to provide the infrastructure to run tests, so > define an abstract way to configure and run tests that allow us to > change the

Re: [RFC v3 08/19] arch: um: add shim to trap to allow installing a fault catcher for tests

2018-11-29 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 11:36:25AM -0800, Brendan Higgins wrote: > +static void segv_run_catcher(jmp_buf *catcher, void *fault_addr) > +{ > + current->thread.fault_addr = fault_addr; > + UML_LONGJMP(catcher, 1); > +} Some documentation about what this does exactly would be appreciated.

Re: [RFC v3 07/19] kunit: test: add initial tests

2018-11-29 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 11:36:24AM -0800, Brendan Higgins wrote: > Add a test for string stream along with a simpler example. > > Signed-off-by: Brendan Higgins > --- > kunit/Kconfig | 12 ++ > kunit/Makefile | 4 ++ > kunit/example-test.c | 88

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

2018-11-29 Thread Luis Chamberlain
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 using UML. > > There's nothing in this patch limiting this to UML. Not

Re: [RFC v3 08/19] arch: um: add shim to trap to allow installing a fault catcher for tests

2018-11-29 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 11:36:25AM -0800, Brendan Higgins wrote: > diff --git a/arch/um/kernel/trap.c b/arch/um/kernel/trap.c > index cced829460427..bf90e678b3d71 100644 > --- a/arch/um/kernel/trap.c > +++ b/arch/um/kernel/trap.c > @@ -201,6 +201,12 @@ void segv_handler(int sig, struct siginfo

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

2018-11-29 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 11:36:23AM -0800, Brendan Higgins wrote: > Make minimum number of changes outside of the KUnit directories for > KUnit to build and run using UML. > > Signed-off-by: Brendan Higgins > --- > Kconfig | 2 ++ > Makefile | 2 +- > 2 files changed, 3 insertions(+), 1

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

2018-11-29 Thread Luis Chamberlain
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. > > So provide a library for constructing the string as you go

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

2018-11-29 Thread Luis Chamberlain
> +static void kunit_run_case_internal(struct kunit *test, > + struct kunit_module *module, > + struct kunit_case *test_case) > +{ > + int ret; > + > + if (module->init) { > + ret = module->init(test); > +

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

2018-11-29 Thread Luis Chamberlain
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(); \ > + } \ > +

Re: [RFC v2 00/14] kunit: introduce KUnit, the Linux kernel unit testing framework

2018-11-29 Thread Luis Chamberlain
On Wed, Nov 28, 2018 at 01:50:01PM -0700, shuah wrote: > On 11/28/18 12:54 PM, Knut Omang wrote: > > On Mon, 2018-11-26 at 17:41 -0800, Brendan Higgins wrote: > > Both approaches provide assertion macros for running tests inside the > > kernel, > > I doubt the kernel community would like to see

Re: [RFC v3 17/19] of: unittest: migrate tests to run on KUnit

2018-11-29 Thread Randy Dunlap
On 11/28/18 12:56 PM, Rob Herring wrote: >> diff --git a/drivers/of/Kconfig b/drivers/of/Kconfig >> index ad3fcad4d75b8..f309399deac20 100644 >> --- a/drivers/of/Kconfig >> +++ b/drivers/of/Kconfig >> @@ -15,6 +15,7 @@ if OF >> config OF_UNITTEST >> bool "Device Tree runtime unit tests"

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

2018-11-29 Thread Dan Williams
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 entry relative to the current Xarray state to be specified. In most

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

2018-11-29 Thread Dan Williams
On Thu, Nov 29, 2018 at 1:54 PM Alexander Duyck wrote: > > On Thu, 2018-11-29 at 10:55 -0800, Dan Williams wrote: > > On Thu, Nov 29, 2018 at 10:07 AM Alexander Duyck > > wrote: > > > > > > On Wed, 2018-11-28 at 17:57 -0800, Dan Williams wrote: > > > > [..] > > > > I think the flag should be

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

2018-11-29 Thread Alexander Duyck
On Thu, 2018-11-29 at 10:55 -0800, Dan Williams wrote: > On Thu, Nov 29, 2018 at 10:07 AM Alexander Duyck > wrote: > > > > On Wed, 2018-11-28 at 17:57 -0800, Dan Williams wrote: > > [..] > > > I think the flag should be named "cancel" and set it in the > > > device_del() path. Otherwise this is

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

2018-11-29 Thread Dan Williams
On Thu, Nov 29, 2018 at 10:07 AM Alexander Duyck wrote: > > On Wed, 2018-11-28 at 17:57 -0800, Dan Williams wrote: [..] > > I think the flag should be named "cancel" and set it in the > > device_del() path. Otherwise this is encoding code flow state in the > > struct rather than device-state that

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

2018-11-29 Thread Alexander Duyck
On Wed, 2018-11-28 at 17:57 -0800, Dan Williams wrote: > On Wed, Nov 28, 2018 at 4:32 PM 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. > > > >

Re: [RFC v3 11/19] kunit: add Python libraries for handing KUnit config and kernel

2018-11-29 Thread Kieran Bingham
Hi Brendan, Thanks again for this series! On 28/11/2018 19:36, Brendan Higgins wrote: > The ultimate goal is to create minimal isolated test binaries; in the > meantime we are using UML to provide the infrastructure to run tests, so > define an abstract way to configure and run tests that allow

Re: [4.19-stable PATCH] dax: Avoid losing wakeup in dax_lock_mapping_entry

2018-11-29 Thread Greg KH
On Wed, Nov 28, 2018 at 10:53:44AM -0800, Dan Williams wrote: > From: Matthew Wilcox > > commit 25bbe21bf427a81b8e3ccd480ea0e1d940256156 upstream. > > After calling get_unlocked_entry(), you have to call > put_unlocked_entry() to avoid subsequent waiters losing wakeups. > > Fixes: c2a7d2a11552