Re: [PATCH v3 7/7] kunit: Add tests for fault

2024-04-23 Thread David Gow
On Mon, 22 Apr 2024 at 21:36, Guenter Roeck wrote: > > On 4/22/24 06:08, Mickaël Salaün wrote: > > On Fri, Apr 19, 2024 at 04:38:01PM -0700, Guenter Roeck wrote: > >> On Fri, Apr 19, 2024 at 03:33:49PM -0700, Guenter Roeck wrote: > >>> Hi, > >>> > >>> On Tue, Mar 19, 2024 at 11:48:57AM +0100,

Re: [PATCH v3 4/7] kunit: Handle test faults

2024-03-23 Thread David Gow
ad of calling kthread_complete_and_exit(). Because thread's exit > code is never checked, always set it to 0 to make it clear. > > Fix the -EINTR error message, which couldn't be reached until now. > > This is tested with a following patch. > > Cc: Brendan Higgins > Cc: Shuah Kha

Re: [PATCH v2 4/7] kunit: Handle test faults

2024-03-11 Thread David Gow
ad of calling kthread_complete_and_exit(). Because thread's exit > code is never checked, always set it to 0 to make it clear. > > Fix the -EINTR error message, which couldn't be reached until now. > > This is tested with a following patch. > > Cc: Brendan Higgins > Cc: David

Re: [PATCH v2 7/7] kunit: Add tests for fault

2024-03-11 Thread David Gow
panic. > > Tested with: > ./tools/testing/kunit/kunit.py run --arch x86_64 kunit_fault > ./tools/testing/kunit/kunit.py run --arch arm64 \ > --cross_compile=aarch64-linux-gnu- kunit_fault > > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Cc: Shuah Khan > Signed-off-

Re: [PATCH v2 6/7] kunit: Print last test location on fault

2024-03-11 Thread David Gow
On Sat, 2 Mar 2024 at 03:40, Mickaël Salaün wrote: > > This helps identify the location of test faults. > > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Cc: Shuah Khan > Reviewed-by: Kees Cook > Signed-off-by: Mickaël Salaün > Link: https://lore.kernel

Re: [PATCH v2 5/7] kunit: Fix KUNIT_SUCCESS() calls in iov_iter tests

2024-03-11 Thread David Gow
On Sat, 2 Mar 2024 at 03:40, Mickaël Salaün wrote: > > Fix KUNIT_SUCCESS() calls to pass a test argument. > > This is a no-op for now because this macro does nothing, but it will be > required for the next commit. > > Cc: Brendan Higgins > Cc: David Gow > Cc:

Re: [PATCH v2 3/7] kunit: Fix timeout message

2024-03-11 Thread David Gow
On Sat, 2 Mar 2024 at 03:40, Mickaël Salaün wrote: > > The exit code is always checked, so let's properly handle the -ETIMEDOUT > error code. > > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Cc: Shuah Khan > Reviewed-by: Kees Cook > Signed-off-by:

Re: [PATCH v2 2/7] kunit: Fix kthread reference

2024-03-11 Thread David Gow
On Sat, 2 Mar 2024 at 03:40, Mickaël Salaün wrote: > > There is a race condition when a kthread finishes after the deadline and > before the call to kthread_stop(), which may lead to use after free. > > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Cc: Shuah K

Re: [PATCH v2 1/7] kunit: Handle thread creation error

2024-03-11 Thread David Gow
; code returned by kthread_run(), which will mark the test as failed and > print "internal error occurred...". > > Cc: Brendan Higgins > Cc: David Gow > Cc: Rae Moar > Cc: Shuah Khan > Reviewed-by: Kees Cook > Signed-off-by: Mickaël Salaün > Link: https://lore.

Re: [PATCH v1 0/8] Run KUnit tests late and handle faults

2024-02-29 Thread David Gow
On Fri, 1 Mar 2024 at 01:04, Mickaël Salaün wrote: > > Hi, > Thanks very much. I think there's a lot going on in this series, and it'd probably be easier to address if it were broken up a bit more. To take things one at a time: > This patch series moves KUnit test execution at the very end of

Re: [PATCH v1 1/8] kunit: Run tests when the kernel is fully setup

2024-02-29 Thread David Gow
4 kunit_run_all_tests+0x88/0x154 kernel_init+0x6c/0x1e0 ret_from_fork+0x10/0x20 Code: b25f7be1 aa0003f4 d34cfe73 8b131833 (f9400661) ---[ end trace ]--- Kernel panic - not syncing: Attempted to kill init! exitcode=0x000b > > Cc: Alan Maguire > Cc: Brendan Higgins &g