Summary: | CPU cacheline size of 0 can be returned by CPUID leaf 0x80000006 in some virtual machines | ||
---|---|---|---|
Product: | Mesa | Reporter: | Leonid Shatz <leonid.shatz> |
Component: | Other | Assignee: | mesa-dev |
Status: | RESOLVED FIXED | QA Contact: | |
Severity: | major | ||
Priority: | medium | CC: | leonid.shatz |
Version: | unspecified | ||
Hardware: | x86-64 (AMD64) | ||
OS: | Linux (All) | ||
Whiteboard: | |||
i915 platform: | i915 features: |
Description
Leonid Shatz
2014-12-31 15:54:35 UTC
The bug exists since 9.2.5 and in the most recent versions of the project. Sorry, the correct code would be something like: if (regs[0] >= 0x80000006) { cpuid(0x80000006, regs2); + if ((regs2[2] & 0xFF) > 0) util_cpu_caps.cacheline = regs2[2] & 0xFF; } I'm wondering if we actually should use this detection method if the other one (which queries clflush size in fact) is also available. I guess though there's some (amd) cpus where the other method isn't available. Not sure what's the better method to use in any case if both are available (might even provide the same number on all existing cpus). Regardless, the patch looks good. In virtual environments you would never know which is the safest method. It depends on the implementation and correctness of the hypervisor. I would just add the suggested fix and wait to see if any new related issues will be reported. Fixed by 5fea39ace311723dab53460ae7b51b80746e0d3f. |
Use of freedesktop.org services, including Bugzilla, is subject to our Code of Conduct. How we collect and use information is described in our Privacy Policy.