From nobody Thu Sep 8 00:30:37 2022 X-Original-To: dev-commits-src-branches@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4MNKlx6qvPz4bYLS; Thu, 8 Sep 2022 00:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4MNKlx692Gz3q58; Thu, 8 Sep 2022 00:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662597037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FEf/oKNtakR3A2f2fGdyt6HOB1h8XAGAIlxPoBj6Klg=; b=NSQwkSIG3q+ltkoZybv+YMqfaAgx92G2I0wPIfMs+5V/a0nqoTSOk4fm5BlV/68sD3C4H7 80051ZpXitjxI27I5pUtt3qZ6nk1xWAnokHlUW/ca9WWfFWsbmj4RRpjiSZyZwyISIjkdy qtco4w+zy01rKpBfnnuSChz6mZd5iLip2S9xHppkey5leQHi73YfgDqB0c18ZedE4h9GhZ xnH6MfUZDaeN22iIsushxT+2B0dlHwHfzSr6h7Cf7fSc9lxFr9Jh9+LNx3owU+FnSfFG/6 osUmKbtFZ/0riE8qAMzqCCj9L0xMulCvb3i15L8Goa0Ti+o1ew1owGMnvCTqvw== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4MNKlx5CgjzhmD; Thu, 8 Sep 2022 00:30:37 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.16.1/8.16.1) with ESMTP id 2880Ub16001001; Thu, 8 Sep 2022 00:30:37 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 2880UbLY001000; Thu, 8 Sep 2022 00:30:37 GMT (envelope-from git) Date: Thu, 8 Sep 2022 00:30:37 GMT Message-Id: <202209080030.2880UbLY001000@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-branches@FreeBSD.org From: Alexander Motin Subject: git: d62f7b1fb113 - stable/13 - hwpmc: Avoid touching MSR_DEBUGCTLMSR inside VMs. List-Id: Commits to the stable branches of the FreeBSD src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-branches List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-branches@freebsd.org X-BeenThere: dev-commits-src-branches@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: mav X-Git-Repository: src X-Git-Refname: refs/heads/stable/13 X-Git-Reftype: branch X-Git-Commit: d62f7b1fb113b61ab6677772080fc4437935c41b Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662597037; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=FEf/oKNtakR3A2f2fGdyt6HOB1h8XAGAIlxPoBj6Klg=; b=pcPtZ1lBRzWw5qPNNjKIpBHc8rQT3TLQLh3XftFJnxwX3B0RTMvxMMUVwp60G5oHd00CUc 5zkuCetbPB3o+qYWpiIWltuX4mpS5tMPYoowmtqDbbfb+zUb5n6JXu7RWSml/ZdXqDD838 HJuVhbweAxFqH6VpAzya+6DnawbcjGLFtfpYcK5MRKS17wWI+EdhRvxj3StKW63eEbeZAQ 3Q2KKD9i/sMmNRWPrvjDhtsJWc9zAQDgrTGVAD/Y6LKOhG7zhkdmB13utpfGn1b9QxZACq 6nVtuVc7PSJ+tIJa7sv6vGOwsmiGspuY+cNEGcosdBHaMnPotqNXf3woBn9j4Q== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662597037; a=rsa-sha256; cv=none; b=jxcaI1BplhZmZadC5XG9EqsnUf/zy7gJviaDtUQ9tbmrWXMXHzP8m8DZnvb7fg+WmTnN9D 1+ZQfEHCmXFG0G+8gnyH8r81baSMiN1gwal7ENhPvRlR9SojD0grFQM9KMx7BuV+4p/HEa 6trHizCSbMYjWsMUXryxGY08h7BZKPxqB4C6qtkwPo554anz8HkYJTgKK33SyI/dnEgE1S FkYLQcT6QNWaH+f56IsXNbpMWIleEhw6X74I1PKDdxHt58ve3iz8bj+mgBqrRW1Bl5vf4i bUrTGS/6jTioR8c6BXxFi1rXXFxMSn48rbCEaGCL5RxzHcoTggpkOp/JE7br0Q== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch stable/13 has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=d62f7b1fb113b61ab6677772080fc4437935c41b commit d62f7b1fb113b61ab6677772080fc4437935c41b Author: Alexander Motin AuthorDate: 2022-09-01 17:18:04 +0000 Commit: Alexander Motin CommitDate: 2022-09-08 00:30:30 +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 (cherry picked from commit 4e679d8aeaa86ce061b15c51fe9a5eae1eff7470) --- 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); }