Received: by 2002:a05:6a10:7420:0:0:0:0 with SMTP id hk32csp4161724pxb; Mon, 21 Feb 2022 13:40:14 -0800 (PST) X-Google-Smtp-Source: ABdhPJxNbIhR6fKnRuAXCj0gnZUr/poJPE2hTnbm3Ws41rWXxWdMokLBKe0/5lWelY0FQEFBRyct X-Received: by 2002:a17:90b:4005:b0:1bc:5def:97a8 with SMTP id ie5-20020a17090b400500b001bc5def97a8mr829294pjb.231.1645479614714; Mon, 21 Feb 2022 13:40:14 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1645479614; cv=none; d=google.com; s=arc-20160816; b=omGtQ6gLvPY48pZCk9Omop3TJDyWBqTpjzUkI/zWHDkmSGWYqgQxHYWyp6dBcrCoTa Be8j8nNIa8HgEI6BiADnr4ibFE66f9G5gHI6NsrhO+s26UDQ4e0da1XfGtrJAqs6E2we MtHJfxG71CNYOfx5tSRPacVrIWTvACGElsiTtDWgM16+P1hMiHVhux9vm4Yj9zTehvkM kvrYmtnFaz/igfnX1x/kOWa3qCI+eq5U3fdReDBwSP44i1jXsZtpEODakxuyKtNVAaOf ZEVeX2LTIRAnQTLQrepO5NBwvTdnG4wDEcFof5NyKGJMsSzWnS7afdv8ri/zf7NmtHAR cIpg== 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=am5eO1HqdLGj5Ab0MlX5qSlp0hpPwnWMITVwkIioM9Q=; b=vzrMPLXA6ByCszudXSTdg0ckGudy8czbPrDqA6fkdqGkynffYEu/oVi4r9OznGxc1b W61bcxB7FlODvBx8LMOVqeP2L9CbB904tS1WkJbfqKOtO34KThDb1+L9M4T0vQk82AIi i1X0o5ytI3heCUUc713jc/3E9Au6hgaOBouh+RmRODONIgm4IZgcQFXEsFlnsVO4RCHc tkqiIn3FDqI1lACqkvEl9twX7ntud6+SC05T3Hmq/pA4ArAAXLTyiUeKQ2H+B4gTpGce SG/bYWX1d/JBygfhUArZ7HIXewNx86QO5kEwZodbPXyBxtyUTKB62NdbIi68gSN+ooD4 +hhA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="eJ7hsv/L"; 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 m12si4198282pgu.455.2022.02.21.13.39.59; Mon, 21 Feb 2022 13:40:14 -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="eJ7hsv/L"; 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 S1347176AbiBUJGH (ORCPT + 99 others); Mon, 21 Feb 2022 04:06:07 -0500 Received: from mxb-00190b01.gslb.pphosted.com ([23.128.96.19]:58048 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1348004AbiBUJCM (ORCPT ); Mon, 21 Feb 2022 04:02:12 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 35DF52A71F; Mon, 21 Feb 2022 00:57: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 BAD87B80EAF; Mon, 21 Feb 2022 08:56:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D7120C340E9; Mon, 21 Feb 2022 08:56:50 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1645433811; bh=A8RtHxPSiVbrzT1K6DRZ6tVHZyVui5YgZ47NX4cDOkU=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eJ7hsv/L7bI9Pjt26LKK2VR/B36q43LDagpQZcn7yPR6g5Yx3o/2JJB2sV0l2mcrF 87W7xvbc7Q+PTXeXD1OtckWNiShikKhTfzMPq8Jy/Rk8+53F4wRVnxzQVtBo7Uzuno S6N9ByanYp0T2vnd8F2x4S3BjOuMafWBd/ftBsl4= 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.19 49/58] KVM: x86/pmu: Use AMD64_RAW_EVENT_MASK for PERF_TYPE_RAW Date: Mon, 21 Feb 2022 09:49:42 +0100 Message-Id: <20220221084913.456697491@linuxfoundation.org> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20220221084911.895146879@linuxfoundation.org> References: <20220221084911.895146879@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 acc8d217f6565..ad3d39c00d7fc 100644 --- a/arch/x86/kvm/pmu.c +++ b/arch/x86/kvm/pmu.c @@ -171,7 +171,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