mirror of
git://sourceware.org/git/glibc.git
synced 2025-03-06 20:58:33 +01:00
x86: Avoid integer truncation with large cache sizes (bug 32470)
Some hypervisors report 1 TiB L3 cache size. This results in some variables incorrectly getting zeroed, causing crashes in memcpy/memmove because invariants are violated.
This commit is contained in:
parent
77e921bc61
commit
61c3450db9
1 changed files with 2 additions and 2 deletions
|
@ -1021,11 +1021,11 @@ dl_init_cacheinfo (struct cpu_features *cpu_features)
|
||||||
non_temporal_threshold = maximum_non_temporal_threshold;
|
non_temporal_threshold = maximum_non_temporal_threshold;
|
||||||
|
|
||||||
/* NB: The REP MOVSB threshold must be greater than VEC_SIZE * 8. */
|
/* NB: The REP MOVSB threshold must be greater than VEC_SIZE * 8. */
|
||||||
unsigned int minimum_rep_movsb_threshold;
|
unsigned long int minimum_rep_movsb_threshold;
|
||||||
/* NB: The default REP MOVSB threshold is 4096 * (VEC_SIZE / 16) for
|
/* NB: The default REP MOVSB threshold is 4096 * (VEC_SIZE / 16) for
|
||||||
VEC_SIZE == 64 or 32. For VEC_SIZE == 16, the default REP MOVSB
|
VEC_SIZE == 64 or 32. For VEC_SIZE == 16, the default REP MOVSB
|
||||||
threshold is 2048 * (VEC_SIZE / 16). */
|
threshold is 2048 * (VEC_SIZE / 16). */
|
||||||
unsigned int rep_movsb_threshold;
|
unsigned long int rep_movsb_threshold;
|
||||||
if (CPU_FEATURE_USABLE_P (cpu_features, AVX512F)
|
if (CPU_FEATURE_USABLE_P (cpu_features, AVX512F)
|
||||||
&& !CPU_FEATURE_PREFERRED_P (cpu_features, Prefer_No_AVX512))
|
&& !CPU_FEATURE_PREFERRED_P (cpu_features, Prefer_No_AVX512))
|
||||||
{
|
{
|
||||||
|
|
Loading…
Add table
Reference in a new issue