[haiku-commits] Change in haiku[master]: kernel/x86: don't panic for user mode page faults with disabled inter...

  • From: Gerrit <review@xxxxxxxxxxxxxxxxxxx>
  • To: waddlesplash <waddlesplash@xxxxxxxxx>, haiku-commits@xxxxxxxxxxxxx
  • Date: Sat, 20 Feb 2021 09:58:51 +0000

From Jérôme Duval <jerome.duval@xxxxxxxxx>:

Jérôme Duval has uploaded this change for review. ( 
https://review.haiku-os.org/c/haiku/+/3747 ;)


Change subject: kernel/x86: don't panic for user mode page faults with disabled 
interrupts
......................................................................

kernel/x86: don't panic for user mode page faults with disabled interrupts

the behavior isn't correct, but notifying in the syslog is enough, and let
apps at least run.
---
M src/system/kernel/arch/x86/arch_int.cpp
1 file changed, 6 insertions(+), 2 deletions(-)



  git pull ssh://git.haiku-os.org:22/haiku refs/changes/47/3747/1

diff --git a/src/system/kernel/arch/x86/arch_int.cpp 
b/src/system/kernel/arch/x86/arch_int.cpp
index 416e9d2..d202e44 100644
--- a/src/system/kernel/arch/x86/arch_int.cpp
+++ b/src/system/kernel/arch/x86/arch_int.cpp
@@ -335,9 +335,13 @@

                // If we are not running the kernel startup the page fault was 
not
                // allowed to happen and we must panic.
-               panic("page fault, but interrupts were disabled. Touching 
address "
+               if (!IFRAME_IS_USER(frame)) {
+                       panic("page fault, but interrupts were disabled. 
Touching address "
+                               "%p from ip %p\n", (void*)cr2, 
(void*)frame->ip);
+                       return;
+               }
+               dprintf("page fault, but interrupts were disabled. Touching 
address "
                        "%p from ip %p\n", (void*)cr2, (void*)frame->ip);
-               return;
        } else if (thread != NULL && thread->page_faults_allowed < 1) {
                panic("page fault not allowed at this place. Touching address "
                        "%p from ip %p\n", (void*)cr2, (void*)frame->ip);

--
To view, visit https://review.haiku-os.org/c/haiku/+/3747
To unsubscribe, or for help writing mail filters, visit 
https://review.haiku-os.org/settings

Gerrit-Project: haiku
Gerrit-Branch: master
Gerrit-Change-Id: I9156965f6a623eb0607720b39c8b8bdcaed10a64
Gerrit-Change-Number: 3747
Gerrit-PatchSet: 1
Gerrit-Owner: Jérôme Duval <jerome.duval@xxxxxxxxx>
Gerrit-MessageType: newchange

Other related posts:

  • » [haiku-commits] Change in haiku[master]: kernel/x86: don't panic for user mode page faults with disabled inter... - Gerrit