You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I encountered a potential bug when trying to merge upstream changes into our fork.
PR#58 (#58) introduced AVX512, which increases the size of the FPU state that the kernel has to manage.
miniosv handles this via the fpu_lock constructs which save/restore FPU state on entry/exit from interrupts.
This PR also correctly raised the interrupt stack size to 0x2000 to make space for this larger FPU state.
However, page faults happen in another stack (arch_thread::exception_stack). If the page fault handler is deep, this can lead to stack overflow.
This was not caught because we don't really have a test for page-fault-heavy scenarios in the mainline (yet 👀 #47).
I created a PR (#68) with a temporary fix (in my tests, moving from 16KiB to 32KiB solves the problem) but this might break again if we have very deep handler stack (network on the fault path 👀) so we will probably need a more permanent fix at some point.
One approach could be, for example, to assert that the handler does not use certain FPU registers and just omit saving them altogether on exceptions.
Activity