nehemiah: manually assemble xstore(-rng)

It seems that clang IAS erronously adds repz prefix which should not be
there.  Cpu would try to store around %ecx bytes of random, while we
only expect a word.

PR:	259218
Reported and tested by:	 Dennis Clarke <dclarke@blastwave.org>
Sponsored by:	The FreeBSD Foundation
MFC after:	1 week
This commit is contained in:
Konstantin Belousov 2021-10-21 01:42:05 +03:00
parent 5fff2859ec
commit 362c6d8dec

View File

@ -68,7 +68,7 @@ VIA_RNG_store(void *buf)
#ifdef __GNUCLIKE_ASM
__asm __volatile(
"movl $0,%%edx\n\t"
"xstore"
".byte 0x0f, 0xa7, 0xc0"
: "=a" (retval), "+d" (rate), "+D" (buf)
:
: "memory"