Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp2492149rwb; Mon, 15 Aug 2022 06:29:00 -0700 (PDT) X-Google-Smtp-Source: AA6agR4W87FEEDiJE9/FkUQspntB8tHkhgk4kboW15UhyLXknYFNzRcUK1DR/7KA0IeQFUHFEbF0 X-Received: by 2002:a05:6402:430e:b0:43d:1cf6:61ec with SMTP id m14-20020a056402430e00b0043d1cf661ecmr14380435edc.194.1660570140266; Mon, 15 Aug 2022 06:29:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660570140; cv=none; d=google.com; s=arc-20160816; b=YGsB9jPQ95jOCUW3wCotfN+cagV9RMU3oNmqRwYct6qun5Oesg1wqwq5VZ5DCCBhtI D4aIVBXQ0zAy3cyMcNrRmJeUvQkVVHfleTUkhY9JrYolkH02rBHQ6lX1UvxiwXb9M1aT vSl9lu5x6BpLBaeWdS5dQeqCcNI6QI/V9F1bIFFD0exseBvLi9TqkR+U6yNrpRc6xt7V G3Q8nCya3e8SoTEWZURmzitA9P33+mAj7LJ+hd4HqTO4tKKpIAiZSvG2i+I0K/xfB32g f2J1XCYxmP5CpA3Q5xLCEXj3kkXXdypsL0USEbQXgDatBCFKdfLMFHC1COzdqCsAf3A3 p3cQ== 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 :content-language:references:cc:to:subject:user-agent:mime-version :date:message-id:dkim-signature; bh=xd5/YBgCtMsYGlrk7dnEfIC2kk5//J6m7qDCs/i3JsA=; b=lgoa+lwTvP+I9xy9aefgjypaYjJONBbegE7Mf7ky8eVQwEI+BtdhQ+17ZlkmRvcscz WC+Thq2LjX/ryOpSaLYK7cMi5g19d/cBzEq43ZeFU0BenCNX1BxS3CATxmFOb3VU7ArE yyvXCb1n9cOn+JqQ6ANDFeUQ29/eZUueA8ISmCl30FpqtJZSKhji5AZIbBIn1UzaacZg OnHsz7zUtqhQn3WydhZ5Ty5f9q2ghxUrslNWiCrN5FruvNfFwBjP5xwMRUoyhoZfvfkZ q3+iF+BiZIL6j2Tw10bELhKCYtRrn9D1KJFuf0XpCe2tDITEpxJBDtBvjsXe94D8pLEV LG0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=GjJ52App; 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=intel.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id n27-20020a170906089b00b007310a9a6651si6804741eje.594.2022.08.15.06.28.34; Mon, 15 Aug 2022 06:29:00 -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=@intel.com header.s=Intel header.b=GjJ52App; 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=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242080AbiHONGG (ORCPT + 99 others); Mon, 15 Aug 2022 09:06:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46416 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231493AbiHONGE (ORCPT ); Mon, 15 Aug 2022 09:06:04 -0400 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 22DCF19031; Mon, 15 Aug 2022 06:06:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1660568764; x=1692104764; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=m2EuSMgDC5x1/7VKkKGbdxtg9/vb5ykdj4i/kmeCnAY=; b=GjJ52App2hztcqVIHsAaVntmsVe8zeDm+i9B6AUYlulhDgoQbbmflKfc s932u9uW90MbYQxUB030L9XLGivEb9bPLeeO9uyDTdYgiPxf+g15LQCk2 Fqtg9uZfcFpRjPusRhegdNWajGDoFq1hGeLwCLvSBOD/Hvx3u1kJRS6hi kqYjAmKMhBbCgSAVlZeFm9eihVdQCzMMLN4ThTH7pT4bVk6eFcMnTXwNL QGPv4wKhNHN3KqZ40sqtcPkQ2MqfaqFkKpxYXZJqEcm654P13UtRSjzL+ OqQa31B7Z7jzZ21A4iFLQxN1454qIVLKTDlQsUDMTpsA2KNsMG0zL9+Ac w==; X-IronPort-AV: E=McAfee;i="6400,9594,10440"; a="317936435" X-IronPort-AV: E=Sophos;i="5.93,238,1654585200"; d="scan'208";a="317936435" Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 15 Aug 2022 06:06:03 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.93,238,1654585200"; d="scan'208";a="674825396" Received: from linux.intel.com ([10.54.29.200]) by fmsmga004.fm.intel.com with ESMTP; 15 Aug 2022 06:06:03 -0700 Received: from [10.252.214.254] (kliang2-mobl1.ccr.corp.intel.com [10.252.214.254]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by linux.intel.com (Postfix) with ESMTPS id 64857580C50; Mon, 15 Aug 2022 06:06:02 -0700 (PDT) Message-ID: <952632db-b090-ceb9-1467-a6b598ca2b02@linux.intel.com> Date: Mon, 15 Aug 2022 09:06:01 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Windows NT 10.0; Win64; x64; rv:102.0) Gecko/20100101 Thunderbird/102.1.2 Subject: Re: [PATCH v2 1/7] perf/x86/core: Update x86_pmu.pebs_capable for ICELAKE_{X,D} To: Peter Zijlstra , Like Xu Cc: Paolo Bonzini , Sean Christopherson , Jim Mattson , linux-kernel@vger.kernel.org, kvm@vger.kernel.org References: <20220721103549.49543-1-likexu@tencent.com> <20220721103549.49543-2-likexu@tencent.com> <959fedce-aada-50e4-ce8d-a842d18439fa@redhat.com> <94e6c414-38e1-ebd7-0161-34548f0b5aae@gmail.com> Content-Language: en-US From: "Liang, Kan" In-Reply-To: Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-7.0 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,NICE_REPLY_A,RCVD_IN_DNSWL_HI, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE, 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 On 2022-08-15 7:51 a.m., Peter Zijlstra wrote: > On Mon, Aug 15, 2022 at 05:43:34PM +0800, Like Xu wrote: > >>> diff --git a/arch/x86/events/intel/core.c b/arch/x86/events/intel/core.c >>> index 2db93498ff71..b42c1beb9924 100644 >>> --- a/arch/x86/events/intel/core.c >>> +++ b/arch/x86/events/intel/core.c >>> @@ -5933,7 +5933,6 @@ __init int intel_pmu_init(void) >>> x86_pmu.pebs_aliases = NULL; >>> x86_pmu.pebs_prec_dist = true; >>> x86_pmu.lbr_pt_coexist = true; >>> - x86_pmu.pebs_capable = ~0ULL; >>> x86_pmu.flags |= PMU_FL_HAS_RSP_1; >>> x86_pmu.flags |= PMU_FL_PEBS_ALL; >>> x86_pmu.get_event_constraints = glp_get_event_constraints; >>> @@ -6291,7 +6290,6 @@ __init int intel_pmu_init(void) >>> x86_pmu.pebs_aliases = NULL; >>> x86_pmu.pebs_prec_dist = true; >>> x86_pmu.pebs_block = true; >>> - x86_pmu.pebs_capable = ~0ULL; >>> x86_pmu.flags |= PMU_FL_HAS_RSP_1; >>> x86_pmu.flags |= PMU_FL_NO_HT_SHARING; >>> x86_pmu.flags |= PMU_FL_PEBS_ALL; >>> @@ -6337,7 +6335,6 @@ __init int intel_pmu_init(void) >>> x86_pmu.pebs_aliases = NULL; >>> x86_pmu.pebs_prec_dist = true; >>> x86_pmu.pebs_block = true; >>> - x86_pmu.pebs_capable = ~0ULL; >>> x86_pmu.flags |= PMU_FL_HAS_RSP_1; >>> x86_pmu.flags |= PMU_FL_NO_HT_SHARING; >>> x86_pmu.flags |= PMU_FL_PEBS_ALL; >>> diff --git a/arch/x86/events/intel/ds.c b/arch/x86/events/intel/ds.c >>> index ba60427caa6d..e2da643632b9 100644 >>> --- a/arch/x86/events/intel/ds.c >>> +++ b/arch/x86/events/intel/ds.c >>> @@ -2258,6 +2258,7 @@ void __init intel_ds_init(void) >>> x86_pmu.drain_pebs = intel_pmu_drain_pebs_icl; >>> x86_pmu.pebs_record_size = sizeof(struct pebs_basic); >>> if (x86_pmu.intel_cap.pebs_baseline) { >>> + x86_pmu.pebs_capable = ~0ULL; >> >> The two features of "Extended PEBS (about pebs_capable)" and "Adaptive PEBS >> (about pebs_baseline)" >> are orthogonal, although the two are often supported together. > > The SDM explicitly states that PEBS Baseline implies Extended PEBS. See > 3-19.8 (April 22 edition). > > The question is if there is hardware that has Extended PEBS but doesn't > have Baseline; and I simply don't know and was hoping Kan could find > out. Goldmont Plus should be the only platform which supports extended PEBS but doesn't have Baseline. > > That said; the above patch can be further improved by also removing the > PMU_FL_PEBS_ALL lines, which is already set by intel_ds_init(). I think we have to keep PMU_FL_PEBS_ALL for the Goldmont Plus. But we can remove it for SPR and ADL in intel_pmu_init(), since it's already set in the intel_ds_init() for the Baseline. Thanks, Kan > > In general though; the point is, we shouldn't be doing the FMS table > thing for discoverable features. Having pebs_capable = ~0 and > PMU_FL_PEBS_ALL on something with BASELINE set is just wrong.