x86: Add bounds `x86_non_temporal_threshold`

System Internals / glibc - Noah Goldstein [gmail.com] - 15 June 2022 21:25 UTC

The lower-bound (16448) and upper-bound (SIZE_MAX / 16) are assumed by memmove-vec-unaligned-erms.

The lower-bound is needed because memmove-vec-unaligned-erms unrolls the loop aggressively in the L(large_memset_4x) case.

The upper-bound is needed because memmove-vec-unaligned-erms right-shifts the value of `x86_non_temporal_threshold` by LOG_4X_MEMCPY_THRESH (4) which without a bound may overflow.

The lack of lower-bound can be a correctness issue. The lack of upper-bound cannot.

b446822b6a x86: Add bounds `x86_non_temporal_threshold`
manual/tunables.texi | 2 +-
sysdeps/x86/dl-cacheinfo.h | 8 +++++++-
2 files changed, 8 insertions(+), 2 deletions(-)

Upstream: sourceware.org

  • Share