aboutsummaryrefslogtreecommitdiff
path: root/arch/riscv64
diff options
context:
space:
mode:
authorKimplul <kimi.h.kuparinen@gmail.com>2024-11-01 11:43:14 +0200
committerKimplul <kimi.h.kuparinen@gmail.com>2024-11-01 12:47:57 +0200
commit83ec75327c1ec35f25b6aee24f616a41858be539 (patch)
treebd5c74baf3286beee930c7ba4b767c712b6afe6b /arch/riscv64
parent8100eef0826e7fb182434979a9b139716b3637e1 (diff)
downloadkmi-83ec75327c1ec35f25b6aee24f616a41858be539.tar.gz
kmi-83ec75327c1ec35f25b6aee24f616a41858be539.zip
move stack modifications to be earlier in rpc
Diffstat (limited to 'arch/riscv64')
-rw-r--r--arch/riscv64/kernel/vmem.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/arch/riscv64/kernel/vmem.c b/arch/riscv64/kernel/vmem.c
index bd7906b..4556593 100644
--- a/arch/riscv64/kernel/vmem.c
+++ b/arch/riscv64/kernel/vmem.c
@@ -605,6 +605,10 @@ stat_t setup_rpc_stack(struct tcb *t)
vmflags_t flags = VM_V | VM_R | VM_W;
/* note how VM_U is missing, userspace messing about will be done later */
+ /* don't generate interrupt on first access, since it'll come from
+ * inside the kernel and we can't handle that */
+ flags |= VM_A | VM_D;
+
pm_t page = alloc_page(MM_O1);
if (!page)
return ERR_OOMEM;
@@ -751,7 +755,7 @@ void destroy_rpc(struct tcb *t)
set_bits(*pte, vp_flags(VM_U));
}
- t->arch.rpc_idx = ctx - 1;
+ t->arch.rpc_idx = ctx - 2;
}
void grow_rpc(struct tcb *t, vm_t top)