File tree Expand file tree Collapse file tree 1 file changed +5
-1
lines changed
Expand file tree Collapse file tree 1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change @@ -92,7 +92,11 @@ extern "C" void exception_common(Kernel::TrapFrame* trap_frame)
9292 // stay consistent with the user‑mode debugger’s behavior.
9393 trap_frame->regs ->set_ip (trap_frame->regs ->ip () + 4 );
9494 }
95- Processor::enable_interrupts ();
95+
96+ // Only enable interrupts if they were enabled when the exception happened
97+ // (spsr_el1.I specifiers an interrupt mask, so it's 0 if interrupts were enabled).
98+ if (bit_cast<Aarch64::SPSR_EL1>(trap_frame->regs ->spsr_el1 ).I == 0 )
99+ Processor::enable_interrupts ();
96100
97101 if (Aarch64::exception_class_is_data_abort (esr_el1.EC ) || Aarch64::exception_class_is_instruction_abort (esr_el1.EC )) {
98102 auto page_fault_or_error = page_fault_from_exception_syndrome_register (VirtualAddress (fault_address), esr_el1);
You can’t perform that action at this time.
0 commit comments