Skip to content

ARM: Userspace: should we have default system app partitions? #13889

@ioannisg

Description

@ioannisg

Is your enhancement proposal related to a problem? Please describe.
Since we have depreciated APP_SHARED_MEM, when we build with CONFIG_USERSPACE, it seems to me that there are, by default, two partitions generated:

  • z_libc_partition
  • z-malloc_partition

In addition to that, when we run a test in user mode, there is also

  • ztest_mem_partition
    generated by the program.

As a result, in the kernel tests with User mode / Stack Protection, we have, in total 5 MPU regions reserved by the system (the 3 partitions, one for the thread stack, and one for the stack guard).

Now, there are platforms, such as nRF52810 which require 4 partitions for the background FLASH and SRAM, because the flash and SRAM do not have power-of-two sizes.

Consequently, the tests ASSERT because the total number of hardware regions is 8 (Cortex-M3, Cortex-M4).

Describe the solution you'd like
I would like to be able to run the kernel tests in these platforms, if possible.

Describe alternatives you've considered
Would it be possible to have the two system partitions (libc, malloc) defined conditionally, i.e. with some Kconfig symbol? And then we would enable this by default or not in the tests suites.

Also, do we document that CONFIG_USERSPACE requires minimum 3 partitions in ARMv7-M builds (the two system parts and the thread stack)? It would be nice to tell the developer how many regions are required for enabling user mode support.

Finally: if no action will be taken - how can we filter out these platforms from running the kernel tests on user mode?

Metadata

Metadata

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions