Right, I didn't think about that. And using an IST for page fault handler would not be a good idea since its more or less valid for page fault handler to generate page faults (and thus reeenter itself, albeit with a different page fault address).Owen wrote:In long/64-bit mode, any stack fault in user mode is going to be reported as a page fault (being as its the only method of bounding the stack) as with any other addressing fault. In kernel mode, likewise, but being as the page fault handler would be unable to push anything to the stack, it would turn into a double fault.
There are situations where exception handlers (especially protection fault handler) would invoke themselves in a loop and use-up all kernel stack. I want to detect those and provide a usable way of analysing what went wrong.Owen wrote: Erm, just make sure your kernel stacks are big enough?
Come to think of it, I must allocate guard pages for kernel stacks (above and below) in situations where a flat stack might be used, like when SYSENTER interface is used, and for long mode tasks. That would waste two pages of linear address space per task, but I cannot see any other way of solving that issue.