Commit 47a973f
perf/x86/intel: Fix ARCH_PERFMON_NUM_COUNTER_LEAF
The EAX of the CPUID Leaf 023H enumerates the mask of valid sub-leaves.
To tell the availability of the sub-leaf 1 (enumerate the counter mask),
perf should check the bit 1 (0x2) of EAS, rather than bit 0 (0x1).
The error is not user-visible on bare metal. Because the sub-leaf 0 and
the sub-leaf 1 are always available. However, it may bring issues in a
virtualization environment when a VMM only enumerates the sub-leaf 0.
Introduce the cpuid35_e?x to replace the macros, which makes the
implementation style consistent.
Fixes: eb467aa ("perf/x86/intel: Support Architectural PerfMon Extension leaf")
Signed-off-by: Kan Liang <[email protected]>
Signed-off-by: Peter Zijlstra (Intel) <[email protected]>
Cc: [email protected]
Link: https://lkml.kernel.org/r/[email protected]1 parent 0a55615 commit 47a973f
2 files changed
+35
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
4905 | 4905 | | |
4906 | 4906 | | |
4907 | 4907 | | |
4908 | | - | |
| 4908 | + | |
| 4909 | + | |
| 4910 | + | |
4909 | 4911 | | |
4910 | | - | |
| 4912 | + | |
4911 | 4913 | | |
4912 | | - | |
| 4914 | + | |
4913 | 4915 | | |
4914 | | - | |
| 4916 | + | |
4915 | 4917 | | |
4916 | 4918 | | |
4917 | | - | |
| 4919 | + | |
4918 | 4920 | | |
4919 | | - | |
4920 | | - | |
4921 | | - | |
| 4921 | + | |
| 4922 | + | |
| 4923 | + | |
4922 | 4924 | | |
4923 | 4925 | | |
4924 | 4926 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
188 | 188 | | |
189 | 189 | | |
190 | 190 | | |
191 | | - | |
192 | | - | |
193 | | - | |
194 | 191 | | |
195 | 192 | | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
196 | 218 | | |
197 | 219 | | |
198 | 220 | | |
| |||
0 commit comments