summaryrefslogtreecommitdiff
path: root/Kernel/Arch/aarch64/Interrupts.cpp
diff options
context:
space:
mode:
authorTimon Kruiper <timonkruiper@gmail.com>2023-01-30 10:28:17 +0100
committerLinus Groh <mail@linusgroh.de>2023-02-08 18:19:48 +0000
commit7be7324287b5a35e639acf5b2be9c5e9d3228981 (patch)
tree9cdfcaf7573da25bf165ba3788c521c39e863f8d /Kernel/Arch/aarch64/Interrupts.cpp
parentecf45e191e47ab74750cbf98b026863d691650f6 (diff)
downloadserenity-7be7324287b5a35e639acf5b2be9c5e9d3228981.zip
Kernel/aarch64: Set correct ExecutionMode of PageFault
Adds a helper to aarch64/Registers.h to factor out the exception class encoding.
Diffstat (limited to 'Kernel/Arch/aarch64/Interrupts.cpp')
-rw-r--r--Kernel/Arch/aarch64/Interrupts.cpp3
1 files changed, 1 insertions, 2 deletions
diff --git a/Kernel/Arch/aarch64/Interrupts.cpp b/Kernel/Arch/aarch64/Interrupts.cpp
index 3cddb3ee9c..d4301504f5 100644
--- a/Kernel/Arch/aarch64/Interrupts.cpp
+++ b/Kernel/Arch/aarch64/Interrupts.cpp
@@ -70,8 +70,7 @@ static PageFault page_fault_from_exception_syndrome_register(VirtualAddress faul
fault.set_access((esr_el1.ISS & (1 << 6)) == (1 << 6) ? PageFault::Access::Write : PageFault::Access::Read);
- // FIXME: Set correct mode
- fault.set_mode(ExecutionMode::Kernel);
+ fault.set_mode(Aarch64::exception_class_is_data_or_instruction_abort_from_lower_exception_level(esr_el1.EC) ? ExecutionMode::User : ExecutionMode::Kernel);
if (Aarch64::exception_class_is_instruction_abort(esr_el1.EC))
fault.set_instruction_fetch(true);