Skip to content
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

Remove redundant mask of stack high water mark in switcher. #193

Merged
merged 1 commit into from
Apr 5, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 2 additions & 4 deletions sdk/core/switcher/entry.S
Original file line number Diff line number Diff line change
Expand Up @@ -215,9 +215,8 @@ __Z26compartment_switcher_entryz:
csetboundsexact ct2, csp, s1
csetaddr csp, ct2, s0
#ifdef CONFIG_MSHWM
// Read and align the stack high water mark
// Read the stack high water mark (which is 16-byte aligned)
csrr gp, CSR_MSHWM
and gp, gp, ~0xf
// Skip zeroing if high water mark >= stack pointer
bge t2, sp, after_zero
// Use stack high water mark as base address for zeroing. If this faults
Expand Down Expand Up @@ -793,12 +792,11 @@ exception_entry_asm:
cincoffset csp, csp, SPILL_SLOT_SIZE
#ifndef CONFIG_NO_SWITCHER_SAFETY
#ifdef CONFIG_MSHWM
// read and align the stack high water mark
// read the stack high water mark, which is 16-byte aligned
// we will use this as base address for stack clearing
// note that it cannot be greater than stack top as we
// we set it to stack top when we pushed to trusted stack frame
csrr tp, CSR_MSHWM
and tp, tp, ~0xf
#else
cgetbase tp, csp
#endif
Expand Down
Loading