NetBSD/src kbL1p6Fsys/arch/amd64/amd64 amd64_trap.S trap.c

   Fix handling of segment register faults when running with SVS. The behavior
   is changed also in the non-SVS case.

   I've put a documentation in amd64_trap.S. Basically, the problem with SVS
   is that if iret faults, we already have a full trapframe pushed on the
   stack and the CPU will push another frame on this stack (nested), but it
   hits the redzone below the stack since it is still running with the user
   page table loaded.

   To fix that, we pop a good part of the trapframe earlier in intrfastexit.
   If iret faults, the current %rsp has enough room for an iret frame, and
   the CPU can push that without problem. We then switch back to the outer
   iret frame (the frame the CPU was trying to pop by executing iret, but that
   it didn't pop for real because iret faulted), call INTRENTRY, and handle
   the trap as if it had been received from userland directly.
VersionDeltaFile
1.37+110-40sys/arch/amd64/amd64/amd64_trap.S
1.112+2-90sys/arch/amd64/amd64/trap.c
1.157+21-11sys/arch/amd64/amd64/locore.S
+133-1413 files

UnifiedSplitRaw