7bc8e59cce
If a kernel stack exists, use that whenever the user process is in privileged mode, i.e. running an exception or in system call. Previously the exception context was stored into the user's stack, which is not ideal. Why? 1. Because the exception entry status (REG_INT_CTX) is needed by the kernel, and this is now in user memory which requires that the correct user mappings are active when it is accessed. 2. The user must currently account for the exception stack frame (which is BIG) in its own stack allocation. Moving the exception context save to the kernel stack offloads this responsibility from the user to the kernel, which is IMO the correct behavior. 3. The kernel access to user memory is currently allowed without condition, however this is not ideal either. The privileged mode status CSR allows blocking access to user memory via the STATUS_SUM-bit, which should be disabled by default and only enabled when access to user space is really needed. This patch allows implementing such features. |
||
---|---|---|
.. | ||
bl602 | ||
c906 | ||
esp32c3 | ||
esp32c6 | ||
espressif | ||
fe310 | ||
hpm6750 | ||
k210 | ||
litex | ||
mpfs | ||
qemu-rv | ||
rv32m1 | ||
.gitignore | ||
arch.h | ||
barriers.h | ||
csr.h | ||
elf.h | ||
inttypes.h | ||
irq.h | ||
limits.h | ||
mode.h | ||
setjmp.h | ||
spinlock.h | ||
stdarg.h | ||
syscall.h | ||
types.h |