Skip to content

Commit 8c10964

Browse files
dcpleungnashif
authored andcommitted
xtensa: mmu: clear ZSR_DEPC_SAVE at boot
ZSR_DEPC_SAVE is being used to determine whether we are faulting inside double exception if this is not zero. It is possible that the boot ROM or custom startup code leaves this non-zero, which would result in a fake triple fault. So clear it at boot. Note that the zeroing is done in MMU init code as these triple faults are not actual hardware ones but only semantics, and will occur once MMU is enabled. Fixes #75194 Signed-off-by: Daniel Leung <[email protected]>
1 parent fd90c9b commit 8c10964

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

arch/xtensa/core/ptables.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -317,6 +317,13 @@ void xtensa_mmu_init(void)
317317

318318
xtensa_init_paging(xtensa_kernel_ptables);
319319

320+
/*
321+
* This is used to determine whether we are faulting inside double
322+
* exception if this is not zero. Sometimes SoC starts with this not
323+
* being set to zero. So clear it during boot.
324+
*/
325+
XTENSA_WSR(ZSR_DEPC_SAVE_STR, 0);
326+
320327
arch_xtensa_mmu_post_init(_current_cpu->id == 0);
321328
}
322329

0 commit comments

Comments
 (0)