I can't figure out why flushing all user windows before writing out windows saved in the pcb to the stack fixes the problems with user space register window corruption I see on sun4v.  So I give up and commit the workaround. It isn't too evil, since this isn't in the fast path and we're likely to spill these windows anyway in the process of writing out the register windows. Curiously enough, the OpenSolaris code seems to do pretty much the same.
I can't figure out why flushing all user windows before writing out windows
saved in the pcb to the stack fixes the problems with user space register
window corruption I see on sun4v.  So I give up and commit the workaround.
It isn't too evil, since this isn't in the fast path and we're likely to
spill these windows anyway in the process of writing out the register windows.
Curiously enough, the OpenSolaris code seems to do pretty much the same.

orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars,orumin/openbsd-efivars