From nobody Thu Sep 01 17:23:23 2022 X-Original-To: dev-commits-src-main@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 4MJSYl6QNsz4b27V; Thu, 1 Sep 2022 17:23:23 +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 4MJSYl5sCZz3XZt; Thu, 1 Sep 2022 17:23:23 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662053003; 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=4kXVflFwQGe7l49eo++TOHk/VoxGxBKhPonToAmEuag=; b=doTB7Bhg1YdF070cKnVyR5JoMtGgVp8CqKkEL1AeDnfwA66iIjTJ1k0YcujBI6Fzey3BP8 5ZjF+Jv/hmkEmvOaPHmZzD0OqkqAitUDXlzNWy4UAEiGor+8kYn/Fll1teQmuXvpjHB6IF XRDouc/4UFadskChup6u0itS509HmstoEYHfSYe+lmIu+PVWsGGAOMu1tquu5lRS/LhMvl HejNJmsWZ1/JyHxnAifLLYdhfi4X83QD14m/25GweeJvOPffVG0bmVT1/0fpszQuFdHrkx JOUy3ZKUPJ8EbUzzp7PYttQFL9xAzn01vWXXWKczligC6Xl9uDyJZOPtB42vKg== 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 4MJSYl4sw7zY0v; Thu, 1 Sep 2022 17:23:23 +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 281HNN5v018340; Thu, 1 Sep 2022 17:23:23 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.16.1/8.16.1/Submit) id 281HNNxM018339; Thu, 1 Sep 2022 17:23:23 GMT (envelope-from git) Date: Thu, 1 Sep 2022 17:23:23 GMT Message-Id: <202209011723.281HNNxM018339@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Alexander Motin Subject: git: 4e679d8aeaa8 - main - hwpmc: Avoid touching MSR_DEBUGCTLMSR inside VMs. List-Id: Commit messages for the main branch of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-main List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-main@freebsd.org X-BeenThere: dev-commits-src-main@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/main X-Git-Reftype: branch X-Git-Commit: 4e679d8aeaa86ce061b15c51fe9a5eae1eff7470 Auto-Submitted: auto-generated ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1662053003; 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=4kXVflFwQGe7l49eo++TOHk/VoxGxBKhPonToAmEuag=; b=ctAoteoxMPbmGJUgeYp6FNr0vKqxGAd5W5QGYl754VsH64n17hzlenOOBh6bGdOrS0rPMa nSmY+SD/VY9njbwjhkItvpwTNm7AZGozZTQy5XaRLCAdRRBbf+WWEJENmtjy5qivBU8OhD 3PHijRAhYeGEVIk3d73yeZjM2m2vBbr92tuiGZj5gPpvgTfd/Y78k47JUaBea1JkJ80cmD D3IB5+RHCmvE/cbGFx8DhfWfMR23yNuzmK+PWS/UGeYXe+0mtTzGqhaa49ZnHpYGmtBtTE B6wmwr1JdQ9bxv02hH78BYZz+DAC3yWAzECllCB5TV/J+SqGMFSN8clr8wnq9A== ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1662053003; a=rsa-sha256; cv=none; b=R93cN2Qp7zfrtiMCZoxhFzxwjI17+14a8b8z7GYY8vFkodq+ZGCtMrtj+ch27EvfBWAIKw s8BFpeg6auW2dTZsKCxPA3h+UHAmfkxPg8IwYNJwmEHphHKxBjxP0p15p892UQlojEV4nR fAeGsO483IDm7vPCUgyXYWKwvg7SavlIbgu59jWWrkQ2s0Ogzlu04u96kss5Oko7NahLHH iq43Em74rHM9DrKP3+QOqUluomoGAbQTmFHjgOtawZgjMFFwUHYLzqs3HOz7CBL/o9fWlf o6Cw3bfl8wt2Yjmq1nmt5NFIb6mZizMm/oVlywG9r5uzL5GR4mu29Ea0C5b9Yg== ARC-Authentication-Results: i=1; mx1.freebsd.org; none X-ThisMailContainsUnwantedMimeParts: N The branch main has been updated by mav: URL: https://cgit.FreeBSD.org/src/commit/?id=4e679d8aeaa86ce061b15c51fe9a5eae1eff7470 commit 4e679d8aeaa86ce061b15c51fe9a5eae1eff7470 Author: Alexander Motin AuthorDate: 2022-09-01 17:18:04 +0000 Commit: Alexander Motin 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); }