-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
kernel: support memory mapped stacks #70810
kernel: support memory mapped stacks #70810
Commits on Apr 1, 2024
-
x86: gen_gdt: remove extra unnecessary parens
Pylint complains so we fix. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 8f47e42 - Browse repository at this point
Copy the full SHA 8f47e42View commit details -
x86: do not advertise demand paging support for x86_64
x86_64 does not currently support demand paging so don't advertise it. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 58fe23a - Browse repository at this point
Copy the full SHA 58fe23aView commit details -
x86: synchronize usage of CONFIG_X86_STACK_PROTECTION
Most places use CONFIG_X86_STACK_PROTECTION, but there are some places using CONFIG_HW_STACK_PROTECTION. So synchronize all to use CONFIG_X86_STACK_PROTECTION instead. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for eb713f4 - Browse repository at this point
Copy the full SHA eb713f4View commit details -
x86: correct size for stack bound check for privileged stack
Previous commit changed the privileged stack size to be using kconfig CONFIG_PRIVILEGED_STACK_SIZE instead of simply CONFIG_MMU_PAGE_SIZE. However, the stack bound check function was still using the MMU page size, so fix that. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 3e4524b - Browse repository at this point
Copy the full SHA 3e4524bView commit details -
kernel: add options to cleanup after aborting current thread
This adds the mechanism to do cleanup after k_thread_abort() is called with the current thread. This is mainly used for cleaning up things when the thread cannot be running, e.g., cleanup the thread stack. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 5e8c5ab - Browse repository at this point
Copy the full SHA 5e8c5abView commit details -
kernel: mm: introduce k_mem_phys_map()/_unmap()
This is similar to k_mem_map()/_unmap(). But instead of using anonymous memory, the provided physical region is mapped into virtual address instead. In addition to simple mapping physical ro virtual addresses, the mapping also adds two guard pages before and after the virtual region to catch buffer under-/over-flow. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 00b3617 - Browse repository at this point
Copy the full SHA 00b3617View commit details -
kernel: add the ability to memory map thread stacks
This introduces support for memory mapped thread stacks, where each thread stack is mapped into virtual memory address space with two guard pages to catch under-/over-flowing the stack. This is just on the kernel side. Additional architecture code is required to fully support this feature. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 05c6583 - Browse repository at this point
Copy the full SHA 05c6583View commit details -
tests: mem_protect/userspace: extend tests for mapped stack
This extends the test for memory mapped stack, as the address of memory mapped stack object would be different than the actual stack object. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 9fd9271 - Browse repository at this point
Copy the full SHA 9fd9271View commit details -
tests: threads/thread_stack: extend tests for mapped stack
This extends the test for memory mapped stack, as the address of memory mapped stack object would be different than the actual stack object. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 20b30bb - Browse repository at this point
Copy the full SHA 20b30bbView commit details -
cmsis_rtos_v1: support memory mapped stack at abort hook
This extends the thread abort hook to support memory mapped stack. The calculation to find out to which instance of thread pools the outgoing thread belongs requires physical address. So find the physical address via the memory mapped stack for that. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for e19928d - Browse repository at this point
Copy the full SHA e19928dView commit details -
tests: mem_protect/stackprot: test mapped stack
This extends the mem_protect/stackprot tests to support testing with memory mapped stack. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for d60e22d - Browse repository at this point
Copy the full SHA d60e22dView commit details -
boards: qemu_x86/atom/virt: forcibly disable memory mapped stack
The current memory mapped stack code requires actual physical addresses for stacks, and cannot deal with stacks already using virtual addresses. So disable mapped stack via defconfig. Note that this is done before enabling memory mapped stacks on x86 so test won't fail when the support in the architecture code is introduced. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for d2c3853 - Browse repository at this point
Copy the full SHA d2c3853View commit details -
x86: add support for memory mapped stack for threads
This adds the necessary bits to enable memory mapping thread stacks on both x86 and x86_64. Note that currently these do not support multi level mappings (e.g. demand paging and running in virtual address space: qemu_x86/atom/virt board) as the mapped stacks require actual physical addresses. Signed-off-by: Daniel Leung <daniel.leung@intel.com>
Configuration menu - View commit details
-
Copy full SHA for 0b1c3c9 - Browse repository at this point
Copy the full SHA 0b1c3c9View commit details