Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 1 Sep 2022 17:23:23 GMT
From:      Alexander Motin <mav@FreeBSD.org>
To:        src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org
Subject:   git: 4e679d8aeaa8 - main - hwpmc: Avoid touching MSR_DEBUGCTLMSR inside VMs.
Message-ID:  <202209011723.281HNNxM018339@gitrepo.freebsd.org>

next in thread | raw e-mail | index | archive | help
The branch main has been updated by mav:

URL: https://cgit.FreeBSD.org/src/commit/?id=4e679d8aeaa86ce061b15c51fe9a5eae1eff7470

commit 4e679d8aeaa86ce061b15c51fe9a5eae1eff7470
Author:     Alexander Motin <mav@FreeBSD.org>
AuthorDate: 2022-09-01 17:18:04 +0000
Commit:     Alexander Motin <mav@FreeBSD.org>
CommitDate: 2022-09-01 17:23:11 +0000

    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
---
 sys/dev/hwpmc/hwpmc_core.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/sys/dev/hwpmc/hwpmc_core.c b/sys/dev/hwpmc/hwpmc_core.c
index 7ec22c36019c..ff6bfbd4322f 100644
--- a/sys/dev/hwpmc/hwpmc_core.c
+++ b/sys/dev/hwpmc/hwpmc_core.c
@@ -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);
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202209011723.281HNNxM018339>