summaryrefslogtreecommitdiff
path: root/init
diff options
context:
space:
mode:
authorBrendan Higgins <brendanhiggins@google.com>2020-08-04 23:47:43 +0300
committerShuah Khan <skhan@linuxfoundation.org>2020-10-09 23:37:43 +0300
commit8c0d884986ba22f1020be9c02e41c030890ee8f2 (patch)
tree584279bf3ffd79e30f3ed99519e70931dc8c9543 /init
parentaac35468ca20a3a0e75a24c13c0e31610727f120 (diff)
downloadlinux-8c0d884986ba22f1020be9c02e41c030890ee8f2.tar.xz
init: main: add KUnit to kernel init
Although we have not seen any actual examples where KUnit doesn't work because it runs in the late init phase of the kernel, it has been a concern for some time that this could potentially be an issue in the future. So, remove KUnit from init calls entirely, instead call directly from kernel_init() so that KUnit runs after late init. Co-developed-by: Alan Maguire <alan.maguire@oracle.com> Signed-off-by: Alan Maguire <alan.maguire@oracle.com> Signed-off-by: Brendan Higgins <brendanhiggins@google.com> Reviewed-by: Stephen Boyd <sboyd@kernel.org> Reviewed-by: Kees Cook <keescook@chromium.org> Reviewed-by: Luis Chamberlain <mcgrof@kernel.org> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
Diffstat (limited to 'init')
-rw-r--r--init/main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/init/main.c b/init/main.c
index ae78fb68d231..232c8df465ee 100644
--- a/init/main.c
+++ b/init/main.c
@@ -107,6 +107,8 @@
#define CREATE_TRACE_POINTS
#include <trace/events/initcall.h>
+#include <kunit/test.h>
+
static int kernel_init(void *);
extern void init_IRQ(void);
@@ -1511,6 +1513,8 @@ static noinline void __init kernel_init_freeable(void)
do_basic_setup();
+ kunit_run_all_tests();
+
console_on_rootfs();
/*