Received: by 2002:a05:6358:489b:b0:bb:da1:e618 with SMTP id x27csp1276255rwn; Thu, 8 Sep 2022 16:51:18 -0700 (PDT) X-Google-Smtp-Source: AA6agR7BchYmFWpkvBN/zQJeGBlvJRvwOwugVHnMB0Gr1ynh9WxThEMkaiTKcnwsDmyVqRZsIM4F X-Received: by 2002:a05:6512:39c9:b0:48b:90c2:da46 with SMTP id k9-20020a05651239c900b0048b90c2da46mr3332937lfu.571.1662681078339; Thu, 08 Sep 2022 16:51:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1662681078; cv=none; d=google.com; s=arc-20160816; b=j0cEhugQP+xC59zUARKpYpDSkYGULTbaAkPEK/EiAWPaey5KGp1g49vISCV8opOA5D S5uWzgGcXefBGzes5Q7nOksBq8oVJM/e1xRN2vLLpBkN0l8eb8/N7yA0xM4BUnH8Ijq+ fGusbSGX5HpcLfKYDCIF3Y1ceuTKZBprFhBdRmdziW8d4Um0SR3D1ht7bHerJdNOd2HG t0aPpmb1nijFB5hG06rnZDAfNt2E0GAr9NMmLR5S1A7Ixz+dGfeBg1tIK+J2ATLt67A4 tW+zpsyJkUfJTkvfJZtTSnqmsahh3AUh/1IzM+WqghrmWfT5fJr5CLtqoGqMbl8HffJZ 5q5w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=x84tAzemIZD1nMC7iUsQKY4UVtWo/vfIUvZtcXbQwZI=; b=t5ncvFUtAXDiX+px5Z9oq6oCwxKcUH7ffyw81Qeiw4M+vG4KZ3+y/5iOC/KPNbL6Qo 6gjqTCnhtbOFTzFMFwE/luGOiKQAgojavWL3PBV54vYa0SRqDGt7f8VXRVx4oOV3cFnU +UN+NS+McJa4s8FiMCj/8sL9Zfhl6zTn4+wxvkd7gWIJxeI+GfWM7SFVHiGlliInmC9Q I+KKh31xOZIFP6SApxBDC+6CXgkZDQjDVtsnh9ZlxbaYccFqb4Hll6ZYMfwfNpD1QXLE 99Arj3nyVZBkLK7xTX0iIDUcILdYWmPvatnasSO3vFvm2yZKO1cKXfK+OV8hD4K5zZxd dxrg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20210112 header.b=d2eDFZ5j; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id d7-20020a05651c01c700b0026acbb40daasi96570ljn.620.2022.09.08.16.50.49; Thu, 08 Sep 2022 16:51:18 -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=@google.com header.s=20210112 header.b=d2eDFZ5j; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229764AbiIHXPK (ORCPT + 99 others); Thu, 8 Sep 2022 19:15:10 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48918 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229566AbiIHXPH (ORCPT ); Thu, 8 Sep 2022 19:15:07 -0400 Received: from mail-oa1-x2b.google.com (mail-oa1-x2b.google.com [IPv6:2001:4860:4864:20::2b]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id CF4D22B61A for ; Thu, 8 Sep 2022 16:15:06 -0700 (PDT) Received: by mail-oa1-x2b.google.com with SMTP id 586e51a60fabf-12803ac8113so15220526fac.8 for ; Thu, 08 Sep 2022 16:15:06 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date; bh=x84tAzemIZD1nMC7iUsQKY4UVtWo/vfIUvZtcXbQwZI=; b=d2eDFZ5jZL+0zQOD2kyntF4UPUCwmmTg33IlQRUfzlOhmTfpZrtBlgD01+9Dn8o+Ut BmUpqnJ7xIzsL3uERZqKTla68Av96gvy3bc5xrucPdZVUr/gXRMWz8YA79xzKL0kb8+l 0DB13SkzysD1UfJaO/TA2tHw0BtLgV9EBR6hADRafKyKoS3OEujOHUx8j0BtVYmU7V+U WTOca5RXzw45XLtIFej8+mRacT5odAeSy0o/Z6rKGXolehQenvGHIR2ddrU3cMXBi7tw IFDxN3Ge9p3BzkZ6T/Xvh+erEAAAamWApPGgJK52ztldLH7B92yl5wkqzoLlrUMKDqWy haTA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:x-gm-message-state:from:to:cc:subject:date; bh=x84tAzemIZD1nMC7iUsQKY4UVtWo/vfIUvZtcXbQwZI=; b=K4yaNpl67ml90gUSFNRcYlerjVIsCsqm54UUIndSe34ipUZDhaB/DY1tM6GkwRVDvS di8hoO5JigcclbtkqHrhdi/SMAwwX+gMvdjIch4AhEY7bWg3llbVChpaoA/9orlQrS+J 2xQWd5E07Ke1P1pbldRe7kw85DWlaRXKaQIfOer80fx82vji0LDNdz1EKcQFloPb1lDK FW9m4S60B3ayqMYyuav7+5rbfFMUxA8Iw+VLyG05E5RYQxIvlZvdH6wQDj0Co75aP69V iBji6xoTQiG4x5lGmhCFm7h8COnvtgVNkvnLjPQjY/0egfj1yvazBGAqKHP6IVoryFac u2jA== X-Gm-Message-State: ACgBeo39mi2StTlZT/EpgdWFQF9KdnNMvORJrIrdwjB+Ce+faV4RA5f3 BBcVBs40o40I2Rj1Sh3Rz1ep4+ez4tEYGvc3pyAGsg== X-Received: by 2002:a05:6808:150f:b0:343:3202:91cf with SMTP id u15-20020a056808150f00b00343320291cfmr2456127oiw.112.1662678905621; Thu, 08 Sep 2022 16:15:05 -0700 (PDT) MIME-Version: 1.0 References: <20220905123946.95223-1-likexu@tencent.com> <20220905123946.95223-5-likexu@tencent.com> <0e0f773b-0dde-2282-c2d0-fad2311f59a7@gmail.com> <63e6c2da-653f-6f0d-8d56-f1c24122c76d@amd.com> In-Reply-To: <63e6c2da-653f-6f0d-8d56-f1c24122c76d@amd.com> From: Jim Mattson Date: Thu, 8 Sep 2022 16:14:54 -0700 Message-ID: Subject: Re: [PATCH 4/4] KVM: x86/cpuid: Add AMD CPUID ExtPerfMonAndDbg leaf 0x80000022 To: Sandipan Das Cc: Like Xu , Sean Christopherson , Paolo Bonzini , kvm@vger.kernel.org, linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-17.6 required=5.0 tests=BAYES_00,DKIMWL_WL_MED, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF, ENV_AND_HDR_SPF_MATCH,RCVD_IN_DNSWL_NONE,SPF_HELO_NONE,SPF_PASS, T_SCC_BODY_TEXT_LINE,USER_IN_DEF_DKIM_WL,USER_IN_DEF_SPF_WL autolearn=unavailable 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 Wed, Sep 7, 2022 at 11:00 PM Sandipan Das wrote: > This is the suggested method for detecting the number of counters: > > If CPUID Fn8000_0022_EAX[PerfMonV2] is set, then use the new interface in > CPUID Fn8000_0022_EBX to determine the number of counters. > > Else if CPUID Fn8000_0001_ECX[PerfCtrExtCore] is set, then six counters > are available. > > Else, four legacy counters are available. > > There will be an APM update that will have this information in the > "Detecting Hardware Support for Performance Counters" section. Nonetheless, for compatibility with old software, Fn8000_0022_EBX can never report less than four counters (or six, if Fn8000_0001_ECX[PerfCtrExtCore] is set).