-
Notifications
You must be signed in to change notification settings - Fork 6.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
xtensa: add MPU support #67938
xtensa: add MPU support #67938
Commits on Mar 17, 2024
-
xtensa: userspace: simplify syscall trampoline a bit
There is no need to do a call4 and jx. Simply do a callx4 is enough. Also amended the now incorrect comment about how syscall trampoline is set up. It is now a straight call4 instead of the old 2x call4. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for c44ab16 - Browse repository at this point
Copy the full SHA c44ab16View commit details -
xtensa: userspace: fix incorrectly passed syscall frame pointer
Calling z_mrsh_* functions require 7 arguments where the 7th is the stack frame. Only the first 6 arguments are passed by registers where the 7th must be done via stack. However, this is not being done and an incorrect argument was being passed to the z_mrsh_* functions as stack frame pointer. An obvious issue would be dumping of stack during kernel oops, as incorrect data was being printed or crashes due to inaccessible memory. So fix it by properly populating the stack with correct stack frame pointer as outgoing argument for the caller of z_mrsh_* functions. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 182efb6 - Browse repository at this point
Copy the full SHA 182efb6View commit details -
xtensa: userspace: use syscall to check if user context
For CPU without THREADPTR, we need an alternative way to figure out if we are in user context. This extends the user context check to do that via a brief syscall. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 1756026 - Browse repository at this point
Copy the full SHA 1756026View commit details -
xtensa: move two kconfigs out of CPU_HAS_MMU block
Both CONFIG_XTENSA_SYSCALL_USE_HELPER and CONFIG_XTENSA_INSECURE_USERSPACE are also applicable to MPU. So move them out of the CPU_HAS_MMU block. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 3cad25e - Browse repository at this point
Copy the full SHA 3cad25eView commit details -
xtensa: add MPU support for kernel mode
This enables support for MPU on Xtensa. Currently this is for kernel mode only. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 3ef4fc1 - Browse repository at this point
Copy the full SHA 3ef4fc1View commit details -
tests: kernel/mem_protect/userspace: support for Xtensa MPU
Add support to test for Xtensa MPU. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 3850c81 - Browse repository at this point
Copy the full SHA 3850c81View commit details -
tests: kernel/userspace: skip other thread tests if needed
With memory domain enabled, all threads within the same domain have access to each other threads' stacks, especially with CONFIG_ARCH_MEM_DOMAIN_SYNCHRONOUS_API enabled (as it is expected behavior). So update the conditions to skip both tests to read and write to other threads' stacks. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for b9f7be2 - Browse repository at this point
Copy the full SHA b9f7be2View commit details -
xtensa: mpu: enable userspace support
This extends the Xtensa MPU to support userspace. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 473af66 - Browse repository at this point
Copy the full SHA 473af66View commit details -
xtensa: mpu: introduce CONFIG_XTENSA_MPU_ONLY_SOC_RANGES
This allows the SoC to have total control on what MPU ranges to be programmed at boot. This overrides the generic ranges in the architecture core code. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 89e3951 - Browse repository at this point
Copy the full SHA 89e3951View commit details