-
Notifications
You must be signed in to change notification settings - Fork 171
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
x86: fix a crash when adding both legacy AMD and CPUID 0x04 caches
The old code increased numcaches in the second case but it added additional caches at the beginning of the array. Uninitialized caches in the array caused a divide by zero (cache->nbthreads_sharing) when used later. Only occurs if the CPUID vendor isn't recognized (neither Intel, nor AMD, nor Zhaoxin) or in case of clang 4.0 bug on FreeBSD11.1 (#282). That's also why the code was crashing on Zhaoxin instead of just reporting wrong topology (#279). Signed-off-by: Brice Goglin <Brice.Goglin@inria.fr> (cherry picked from commit a6f013c)
- Loading branch information
Showing
2 changed files
with
10 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters