bn/asm/x86[_64]-mont*.pl: implement slightly alternative page-walking.
authorAndy Polyakov <appro@openssl.org>
Wed, 16 Mar 2016 22:33:53 +0000 (23:33 +0100)
committerAndy Polyakov <appro@openssl.org>
Mon, 22 Aug 2016 12:58:32 +0000 (14:58 +0200)
commit3ba1ef829cf3dd36eaa5e819258d90291c6a1027
tree55d682acc16b649f0edef4a320b658e5eb3b2ea0
parentfe34735c194b9d81dd84e89bbfcfc67c90aa99b3
bn/asm/x86[_64]-mont*.pl: implement slightly alternative page-walking.

Original strategy for page-walking was adjust stack pointer and then
touch pages in order. This kind of asks for double-fault, because
if touch fails, then signal will be delivered to frame above adjusted
stack pointer. But touching pages prior adjusting stack pointer would
upset valgrind. As compromise let's adjust stack pointer in pages,
touching top of the stack. This still asks for double-fault, but at
least prevents corruption of neighbour stack if allocation is to
overstep the guard page.

Also omit predict-non-taken hints as they reportedly trigger illegal
instructions in some VM setups.

Reviewed-by: Richard Levitte <levitte@openssl.org>
crypto/bn/asm/x86-mont.pl
crypto/bn/asm/x86_64-mont.pl
crypto/bn/asm/x86_64-mont5.pl