Skip to content

Commit 7427d1c

Browse files
pillo79dkalowsk
authored andcommitted
tests/subsys/llext: cleanup memory protection options
Most of the tests in the LLEXT subsystem test suite run with memory protection hardware (MPU/MMU) disabled, to avoid including memory domain issues while testing the core functionality. Only a few tests need to run with MPU/MMU enabled. This patch simplifies the testcase.yaml by setting the memory protection as disabled in a shared config file that is included by most tests. Signed-off-by: Luca Burelli <[email protected]>
1 parent 184a2a6 commit 7427d1c

File tree

3 files changed

+22
-17
lines changed

3 files changed

+22
-17
lines changed
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Disable MPU and MMU on all supported arches for the bulk of the tests.
2+
#
3+
# This uses the fact that setting an unknown symbol to 'n' has no effect,
4+
# so it is safe to group different arch-specific settings here.
5+
#
6+
CONFIG_ARM_MPU=n
7+
CONFIG_ARM_AARCH32_MMU=n
8+
CONFIG_RISCV_PMP=n

tests/subsys/llext/simple/prj.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,6 @@ CONFIG_LLEXT_EXPORT_DEVICES=y
77
CONFIG_LLEXT_LOG_LEVEL_DBG=y
88

99
CONFIG_APPLICATION_DEFINED_SYSCALL=y
10+
11+
# The bulk of the tests run with MPU/MMU disabled by including additional
12+
# configuration entries from no_mem_protection.conf.

tests/subsys/llext/simple/testcase.yaml

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,8 @@ common:
2020
- mps2/an521/cpu0 # ARM Cortex-M33 (ARMv8-M ISA)
2121
extra_configs:
2222
- arch:arm64:CONFIG_LLEXT_HEAP_SIZE=128
23+
extra_conf_files:
24+
- prj.conf
2325

2426
tests:
2527
# While there is in practice no value in compiling subsys/llext/*.c
@@ -29,15 +31,15 @@ tests:
2931
llext.simple.loader_build:
3032
build_only: true
3133

32-
# Run the suite with all combinations of core Kconfig options for the llext
33-
# subsystem (storage type, ELF type, MPU/MMU etc)
34+
# Run the suite with all combinations of core Kconfig options for the LLEXT
35+
# subsystem (storage type, ELF type, MPU/MMU etc). To focus on LLEXT issues,
36+
# most tests include no_mem_protection.conf, which disables memory protection
37+
# hardware completely.
3438
llext.simple.readonly:
3539
arch_allow: arm riscv # Xtensa needs writable storage
3640
filter: not CONFIG_MPU and not CONFIG_MMU
41+
extra_conf_files: ['no_mem_protection.conf']
3742
extra_configs:
38-
- arch:arm:CONFIG_ARM_MPU=n
39-
- arch:arm:CONFIG_ARM_AARCH32_MMU=n
40-
- arch:riscv:CONFIG_RISCV_PMP=n
4143
- CONFIG_LLEXT_STORAGE_WRITABLE=n
4244
llext.simple.readonly_mpu:
4345
min_ram: 128
@@ -58,20 +60,16 @@ tests:
5860
integration_platforms:
5961
- qemu_xtensa/dc233c # Xtensa ISA
6062
filter: not CONFIG_MPU and not CONFIG_MMU
63+
extra_conf_files: ['no_mem_protection.conf']
6164
extra_configs:
62-
- arch:arm:CONFIG_ARM_MPU=n
63-
- arch:arm:CONFIG_ARM_AARCH32_MMU=n
64-
- arch:riscv:CONFIG_RISCV_PMP=n
6565
- CONFIG_LLEXT_STORAGE_WRITABLE=y
6666
llext.simple.writable_relocatable:
6767
arch_allow: arm xtensa riscv
6868
integration_platforms:
6969
- qemu_xtensa/dc233c # Xtensa ISA
7070
filter: not CONFIG_MPU and not CONFIG_MMU
71+
extra_conf_files: ['no_mem_protection.conf']
7172
extra_configs:
72-
- arch:arm:CONFIG_ARM_MPU=n
73-
- arch:arm:CONFIG_ARM_AARCH32_MMU=n
74-
- arch:riscv:CONFIG_RISCV_PMP=n
7573
- CONFIG_LLEXT_STORAGE_WRITABLE=y
7674
- CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=y
7775

@@ -82,21 +80,17 @@ tests:
8280
integration_platforms:
8381
- qemu_xtensa/dc233c # Xtensa ISA
8482
filter: not CONFIG_MPU and not CONFIG_MMU
83+
extra_conf_files: ['no_mem_protection.conf']
8584
extra_configs:
86-
- arch:arm:CONFIG_ARM_MPU=n
87-
- arch:arm:CONFIG_ARM_AARCH32_MMU=n
88-
- arch:riscv:CONFIG_RISCV_PMP=n
8985
- CONFIG_LLEXT_STORAGE_WRITABLE=y
9086
- CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID=y
9187
llext.simple.writable_relocatable_slid_linking:
9288
arch_allow: arm xtensa riscv
9389
integration_platforms:
9490
- qemu_xtensa/dc233c # Xtensa ISA
9591
filter: not CONFIG_MPU and not CONFIG_MMU
92+
extra_conf_files: ['no_mem_protection.conf']
9693
extra_configs:
97-
- arch:arm:CONFIG_ARM_MPU=n
98-
- arch:arm:CONFIG_ARM_AARCH32_MMU=n
99-
- arch:riscv:CONFIG_RISCV_PMP=n
10094
- CONFIG_LLEXT_STORAGE_WRITABLE=y
10195
- CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=y
10296
- CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID=y

0 commit comments

Comments
 (0)