mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-09 02:28:10 +02:00
gallium/util: make sure cache line size is not zero
The "normal" detection (querying clflush size) already made sure it is
non-zero, however another method did not. This lead to crashes if this
value happened to be zero (apparently can happen in virtualized environments
at least).
This fixes https://bugs.freedesktop.org/show_bug.cgi?id=87913
Cc: "10.4" <mesa-stable@lists.freedesktop.org>
(cherry picked from commit 5fea39ace3)
This commit is contained in:
parent
ac3ca98a1b
commit
ef43d21bbc
1 changed files with 5 additions and 1 deletions
|
|
@ -409,8 +409,12 @@ util_cpu_detect(void)
|
|||
}
|
||||
|
||||
if (regs[0] >= 0x80000006) {
|
||||
/* should we really do this if the clflush size above worked? */
|
||||
unsigned int cacheline;
|
||||
cpuid(0x80000006, regs2);
|
||||
util_cpu_caps.cacheline = regs2[2] & 0xFF;
|
||||
cacheline = regs2[2] & 0xFF;
|
||||
if (cacheline > 0)
|
||||
util_cpu_caps.cacheline = cacheline;
|
||||
}
|
||||
|
||||
if (!util_cpu_caps.has_sse) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue