Skip to content
Permalink
Browse files
KVM: arm64: Add kunit test for ID register validation
Add kunit tests for functions that are used for validation of ID
registers and CONFIG_KVM_KUNIT_TEST option to enable the tests.

Since those tests only cover ID register validation so far, only
a few lines of change are needed in the default arm64.py to run
all of those tests as follows.
-----------------------------------------------------------------------
$ diff tools/testing/kunit/qemu_configs/arm64.py arm64_kvm_min.py
4a5,7
> CONFIG_VIRTUALIZATION=y
> CONFIG_KVM=y
> CONFIG_KVM_KUNIT_TEST=y
12c15
< 			   extra_qemu_params=['-machine virt', '-cpu cortex-a57'])
  • Loading branch information
reijiw-kvm authored and intel-lab-lkp committed Nov 17, 2021
1 parent db9cf87 commit 4b1edce3c1994d2991acee8d1a2b483d8134edaf
Show file tree
Hide file tree
Showing 3 changed files with 886 additions and 0 deletions.
@@ -54,4 +54,15 @@ config NVHE_EL2_DEBUG

If unsure, say N.

config KVM_KUNIT_TEST
bool "KUnit tests for KVM on ARM64 processors" if !KUNIT_ALL_TESTS
depends on KVM && KUNIT
default KUNIT_ALL_TESTS
help
Say Y here to enable KUnit tests for the KVM on ARM64.
Only useful for KVM/ARM development and are not for inclusion into
a production build.

If unsure, say N.

endif # VIRTUALIZATION
@@ -3630,3 +3630,7 @@ void kvm_sys_reg_table_init(void)

id_reg_info_init_all();
}

#if IS_ENABLED(CONFIG_KVM_KUNIT_TEST)
#include "sys_regs_test.c"
#endif

0 comments on commit 4b1edce

Please sign in to comment.