cpuid_pass2 can clobber leaf 7
When we started adding support for CPUID features in leaf 7, we neglected to notice a part of what happens in cpuid_pass2. Importantly, it will re-enumerate all of the standard leaves. Leaf 7 is different from other cpuid leaves, in that it uses %eax to index into it, but then also uses %ecx to suggest a sub leaf to look at.
However, with certain newer systems, we actually have a value in %ecx being enumerated. This means that when we come back around to re-enumerate it in cpuid_pass2, we end up referring to an invalid leaf, which causes us to end up zeroing the entire set. This causes us to end up removing all the features on this leaf.
Updated by Electric Monk over 5 years ago
- Status changed from New to Closed
commit b8692e0c2f0c23ce751c0af9c1efb4391bfd00f2 Author: Robert Mustacchi <firstname.lastname@example.org> Date: 2017-01-04T01:28:10.000Z 7706 cpuid_pass2 can clobber leaf 7 Reviewed by: Jerry Jelinek <email@example.com> Reviewed by: Toomas Soome <firstname.lastname@example.org> Approved by: Richard Lowe <email@example.com>