Skip to content

util/u_cpu_detect: fix cpu affinity memory corruption

Dave Airlie requested to merge airlied/mesa:cpu-detect-fix into master

When this code was run on a 2 physical CPU with 32-core EPYC with hyperthreading enabled, it was overwriting the end of the l3_affinity_mask storage and corrupt memory.

This appears to be because the author wanted the next power of two, but util_next_power_of_two only does >= so if the value is already a PoT it is a noop.

I could be wrong here, this fixes the overwrite here but needs review.

Closes: #4496 (closed)

Merge request reports