We should never take instruction page faults when in the kernel, but by
using the standard page fault code we should get a more-informative
message about faulting on a NOFAULT page rather than branching to the
default case here and printing an "Unknown kernel exception ..."
message.
Details
Details
- Reviewers
jhb markj - Group Reviewers
riscv - Commits
- rS366486: riscv: Handle supervisor instruction page faults
Diff Detail
Diff Detail
- Repository
- rS FreeBSD src repository - subversion
- Lint
Lint Not Applicable - Unit
Tests Not Applicable
Event Timeline
Comment Actions
Somewhat related, Wes from Cambridge had noted a while back that if we get a fault due to a SUM violation, we will just keep retrying the fault endlessly instead of panicking. That check probably belongs somewhere in the page_fault_handler function.
Comment Actions
I _think_ the concern was if you have a non-zero pcb_onfault (e.g. you forget to clear it) but SUM is clear and try to access a valid userspace address then pmap_fault_fixup or vm_fault_trap will succeed and you will keep retrying the instruction.
Comment Actions
I do think we should validate the SUM bit in page_fault_handler(). I just assumed that someone had actually managed to trigger this bug and was a bit surprised since SSTATUS_SUM and pcb_onfault are always(?) manipulated together.