diff options
author | Timon Kruiper <timonkruiper@gmail.com> | 2023-01-29 15:10:41 +0100 |
---|---|---|
committer | Linus Groh <mail@linusgroh.de> | 2023-02-08 18:19:48 +0000 |
commit | ecf45e191e47ab74750cbf98b026863d691650f6 (patch) | |
tree | 6acad265ef0d9a3421e4733d2f35f6068f7fe42b /Kernel/Arch/aarch64/Interrupts.cpp | |
parent | daf7f43135a13b3a82b2e3b497d56530b43ca985 (diff) | |
download | serenity-ecf45e191e47ab74750cbf98b026863d691650f6.zip |
Kernel/aarch64: Handle instruction aborts
To detect instruction aborts, a helper to Registers.h is added, and used
in Interrupts.cpp. Additionally, the PageFault class gets a setter to
set the PageFaults m_is_instruction_fetch bool, and is also used in
Interrupts.cpp.
Diffstat (limited to 'Kernel/Arch/aarch64/Interrupts.cpp')
-rw-r--r-- | Kernel/Arch/aarch64/Interrupts.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/Kernel/Arch/aarch64/Interrupts.cpp b/Kernel/Arch/aarch64/Interrupts.cpp index d5560b307f..3cddb3ee9c 100644 --- a/Kernel/Arch/aarch64/Interrupts.cpp +++ b/Kernel/Arch/aarch64/Interrupts.cpp @@ -73,6 +73,9 @@ static PageFault page_fault_from_exception_syndrome_register(VirtualAddress faul // FIXME: Set correct mode fault.set_mode(ExecutionMode::Kernel); + if (Aarch64::exception_class_is_instruction_abort(esr_el1.EC)) + fault.set_instruction_fetch(true); + return fault; } @@ -92,7 +95,7 @@ extern "C" void exception_common(Kernel::TrapFrame* trap_frame) dump_exception_syndrome_register(esr_el1); } - if (Aarch64::exception_class_is_data_abort(esr_el1.EC)) { + if (Aarch64::exception_class_is_data_abort(esr_el1.EC) || Aarch64::exception_class_is_instruction_abort(esr_el1.EC)) { auto page_fault = page_fault_from_exception_syndrome_register(VirtualAddress(fault_address), esr_el1); page_fault.handle(*trap_frame->regs); } else { |