From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C5425C433F5 for ; Mon, 21 Feb 2022 08:53:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1345752AbiBUIxm (ORCPT ); Mon, 21 Feb 2022 03:53:42 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:44708 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1345557AbiBUIwx (ORCPT ); Mon, 21 Feb 2022 03:52:53 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5B31B25E7; Mon, 21 Feb 2022 00:52:27 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id 0131BB80EB0; Mon, 21 Feb 2022 08:52:26 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1E24EC340F1; Mon, 21 Feb 2022 08:52:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645433544; bh=zZv4cf1Gxrqszl+G8uumJj1fJSQk+9B7NQtkVLy42R0=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=vZCyja1wFogUluo2T4uALMZeA5F6apJRd0RnCQjBMXF6UibuVSHe6RSY28c9rTRtC W63IF4K2XTihxZvQGoPVWkH2B+dSsw550N+zdwyVL9waipf1PXUwLRJ7gIlR7V12et 8V2dn/O+qdkBCDePl+4DrEzmNeldJY2lZUQqCmMc= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Jim Mattson , David Dunn , Paolo Bonzini , Sasha Levin Subject: [PATCH 4.9 29/33] KVM: x86/pmu: Use AMD64_RAW_EVENT_MASK for PERF_TYPE_RAW Date: Mon, 21 Feb 2022 09:49:22 +0100 Message-Id: <20220221084909.706175553@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084908.568970525@linuxfoundation.org> References: <20220221084908.568970525@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Jim Mattson [ Upstream commit 710c476514313c74045c41c0571bb5178fd16e3d ] AMD's event select is 3 nybbles, with the high nybble in bits 35:32 of a PerfEvtSeln MSR. Don't mask off the high nybble when configuring a RAW perf event. Fixes: ca724305a2b0 ("KVM: x86/vPMU: Implement AMD vPMU code for KVM") Signed-off-by: Jim Mattson Message-Id: <20220203014813.2130559-2-jmattson@google.com> Reviewed-by: David Dunn Signed-off-by: Paolo Bonzini Signed-off-by: Sasha Levin --- arch/x86/kvm/pmu.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/arch/x86/kvm/pmu.c b/arch/x86/kvm/pmu.c index 0827ee7d0e9b6..f1aa0b932c547 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -164,7 +164,7 @@ void reprogram_gp_counter(struct kvm_pmc *pmc, u64 eventsel) } if (type == PERF_TYPE_RAW) - config = eventsel & X86_RAW_EVENT_MASK; + config = eventsel & AMD64_RAW_EVENT_MASK; pmc_reprogram_counter(pmc, type, config, !(eventsel & ARCH_PERFMON_EVENTSEL_USR), -- 2.34.1