pcm icon indicating copy to clipboard operation
pcm copied to clipboard

No leaf 0 under cpuid function 11 on Ice Lake

Open rob-scheepens opened this issue 2 years ago • 4 comments

When running pcm on a KVM-based vm, I get:

 Processor Counter Monitor  (2022-03-28 15:50:50 +0200 ID=78f12b99)


Detected a hypervisor/virtualization technology. Some metrics might not be available due to configuration or availability of virtual hardware features.

=====  Processor information  =====
Linux arch_perfmon flag  : yes
Hybrid processor         : no
IBRS and IBPB supported  : yes
STIBP supported          : yes
Spec arch caps supported : yes
Max CPUID level          : 27
ERROR: Major problem? No leaf 0 under cpuid function 11.
Access to Processor Counter Monitor has denied (no MSR or PCI CFG space access).

I used host passthrough for cpu, and I enabled and verified nested virtualization is enabled for this vm, running SLES 15 SP3.

lscpu gives:

CPU op-mode(s):                  32-bit, 64-bit
Byte Order:                      Little Endian
Address sizes:                   46 bits physical, 48 bits virtual
CPU(s):                          64
On-line CPU(s) list:             0-63
Thread(s) per core:              2
Core(s) per socket:              32
Socket(s):                       1
NUMA node(s):                    1
Vendor ID:                       GenuineIntel
CPU family:                      6
Model:                           106
Model name:                      Intel(R) Xeon(R) Platinum 8352Y CPU @ 2.20GHz
Stepping:                        6
CPU MHz:                         2199.998
BogoMIPS:                        4399.99
Virtualization:                  VT-x
Hypervisor vendor:               KVM
Virtualization type:             full
L1d cache:                       1 MiB
L1i cache:                       1 MiB
L2 cache:                        128 MiB
NUMA node0 CPU(s):               0-63
Vulnerability Itlb multihit:     Not affected
Vulnerability L1tf:              Not affected
Vulnerability Mds:               Not affected
Vulnerability Meltdown:          Not affected
Vulnerability Spec store bypass: Mitigation; Speculative Store Bypass disabled via prctl and seccomp
Vulnerability Spectre v1:        Mitigation; usercopy/swapgs barriers and __user pointer sanitization
Vulnerability Spectre v2:        Mitigation; Enhanced IBRS, IBPB conditional, RSB filling
Vulnerability Srbds:             Not affected
Vulnerability Tsx async abort:   Mitigation; Clear CPU buffers; SMT Host state unknown
Flags:                           fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush mmx fxsr sse sse2 ss ht syscall nx pdpe1gb rdtscp lm constant_tsc arch_perfmon rep_good nop
                                 l cpuid tsc_known_freq pni pclmulqdq vmx ssse3 fma cx16 pdcm pcid sse4_1 sse4_2 x2apic movbe popcnt tsc_deadline_timer aes xsave avx f16c rdrand hypervisor lahf_lm abm 3dn
                                 owprefetch cpuid_fault invpcid_single ssbd ibrs ibpb stibp ibrs_enhanced tpr_shadow vnmi flexpriority ept vpid ept_ad fsgsbase tsc_adjust bmi1 hle avx2 smep bmi2 erms invp
                                 cid rtm avx512f avx512dq rdseed adx smap avx512ifma clflushopt clwb avx512cd sha_ni avx512bw avx512vl xsaveopt xsavec xgetbv1 xsaves wbnoinvd avx512vbmi umip pku ospke avx
                                 512_vbmi2 gfni vaes vpclmulqdq avx512_vnni avx512_bitalg avx512_vpopcntdq la57 rdpid fsrm md_clear arch_capabilities

I've also attached cpuid_tool data.

Is there a way to get pcm working in this vm?

cpuid_tool output.txt

rob-scheepens avatar Jun 02 '22 12:06 rob-scheepens

Bare-metal Icelake supports CPUID leaf 11 topology enumeration. But your hypervisor does not expose the topology enumeration through CPUID leaf 11. https://web.archive.org/web/20150205015916/https://software.intel.com/en-us/articles/intel-64-architecture-processor-topology-enumeration

Either the hypervisor needs to expose leaf 11 or PCM needs to be extended to support the legacy CPUID leaf 1 leaf 4 enumeration method.

opcm avatar Jun 02 '22 14:06 opcm

thanks for sending the detailed issue report

opcm avatar Jun 02 '22 14:06 opcm

Updating to later QEMU ensured that xtopology cpuid feature was also exposed, now PCM is working.

rob-scheepens avatar Jun 07 '22 15:06 rob-scheepens

thanks for the update. Good to know that the QEMU update resolved the issue

opcm avatar Jun 21 '22 07:06 opcm