]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
amd64: fix up memset added in r333324
authormjg <mjg@FreeBSD.org>
Mon, 7 May 2018 20:54:42 +0000 (20:54 +0000)
committermjg <mjg@FreeBSD.org>
Mon, 7 May 2018 20:54:42 +0000 (20:54 +0000)
commitec95c631afb36995b900958d5d928d21c496141a
treec052011e869f9708e5629209e44e7e1b7d910a4a
parentce5697ce5dd586c9f350bfbae97d3781f38eec6b
amd64: fix up memset added in r333324

There was a missing trick expanding the passed pattern to a full word
by multiplication. As a side effect non-zero patterns would be
incorrectly laid down.

This stems from the use of rep stosq which is word-sized, while the passed
argument is byte-sized.

I initially repurposed memcpy into memset without taking this into account.
All but non-bzero testing was performed with a variant utilizing ERMS, i.e.
using only stosb which happens to not into the problem whatsoever. So my bad
twice.

Thanks to Oliver Pinter for noting the problem and providing a testcase.
sys/amd64/amd64/support.S