-
Notifications
You must be signed in to change notification settings - Fork 8.1k
tests: riscv: Validate PMP stack protection under MULTITHREADING #97376
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
base: main
Are you sure you want to change the base?
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the PR!
It looks like the test you're adding here is basically a copied version of the test in tests/arch/riscv/pmp/no-multithreading
.
So my question is - are we covering here anything meaningful that the testcase mentioned above doesn't cover? We're only using the main()
thread here anyways, which is available with CONFIG_MULTITHREADING=n
as well.
Could we maybe rework this test so that it actually spawns separate threads that later try to trigger stack protection mechanisms?
For
It also seems that these tests cause crashing so that nothing can be added to them i.e. I cannot add another test case in addition to |
7fe2a6f
to
daf9e56
Compare
daf9e56
to
fed23fd
Compare
This test has be updated and consolidated with the existing tests. |
The tests has been updated and combined with the existing tests. |
The PMP stack guard test was previously limited to the non-multithreaded (no-mt) configuration. This commit updates the test implementation to conditionally handle stack boundary lookup: 1. When CONFIG_MULTITHREADING is enabled, it uses thread-specific stack information (e.g., z_interrupt_stacks[_current_cpu->id] for ISR stack and k_current_get()->stack_info for the main thread stack). 2. New test configurations (arch.riscv.pmp.mt.*) are added to explicitly run the tests with CONFIG_MULTITHREADING=y. This ensures PMP stack guards are correctly verified in a multi-threaded environment. Signed-off-by: Firas Sammoura <[email protected]>
fed23fd
to
e0db1fc
Compare
|
The PMP stack guard test was previously limited to the non-multithreaded (no-mt) configuration.
This commit updates the test implementation to conditionally handle stack boundary lookup:
When
CONFIG_MULTITHREADING
is enabled, it uses thread-specific stack information (e.g.,z_interrupt_stacks[_current_cpu->id]
for ISR stack andk_current_get()->stack_info
for the main thread stack).New test configurations (
arch.riscv.pmp.mt.*
) are added to explicitly run the tests withCONFIG_MULTITHREADING=y
.This ensures PMP stack guards are correctly verified in a multi-threaded environment.