Received: by 2002:a05:6359:c8b:b0:c7:702f:21d4 with SMTP id go11csp2274219rwb; Mon, 19 Sep 2022 02:31:34 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7hy8WbagWZA99GuQkrIbO0HQ3eZbfZmUrtgwC5yZaNMVRnU+4SomV74V9wKZKt4KUpqV2e X-Received: by 2002:a17:907:6e1d:b0:780:4bf6:543a with SMTP id sd29-20020a1709076e1d00b007804bf6543amr11522028ejc.255.1663579894464; Mon, 19 Sep 2022 02:31:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1663579894; cv=none; d=google.com; s=arc-20160816; b=FPlYxfKeCmo1bmGzEahM9ts5MyxXq428/bZv4jqG9kS92GDFNjMTI5JdD+OqhoPKNs HvIwc72ROSMQ2Od+LyxJlH6Yp4WPmZynEompCXseZQpcfiZr0XwlX7/tT6GLP7vZgqwS nWw5kKA4oP9Rfu1T+VsIIdG+i1L5S8iwEPWvB2gokFxIc+N73FG8ZzldURiCh5v7Bfq6 O92zNOJR6cqN/xb47c67SpmwPhf53fI1rxwsDZl6LEoVe5Jhwg7cXkRjUmzh73MmHcHP RJWoTCVkvNbYkIPSUkAaxtKMPo4YMIUvCFXRv14F/g4Tz8+cpBxURgxj2e7RUHASv+wA UkkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:in-reply-to:from :references:cc:to:content-language:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=f4lJ3N0uKHqbaTlJ2yJchpCS7uT21SgUgyF132AXj88=; b=lbnANl3/6f8+8tR0CytjEEIhbd2LByPVEsKPb5lfqOksmAHRGky+VH20zf91dm+Qip jmWZLMIR5YpxJJyTdEUy4b/LI0aRn12UPY9bod06bZmkAlnOoL522UdfPM0uJp6Q3P7v VXlhR1FurF8Bx0i6GyvEuQIiAXaM1LzgXYhzRb2ZoZT+jgMziVFauWpdfbnx34C/98dl o7hdKMfy8H4yeL0Gmbrr8s2Zm1312WZfTByM1bVAAREH/cNm1n3Ah5YBWSVxxytCmXva fiyNNetnhyNE1i4I4jE4sAJxdfhl+Tv6RMqHYgzDMKXuBReGkTQnZqknFdHmotFtITK0 E/gQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20210112 header.b=Kvt6Ixiv; 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=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id cw10-20020a170906c78a00b007416895306fsi20251644ejb.645.2022.09.19.02.31.09; Mon, 19 Sep 2022 02:31:34 -0700 (PDT) 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=@gmail.com header.s=20210112 header.b=Kvt6Ixiv; 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=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229895AbiISIuN (ORCPT + 99 others); Mon, 19 Sep 2022 04:50:13 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46638 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230179AbiISItq (ORCPT ); Mon, 19 Sep 2022 04:49:46 -0400 Received: from mail-pg1-x52a.google.com (mail-pg1-x52a.google.com [IPv6:2607:f8b0:4864:20::52a]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 119CC237EC; Mon, 19 Sep 2022 01:49:22 -0700 (PDT) Received: by mail-pg1-x52a.google.com with SMTP id bi3so99351pgb.11; Mon, 19 Sep 2022 01:49:22 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :from:to:cc:subject:date; bh=f4lJ3N0uKHqbaTlJ2yJchpCS7uT21SgUgyF132AXj88=; b=Kvt6IxivfZ9AdelKHj+0aVmVKjmSEK59vtDHoyQlD/1I0ytsotSWHqyBD2fL6vqMQB R4sM8C3e7773ITsR5x2bG3GVybnaeQjcRbeRjK1yBz2y1LEE0uA2Lr3ioFSCdbPrXhY5 Lz+pLENV6AedTARCPjT3lQoSC4RyuNdo3Wy0MZRlaX85qsulXcEgRLCP9xWjvHzwspZU 6TW3L70d35OPXjAKS4J/v0p51LHiDn3aLisTbfvWoiJAA2GDoFqhWTurroc6oCOYKilf oOnt3KcxndHTbS1r77Z4pW22/qLhajoKsOb45SJlYBp98k9pT7YZh+VsRL53p2zYEC3T 39Cw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:in-reply-to:from:references:cc:to :content-language:subject:user-agent:mime-version:date:message-id :x-gm-message-state:from:to:cc:subject:date; bh=f4lJ3N0uKHqbaTlJ2yJchpCS7uT21SgUgyF132AXj88=; b=YQkmssABbvmdieD8mQjLKcj6KS+iRtcLNojBxFSL+7onslYPswLa3s0POynpH2ifrt lNcqe8BYfx2kB4jlabWndILqa1O6xL9z8FYYH79wt6TkGE+HfHoEY7b5IK6ubVr4cV2L zThh0SR1i8aQUqhfLXugxk3XSVwnr8TRyIZj2PEFX11Ym17u0d+Ef0TNwZ8GMBJBXLCD GJKDremaUObmfUyFe6kOrHMyJOJW6TinQlbJwd4DZpwz3LUR1kHYl5f0V9Q60Y52URPX fLDOGqybL7z8wvAcH/V8DK7QFvi7Gyr+89hHQz4gA+ZdrleLQd/r0uX7k+YTD3JYPFtV gQuw== X-Gm-Message-State: ACrzQf21DQ/6ukqFpQ1Ynv6CQ6I0xWnWH7sJZq7SREylQlnVgQziQcP5 hUNmmIuD34sMlNiT+PuiWqk= X-Received: by 2002:aa7:8058:0:b0:54f:1644:a4fd with SMTP id y24-20020aa78058000000b0054f1644a4fdmr3525961pfm.63.1663577351766; Mon, 19 Sep 2022 01:49:11 -0700 (PDT) Received: from [192.168.255.10] ([103.7.29.32]) by smtp.gmail.com with ESMTPSA id w16-20020aa79550000000b0054555418ca4sm14692040pfq.29.2022.09.19.01.49.09 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Mon, 19 Sep 2022 01:49:11 -0700 (PDT) Message-ID: Date: Mon, 19 Sep 2022 16:49:04 +0800 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.13.0 Subject: Re: [PATCH v2 1/3] KVM: x86/pmu: Stop adding speculative Intel GP PMCs that don't exist yet Content-Language: en-US To: Jim Mattson Cc: Sean Christopherson , Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org, Vitaly Kuznetsov References: <20220907104838.8424-1-likexu@tencent.com> From: Like Xu In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FREEMAIL_FROM,NICE_REPLY_A, RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS 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 On 8/9/2022 12:33 am, Jim Mattson wrote: > On Wed, Sep 7, 2022 at 3:48 AM Like Xu wrote: >> >> From: Like Xu >> >> The Intel April 2022 SDM - Table 2-2. IA-32 Architectural MSRs adds >> a new architectural IA32_OVERCLOCKING_STATUS msr (0x195), plus the >> presence of IA32_CORE_CAPABILITIES (0xCF), the theoretical effective >> maximum value of the Intel GP PMCs is 14 (0xCF - 0xC1) instead of 18. >> >> But the conclusion of this speculation "14" is very fragile and can >> easily be overturned once Intel declares another meaningful arch msr >> in the above reserved range, and even worse, Intel probably put PMCs >> 8-15 in a completely different range of MSR indices. > > The last clause is just conjecture. > >> A conservative proposal would be to stop at the maximum number of Intel >> GP PMCs supported today. Also subsequent changes would limit both AMD >> and Intel on the number of GP counter supported by KVM. >> >> There are some boxes like Intel P4 may indeed have 18 counters, but >> those counters are in a completely different msr address range and do >> not strictly adhere to the Intel Arch PMU specification, and will not >> be supported by KVM in the near future. > > The P4 PMU isn't virtualized by KVM today, is it? According to [1], P4 PMU has ZERO number of Intel Architectural Events, and the KVM support for non Intel Arch PMUs has been dropped recently. [1] https://www.intel.com/content/dam/develop/external/us/en/documents/30320-nehalem-pmu-programming-guide-core.pdf > >> >> Cc: Vitaly Kuznetsov >> Suggested-by: Jim Mattson >> Signed-off-by: Like Xu > > Please put the "Fixes" tag back. You convinced me that it should be there. > > Reviewed-by: Jim Mattson