Received: by 2002:a05:6a10:8c0a:0:0:0:0 with SMTP id go10csp151563pxb; Fri, 15 Jan 2021 09:33:44 -0800 (PST) X-Google-Smtp-Source: ABdhPJw7hOMbqIQR5aACtKEcDFURoD9iskZPR3inSeQt0jQ4IgdNH4juFNPzMRPZ90jupN3mNHNJ X-Received: by 2002:a17:907:1629:: with SMTP id hb41mr9240197ejc.197.1610732023823; Fri, 15 Jan 2021 09:33:43 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1610732023; cv=none; d=google.com; s=arc-20160816; b=0WTDg5IcbaATgXeTx/ucvgGCVVZ3/Q1JOy+VhVinURNUSTCAlCRisJIydC1cBV29ED GPc3pPuu1C3P2JnYr4dqIa7n5FjLIBQVMhOcZ5PB4mOfe46RVDOviZC9thWkADucsRir ikRlr/ndHdFqTxdVAg8x1sJRunnSspazeFPn8jmB/LfjR91znuWO8en/v6Uc8dFza5Jj IyiyvAlMZw/ETjz/U5NgR7PF8dw14dkwb3dkpFhTK9PFtSRYCarlba3ctZRW87/7QnKv 2yZnECZyy6rlK/9zKIoKKoffhHStwp1X2FRw+ZOh5s+QErW3bbKjohyD2aFYs+bxKAvy j69A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=e4iNbSaLQouSoi2ExpAGatGG16APB7XlfIPRSEq48z4=; b=eGw6fAv5c3POe3+hU5QdWKPuJkzIyf2jm0sVx9GUI/+Hymeb3ItaXry/+4tqz3fJ6e 5X/ENoIRu6qKUBh3zdiRMeltwaZKdKnITwvJ7FKiFq1AiFQnFGxBe36NgY7A5JJxuEZE rNG0ELMXY2G6dpSn01tqsNxiri5esVWmseg/tmiqrIq0BX+v1iNtA7hc2wNDJMGlURzA Gsk6XiR2sqaaFWI4qLKeIb2NahFRHrJ3ZyV3cJnHUjaEPo1K/Lfa7SrWCn5+rYpNqfE+ 4w2h6ix3DkhK28Fu+f5JG1sEPTkR2H5b8oo2+EiDUULnsNsV/4ULIWe5L22EPhdJ8gQx xn9Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NjhRYse+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id m14si3950427ejj.422.2021.01.15.09.33.17; Fri, 15 Jan 2021 09:33:43 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=NjhRYse+; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S2387567AbhAORbO (ORCPT + 99 others); Fri, 15 Jan 2021 12:31:14 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2387452AbhAORbN (ORCPT ); Fri, 15 Jan 2021 12:31:13 -0500 Received: from mail-pj1-x102c.google.com (mail-pj1-x102c.google.com [IPv6:2607:f8b0:4864:20::102c]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 57C11C0613D3 for ; Fri, 15 Jan 2021 09:30:33 -0800 (PST) Received: by mail-pj1-x102c.google.com with SMTP id m5so5584913pjv.5 for ; Fri, 15 Jan 2021 09:30:33 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=e4iNbSaLQouSoi2ExpAGatGG16APB7XlfIPRSEq48z4=; b=NjhRYse+Dv0G0pEtZJfNMACvCNU2k1bZFy3Aj4UihkW8tngtjB3w7xJUpChQd6VIbp yKU98i/BHVE4aRuWcHp5hFmIfkTKiccF1bBg7a+lt2+J+TohKPg+qkJ/uzxJNmkwsgei go6SsCMRap4Is5wxf0xvdhgUuLaigkJGULjWnBNIwDuR64EyOts1lDAGWpm0xDYvC36f E96ozRAiLfo8k8xFGmhJempGffltRrdnKYnaeH+XOOYLAheQ2kvzzo3bQVNLgMjSIT56 MVa5AdwyBmMAeQH7RNU/7uQekaTPUx7l0w25UjgEZUgj8ofAznXFphJFhiBm/kyeyHwu PCTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=e4iNbSaLQouSoi2ExpAGatGG16APB7XlfIPRSEq48z4=; b=Npkclly+xapVIw8x/T988O7/HXERa3sUOP/dclujn3Y/Ev9o8rmuaQPbftYha3F/NR I7UYjhlgwVOPHPyv4ukhT6Cqgz1TgTSILD/2vWbH0r0s739yE59B9LRdJCRcmM6dzxgX PL4Bkb7GYBNXUQc9Yt1z5EJVlTXBCNLcOdmniZEWVexlDwGow3i9U7u963b72tFfoB5g OV6uo3vVADHhO/hRrTBiIwKxtK5UXjdMpxcsjPNuEOobtPu+nKIo0+EYPCQs9kcRr2Z9 Qef7hgO0Gr3UlmSd+V0wFmjs/tCN/N6PnTOyM4nMVYKvhFf4lpQ9oA254Y3VvbJR8sIW 2wZA== X-Gm-Message-State: AOAM530rm/UrxbGmxGKkSxeBCCYulhHizwpKGQdiryNTNlJvofbZqnmY ZfmtJiSZUXZ7g2IOoeswv/bJrA== X-Received: by 2002:a17:90b:1894:: with SMTP id mn20mr11751354pjb.100.1610731832726; Fri, 15 Jan 2021 09:30:32 -0800 (PST) Received: from google.com ([2620:15c:f:10:1ea0:b8ff:fe73:50f5]) by smtp.gmail.com with ESMTPSA id l197sm8824100pfd.97.2021.01.15.09.30.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 15 Jan 2021 09:30:31 -0800 (PST) Date: Fri, 15 Jan 2021 09:30:24 -0800 From: Sean Christopherson To: Like Xu Cc: Paolo Bonzini , Stephane Eranian , Vitaly Kuznetsov , Wanpeng Li , Jim Mattson , Joerg Roedel , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] KVM: x86/pmu: Fix HW_REF_CPU_CYCLES event pseudo-encoding in intel_arch_events[] Message-ID: References: <20201230081916.63417-1-like.xu@linux.intel.com> <1ff5381c-3057-7ca2-6f62-bbdcefd8e427@linux.intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1ff5381c-3057-7ca2-6f62-bbdcefd8e427@linux.intel.com> Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 15, 2021, Like Xu wrote: > Ping ? > > On 2020/12/30 16:19, Like Xu wrote: > > The HW_REF_CPU_CYCLES event on the fixed counter 2 is pseudo-encoded as > > 0x0300 in the intel_perfmon_event_map[]. Correct its usage. > > > > Fixes: 62079d8a4312 ("KVM: PMU: add proper support for fixed counter 2") > > Signed-off-by: Like Xu Reviewed-by: Sean Christopherson > > --- > > arch/x86/kvm/vmx/pmu_intel.c | 2 +- > > 1 file changed, 1 insertion(+), 1 deletion(-) > > > > diff --git a/arch/x86/kvm/vmx/pmu_intel.c b/arch/x86/kvm/vmx/pmu_intel.c > > index a886a47daebd..013e8d253dfa 100644 > > --- a/arch/x86/kvm/vmx/pmu_intel.c > > +++ b/arch/x86/kvm/vmx/pmu_intel.c > > @@ -29,7 +29,7 @@ static struct kvm_event_hw_type_mapping intel_arch_events[] = { > > [4] = { 0x2e, 0x41, PERF_COUNT_HW_CACHE_MISSES }, > > [5] = { 0xc4, 0x00, PERF_COUNT_HW_BRANCH_INSTRUCTIONS }, > > [6] = { 0xc5, 0x00, PERF_COUNT_HW_BRANCH_MISSES }, > > - [7] = { 0x00, 0x30, PERF_COUNT_HW_REF_CPU_CYCLES }, > > + [7] = { 0x00, 0x03, PERF_COUNT_HW_REF_CPU_CYCLES }, In a follow up patch, would it be sane/appropriate to define these magic numbers in asm/perf_event.h and share them between intel_perfmon_event_map and intel_arch_events? Without this patch, it's not at all obvious that these are intended to align with the Core (arch?) event definitions. > > }; > > /* mapping between fixed pmc index and intel_arch_events array */ >