Commit 7427d1c8 authored by Luca Burelli's avatar Luca Burelli Committed by Dan Kalowsky
Browse files

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: default avatarLuca Burelli <l.burelli@arduino.cc>
parent 184a2a65
Loading
Loading
Loading
Loading
+8 −0
Original line number Diff line number Diff line
# Disable MPU and MMU on all supported arches for the bulk of the tests.
#
# This uses the fact that setting an unknown symbol to 'n' has no effect,
# so it is safe to group different arch-specific settings here.
#
CONFIG_ARM_MPU=n
CONFIG_ARM_AARCH32_MMU=n
CONFIG_RISCV_PMP=n
+3 −0
Original line number Diff line number Diff line
@@ -7,3 +7,6 @@ CONFIG_LLEXT_EXPORT_DEVICES=y
CONFIG_LLEXT_LOG_LEVEL_DBG=y

CONFIG_APPLICATION_DEFINED_SYSCALL=y

# The bulk of the tests run with MPU/MMU disabled by including additional
# configuration entries from no_mem_protection.conf.
+11 −17
Original line number Diff line number Diff line
@@ -20,6 +20,8 @@ common:
    - mps2/an521/cpu0         # ARM Cortex-M33 (ARMv8-M ISA)
  extra_configs:
    - arch:arm64:CONFIG_LLEXT_HEAP_SIZE=128
  extra_conf_files:
    - prj.conf

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

  # Run the suite with all combinations of core Kconfig options for the llext
  # subsystem (storage type, ELF type, MPU/MMU etc)
  # Run the suite with all combinations of core Kconfig options for the LLEXT
  # subsystem (storage type, ELF type, MPU/MMU etc). To focus on LLEXT issues,
  # most tests include no_mem_protection.conf, which disables memory protection
  # hardware completely.
  llext.simple.readonly:
    arch_allow: arm riscv # Xtensa needs writable storage
    filter: not CONFIG_MPU and not CONFIG_MMU
    extra_conf_files: ['no_mem_protection.conf']
    extra_configs:
      - arch:arm:CONFIG_ARM_MPU=n
      - arch:arm:CONFIG_ARM_AARCH32_MMU=n
      - arch:riscv:CONFIG_RISCV_PMP=n
      - CONFIG_LLEXT_STORAGE_WRITABLE=n
  llext.simple.readonly_mpu:
    min_ram: 128
@@ -58,20 +60,16 @@ tests:
    integration_platforms:
      - qemu_xtensa/dc233c      # Xtensa ISA
    filter: not CONFIG_MPU and not CONFIG_MMU
    extra_conf_files: ['no_mem_protection.conf']
    extra_configs:
      - arch:arm:CONFIG_ARM_MPU=n
      - arch:arm:CONFIG_ARM_AARCH32_MMU=n
      - arch:riscv:CONFIG_RISCV_PMP=n
      - CONFIG_LLEXT_STORAGE_WRITABLE=y
  llext.simple.writable_relocatable:
    arch_allow: arm xtensa riscv
    integration_platforms:
      - qemu_xtensa/dc233c      # Xtensa ISA
    filter: not CONFIG_MPU and not CONFIG_MMU
    extra_conf_files: ['no_mem_protection.conf']
    extra_configs:
      - arch:arm:CONFIG_ARM_MPU=n
      - arch:arm:CONFIG_ARM_AARCH32_MMU=n
      - arch:riscv:CONFIG_RISCV_PMP=n
      - CONFIG_LLEXT_STORAGE_WRITABLE=y
      - CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=y

@@ -82,10 +80,8 @@ tests:
    integration_platforms:
      - qemu_xtensa/dc233c      # Xtensa ISA
    filter: not CONFIG_MPU and not CONFIG_MMU
    extra_conf_files: ['no_mem_protection.conf']
    extra_configs:
      - arch:arm:CONFIG_ARM_MPU=n
      - arch:arm:CONFIG_ARM_AARCH32_MMU=n
      - arch:riscv:CONFIG_RISCV_PMP=n
      - CONFIG_LLEXT_STORAGE_WRITABLE=y
      - CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID=y
  llext.simple.writable_relocatable_slid_linking:
@@ -93,10 +89,8 @@ tests:
    integration_platforms:
      - qemu_xtensa/dc233c      # Xtensa ISA
    filter: not CONFIG_MPU and not CONFIG_MMU
    extra_conf_files: ['no_mem_protection.conf']
    extra_configs:
      - arch:arm:CONFIG_ARM_MPU=n
      - arch:arm:CONFIG_ARM_AARCH32_MMU=n
      - arch:riscv:CONFIG_RISCV_PMP=n
      - CONFIG_LLEXT_STORAGE_WRITABLE=y
      - CONFIG_LLEXT_TYPE_ELF_RELOCATABLE=y
      - CONFIG_LLEXT_EXPORT_BUILTINS_BY_SLID=y