From: Andy Polyakov <[email protected]>
Date: Sat, 22 Sep 2012 19:09:27 +0200

>>> No, before thinking about 32-bit mode, I quickly ask what's with
>>> save-s
>>> without arguments?
>> Sorry, I just wrote that code as pseudo-code off the top of my
>> head without attending to all of the necessary details.
>> We would indeed need to allocate a minimal stack frame in each
>> save instruction.
>> It's just an oversight in my example code, that's all.
> 
> But the main question was about how context switch is handled between
> save and say mulmont. I mean the part after "save-s ought to allocate
> frames."

I'm confused.

The cpu has 8 register windows.

This means that we can save down 7 times and fill all of the
registers in each window with the values we need.

At each save we allocate the minimal stack frame, at least
enough for the spill/fill trap handlers to save the register
window if needed.

The montmul instruction occurs in the deepest register window.

The cpu will force all 7 register windows to be restored, if
needed, if some spills have occurred due to context switches
or similar.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to