Page Menu
Home
FreeBSD
Search
Configure Global Search
Log In
Files
F115573034
D47688.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Flag For Later
Award Token
Size
1 KB
Referenced Files
None
Subscribers
None
D47688.diff
View Options
diff --git a/sys/riscv/riscv/trap.c b/sys/riscv/riscv/trap.c
--- a/sys/riscv/riscv/trap.c
+++ b/sys/riscv/riscv/trap.c
@@ -227,11 +227,6 @@
pcb = td->td_pcb;
stval = frame->tf_stval;
- if (td->td_critnest != 0 || td->td_intr_nesting_level != 0 ||
- WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL,
- "Kernel page fault") != 0)
- goto fatal;
-
if (usermode) {
if (!VIRT_IS_VALID(stval)) {
call_trapsignal(td, SIGSEGV, SEGV_MAPERR, (void *)stval,
@@ -244,7 +239,8 @@
* Enable interrupts for the duration of the page fault. For
* user faults this was done already in do_trap_user().
*/
- intr_enable();
+ if ((frame->tf_sstatus & SSTATUS_SIE) != 0)
+ intr_enable();
if (stval >= VM_MIN_KERNEL_ADDRESS) {
map = kernel_map;
@@ -268,6 +264,11 @@
if (VIRT_IS_VALID(va) && pmap_fault(map->pmap, va, ftype))
goto done;
+ if (td->td_critnest != 0 || td->td_intr_nesting_level != 0 ||
+ WITNESS_CHECK(WARN_SLEEPOK | WARN_GIANTOK, NULL,
+ "Kernel page fault") != 0)
+ goto fatal;
+
error = vm_fault_trap(map, va, ftype, VM_FAULT_NORMAL, &sig, &ucode);
if (error != KERN_SUCCESS) {
if (usermode) {
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Apr 26, 12:48 PM (15 h, 46 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
17804088
Default Alt Text
D47688.diff (1 KB)
Attached To
Mode
D47688: riscv: Permit spurious faults in kernel mode
Attached
Detach File
Event Timeline
Log In to Comment