Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4368410pxb; Mon, 21 Feb 2022 19:18:11 -0800 (PST) X-Google-Smtp-Source: ABdhPJzfPe23iXESs+ZJdh4n+6WQ8oARRiN9VtVgHt/4/I3a/XI7g1kl5EO6lyNEuJ2R1L2LL96C X-Received: by 2002:a62:e317:0:b0:4ca:25ee:d633 with SMTP id g23-20020a62e317000000b004ca25eed633mr22639806pfh.23.1645499890749; Mon, 21 Feb 2022 19:18:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645499890; cv=none; d=google.com; s=arc-20160816; b=JlLWDOW2bqwAQfZP2hwZmLQFRUlqBsBg+F2g6WhDGs6tNNFDS4IjBj23l3wRK3a7Wu 3FJ9ExrR/2MG8Qz/iGeRNQzSV7eECo36p8N6t0uqj6hnD0tjUnZyMMsEKriRlsalUHk/ BrQzAXWwKrOIvQHRV9GonHjW049V1kcylcaQMZzzCNDxW9pAWeWq0/8Zc1F29fcUdvZd YjjaHWTvb3A4MNyxAHmPzD3F9pvEN4AJJ7JhdY9E/TTDpu0koqg1D8anE+9fVmxJVnHE GfVVIt5cgSspxyy2DTzTbNnnASEGxuxjiOI0eB54SqPo6XVELCzXC7V9oL/53BjhIELp MZ+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=PN3ujr05mJcu+yxdB46h6HR+TSFJCU0QRF+36gpZ/bI=; b=bzGu1TtW3UMdtNSvXdRgD+QxNB4jOJ+gybBCYb/xEOEeproUUHfB9Bpz/Bnx6Hc8SH RUeUTidsHoiVGT8s88nIlU/8gf76JzpEbnkBnBWjsDOVjPPray4vT7zZGEdCBYhz8Zff l+DFNk97hLI/q6xh4mEBJHL5FTiXlN5wAhjtILvfIdGgisjUwC3KggQQ1AX4Icf+QOJI duhUFrbhYvq0sc9O9BvaPEGu6XRVmuGCsCHSS3mhXuoIVJi0yfpmCadzbdN/mVXuDSPP X+z9mltY6EyfBD8i4F92rbDuqlrETAnmxcvYyzQBueEVKC/suK7y+zNR/iKSMd5NuNwi xk3A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CjLy1fm0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q18si878402plr.127.2022.02.21.19.17.55; Mon, 21 Feb 2022 19:18:10 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=CjLy1fm0; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1349153AbiBUJMG (ORCPT + 99 others); Mon, 21 Feb 2022 04:12:06 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:33974 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347587AbiBUJIi (ORCPT ); Mon, 21 Feb 2022 04:08:38 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 59725245A2; Mon, 21 Feb 2022 01:00:24 -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 CE143B80EB9; Mon, 21 Feb 2022 09:00:22 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D8144C340F1; Mon, 21 Feb 2022 09:00:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645434021; bh=xctn4KdYqFohpXKSojF1MJkD6sY2jg+PlDeaCt992FE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=CjLy1fm0CO0M7ccqQfhdvnyZuwhW69lm6QpR3SU1Lg86EbrxTKFxlPU4H7VjzhtmP +GpVOnHT64tL51OoRXSs9Ze1zbYY71imPPWQu4ijRL9/qnEcKRNjgu5C0KjO/cuIJh ISWEqwXtc5BEzzU35A6El8YqLPUbuG5BcOXKw9fQ= 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 5.4 66/80] KVM: x86/pmu: Use AMD64_RAW_EVENT_MASK for PERF_TYPE_RAW Date: Mon, 21 Feb 2022 09:49:46 +0100 Message-Id: <20220221084917.745909366@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084915.554151737@linuxfoundation.org> References: <20220221084915.554151737@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 46875bbd04198..e0e3776059af4 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -191,7 +191,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