From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 307213C01; Tue, 27 May 2025 17:35:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748367326; cv=none; b=c4ygvNHPNz/9vHZw9+TsFuX8U9jryxsUHyW5plT9fS2oCTc1Cv4G0x6/iY+PgfEbptxC+JvLbG1bUbqn5U0ixlw15jUfiAah0Zx1C6Ni6ybgWBZZhA+XVl0Q4l5j6TWMNrjrlIBUJSRqkE6vibFE52ESyhkoaMZzGgiKyb6tuCI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1748367326; c=relaxed/simple; bh=FsHK0YXwL3xbHowokLoHZCeoOWti/jLqsBEsyl40uTY=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PmHR0ROr/MIjS2nwXrErDKQE+LdOrkbUY2DuQKA//88DLLxK4pvsx1kOBN2Ht8X/pmdJUKKgGyIc5bMR8FAZDtPl41NK0k5aIVSGfCuMgMzXpVU+py4419qfM6W9YGiWMQtQpdQxO0N4J/N/5DWQpmGAHxb/nAEx7JSB6kaz39Q= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=jmUcyBoj; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="jmUcyBoj" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 930BEC4CEE9; Tue, 27 May 2025 17:35:25 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1748367326; bh=FsHK0YXwL3xbHowokLoHZCeoOWti/jLqsBEsyl40uTY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jmUcyBojF6HSEfcoQReML0472LjrFUw8HP+oXuJ5x41EN0/yoBxtI2WcULJ2F5r8Q +Cwu3zEUY7h7G0atgQXWBouEYqn4aZ2xmjJsffUYzdc4NrlRsZHg3u+sEmz72oHhFC ocDMcru5blzF4ECbOPtHlL7PPCBR1B19SEPc13cw= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, "Rob Herring (Arm)" , Anshuman Khandual , James Clark , Will Deacon , Sasha Levin Subject: [PATCH 6.14 321/783] perf: arm_pmuv3: Call kvm_vcpu_pmu_resync_el0() before enabling counters Date: Tue, 27 May 2025 18:21:58 +0200 Message-ID: <20250527162526.133134278@linuxfoundation.org> X-Mailer: git-send-email 2.49.0 In-Reply-To: <20250527162513.035720581@linuxfoundation.org> References: <20250527162513.035720581@linuxfoundation.org> User-Agent: quilt/0.68 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.14-stable review patch. If anyone has any objections, please let me know. ------------------ From: Rob Herring (Arm) [ Upstream commit 04bd15c4cbc3f7bd2399d1baab958c5e738dbfc9 ] Counting events related to setup of the PMU is not desired, but kvm_vcpu_pmu_resync_el0() is called just after the PMU counters have been enabled. Move the call to before enabling the counters. Signed-off-by: Rob Herring (Arm) Reviewed-by: Anshuman Khandual Tested-by: James Clark Link: https://lore.kernel.org/r/20250218-arm-brbe-v19-v20-1-4e9922fc2e8e@kernel.org Signed-off-by: Will Deacon Signed-off-by: Sasha Levin --- drivers/perf/arm_pmuv3.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/drivers/perf/arm_pmuv3.c b/drivers/perf/arm_pmuv3.c index 0e360feb3432e..9ebc950559c0a 100644 --- a/drivers/perf/arm_pmuv3.c +++ b/drivers/perf/arm_pmuv3.c @@ -825,10 +825,10 @@ static void armv8pmu_start(struct arm_pmu *cpu_pmu) else armv8pmu_disable_user_access(); + kvm_vcpu_pmu_resync_el0(); + /* Enable all counters */ armv8pmu_pmcr_write(armv8pmu_pmcr_read() | ARMV8_PMU_PMCR_E); - - kvm_vcpu_pmu_resync_el0(); } static void armv8pmu_stop(struct arm_pmu *cpu_pmu) -- 2.39.5