Skip to content

Commit

Permalink
core: riscv: Disable traps by clearing XIE CSR
Browse files Browse the repository at this point in the history
Ensure we disable traps by clearing XIE CSR instead of clearing
XSTATUS.IE which is global interrupt enable bit.

Signed-off-by: Alvin Chang <[email protected]>
  • Loading branch information
gagachang committed Oct 14, 2024
1 parent 136cc65 commit 17802aa
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions core/arch/riscv/kernel/thread_optee_abi_rv.S
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@ FUNC thread_std_abi_entry , :
/* Save return value */
mv s0, a0

/* Disable all interrupts */
csrc CSR_XSTATUS, CSR_XSTATUS_IE
/* Mask all maskable exceptions before switching to temporary stack */
csrw CSR_XIE, x0

/* Switch to temporary stack */
jal thread_get_tmp_sp
Expand Down

1 comment on commit 17802aa

@lyctw
Copy link

@lyctw lyctw commented on 17802aa Oct 14, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reviewed-by: Yu Chien Peter Lin <[email protected]>

Please sign in to comment.