Commit 7b1ee5cf authored by Andrew Boie's avatar Andrew Boie Committed by Anas Nashif
Browse files

tests: CONFIG_TEST_USERSPACE now off by default



Unlike CONFIG_HW_STACK_PROTECTION, which greatly helps
expose stack overflows in test code, activating
userspace without putting threads in user mode is of
very limited value.

Now CONFIG_TEST_USERSPACE is off by default. Any test
which puts threads in user mode will need to set
CONFIG_TEST_USERSPACE.

This should greatly increase sanitycheck build times
as there is non-trivial build time overhead to
enabling this feature. This also allows some tests
which failed the build on RAM-constrained platforms
to compile properly.

tests/drivers/build_all is a special case; it doesn't
put threads in user mode, but we want to ensure all
the syscall handlers compile properly.

Fixes: #15103 (and probably others)

Signed-off-by: default avatarAndrew Boie <andrew.p.boie@intel.com>
parent 3b53e692
Loading
Loading
Loading
Loading
+0 −3
Original line number Diff line number Diff line
@@ -8,6 +8,3 @@ tests:
  sample.net.gptp:
    platform_whitelist: frdm_k64f sam_e70_xplained native_posix
    depends_on: netif
    # To avoid "Too many thread objects" error
    extra_configs:
      - CONFIG_USERSPACE=n
+22 −4
Original line number Diff line number Diff line
@@ -58,15 +58,33 @@ config COVERAGE_GCOV
endif

config TEST_USERSPACE
	bool "Enable userspace if available"
	bool "Indicate that this test exercises user mode"
	help
	  This option indicates that a test case puts threads in user mode,
	  and that the build system should enable userspace if the platform
	  supports it. It should be set on a per-test basis.

	  The userspace APIs are no-ops if userspace is not enabled, so it is
	  OK to enable this even if the test will run on platforms which do
	  not support userspace. The test should still run on those platforms,
	  just with all threads in supervisor mode.

	  If a test *requires* that userspace be enabled in order to
	  function, CONFIG_ARCH_HAS_USERSPACE should be filtered in its
	  testcase.yaml.

config TEST_ENABLE_USERSPACE
	bool
	depends on TEST_USERSPACE
	depends on ARCH_HAS_USERSPACE
	depends on TEST
	select USERSPACE
	select DYNAMIC_OBJECTS
	default y
	help
	  This option will help test the userspace mode. This can be enabled
	  only when CONFIG_ARCH_HAS_USERSPACE is set.
	  This hidden option will help test the userspace mode. This will be
	  enabled only when CONFIG_ARCH_HAS_USERSPACE is set, and that the test
	  case itself indicates that it exercises user mode via
	  CONFIG_TEST_HAS_USERSPACE.

config TEST_HW_STACK_PROTECTION
	bool "Enable hardware-based stack overflow detection if available"
+0 −1
Original line number Diff line number Diff line
@@ -10,5 +10,4 @@ CONFIG_MAIN_THREAD_PRIORITY=6
CONFIG_FORCE_NO_ASSERT=y

#Disable Userspace
CONFIG_TEST_USERSPACE=n
CONFIG_TEST_HW_STACK_PROTECTION=n
+0 −1
Original line number Diff line number Diff line
@@ -15,5 +15,4 @@ CONFIG_TICKLESS_KERNEL=n
CONFIG_FORCE_NO_ASSERT=y

#Disable Userspace
CONFIG_TEST_USERSPACE=n
CONFIG_TEST_HW_STACK_PROTECTION=n
+0 −3
Original line number Diff line number Diff line
@@ -3,7 +3,4 @@ CONFIG_PERFORMANCE_METRICS=y
CONFIG_BOOT_TIME_MEASUREMENT=y
CONFIG_TEST_RANDOM_GENERATOR=y
CONFIG_FORCE_NO_ASSERT=y

#Disable Userspace
CONFIG_TEST_USERSPACE=n
CONFIG_TEST_HW_STACK_PROTECTION=n
Loading