]> xenbits.xensource.com Git - xen.git/commitdiff
xen: Introduce CONFIG_SELF_TESTS
authorAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 28 May 2024 14:11:54 +0000 (15:11 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Wed, 29 May 2024 09:44:03 +0000 (10:44 +0100)
... and move x86's stub_selftest() under this new option.

There is value in having these tests included in release builds too.

It will shortly be used to gate the bitops unit tests on all architectures.

Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Jan Beulich <jbeulich@suse.com>
Release-Acked-by: Oleksii Kurochko <oleksii.kurochko@gmail.com>
xen/Kconfig.debug
xen/arch/x86/extable.c
xen/arch/x86/setup.c

index 61b24ac552cd84e2e36d793fb50c72600accd2e2..07ff7eb7ba831cb1f37ef583926d20a5e7b1ad38 100644 (file)
@@ -29,6 +29,12 @@ config FRAME_POINTER
          maybe slower, but it gives very useful debugging information
          in case of any Xen bugs.
 
+config SELF_TESTS
+       bool "Extra self-testing"
+       default DEBUG
+       help
+         Enable extra unit and functional testing.
+
 config COVERAGE
        bool "Code coverage support"
        depends on !LIVEPATCH
index 8415cd1fa2491283b7ce1dd81a027be89c007701..705cf9eb94ca52c969fda62f11e0cbd74287bde9 100644 (file)
@@ -144,7 +144,7 @@ search_exception_table(const struct cpu_user_regs *regs, unsigned long *stub_ra)
     return 0;
 }
 
-#ifdef CONFIG_DEBUG
+#ifdef CONFIG_SELF_TESTS
 #include <asm/setup.h>
 #include <asm/traps.h>
 
@@ -214,7 +214,7 @@ int __init cf_check stub_selftest(void)
     return 0;
 }
 __initcall(stub_selftest);
-#endif
+#endif /* CONFIG_SELF_TESTS */
 
 unsigned long asmlinkage search_pre_exception_table(struct cpu_user_regs *regs)
 {
index b50c9c84af6d216569ce04d0ebf77f0d126413b4..dd51e68dbe5b289bfa25ef82f2a2cf3b07a762b6 100644 (file)
@@ -742,7 +742,7 @@ static void noreturn init_done(void)
     system_state = SYS_STATE_active;
 
     /* Re-run stub recovery self-tests with CET-SS active. */
-    if ( IS_ENABLED(CONFIG_DEBUG) && cpu_has_xen_shstk )
+    if ( IS_ENABLED(CONFIG_SELF_TESTS) && cpu_has_xen_shstk )
         stub_selftest();
 
     domain_unpause_by_systemcontroller(dom0);