hwpmc: Avoid touching MSR_DEBUGCTLMSR inside VMs.

At least KVM in Proxmox seems not happy about it.  Just to be safe
block it for all VMs, since it should just improve profile accuracy.

MFC after:	1 week
This commit is contained in:
Alexander Motin 2022-09-01 13:18:04 -04:00
parent 69818bcf38
commit 4e679d8aea

View file

@ -151,7 +151,7 @@ core_pcpu_init(struct pmc_mdep *md, int cpu)
pc->pc_hwpmcs[n + core_ri] = phw;
}
if (core_version >= 2) {
if (core_version >= 2 && vm_guest == VM_GUEST_NO) {
/* Enable Freezing PMCs on PMI. */
wrmsr(MSR_DEBUGCTLMSR, rdmsr(MSR_DEBUGCTLMSR) | 0x1000);
}