Received: by 2002:a05:7412:d8a:b0:e2:908c:2ebd with SMTP id b10csp2661716rdg; Mon, 16 Oct 2023 10:47:40 -0700 (PDT) X-Google-Smtp-Source: AGHT+IHNE7pWrI45UxKJXIaBEBGlspiShxVtRZc9eMFNOA2YS13MPtU8D0ZNY8Y2+Xd2yWOzwytH X-Received: by 2002:a05:651c:4ce:b0:2c5:1674:8d79 with SMTP id e14-20020a05651c04ce00b002c516748d79mr5895740lji.21.1697478460741; Mon, 16 Oct 2023 10:47:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1697478460; cv=none; d=google.com; s=arc-20160816; b=olqp9llQgWB4kJuST2DjZmfXsxQ9qMn7EBFyk2nyxVv30+iPe8frudyffq9sh/ErTO 0GGHRqFaf7V2B7Kk5WE8QPM5zvYphnf/VI8KB/Iomi858luMAdZnhFYI6oXI/BwSOUrP UuRNeRqX8eEVZZzwAxyDtt4Sm1+maE/eFTA+1AU/QaKyZjcBsRIHphnbcXQGd9ptQn+N DhNeT7c4GWdDxVxujliH2daegSl80uKo5zRFb0Gga478FuuEPa1lKNZTiZa1h7038s06 yFHqXNi+n6931VthBtNvuqAD15CM/opd9rxBuKR6YSOOHbpsZdRYrfj4RwKzFgYSaI8b u+2A== 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=+CqEuK6p+WuSg3ousga7aJlDhIS7BVOAh7qKc/DqHm0=; fh=ief/IOlabB04N53284UXltECyTm4E0lR2rp5ghbiB2A=; b=Jx2dUf6izvUkaR5YGbNOGJP06AV2beVoIoCmd6L0QLea+Pup9ZkhRyIAeW9s/3iYoE DgImXXr4Lg81n9SsFMgmMuE/horOCU1HwgaiFAeRGzrvQ60fiAqSShug1thLhxX2k3o2 cu2irPR7G49py32K9YpLy6p8s/j6sDfzt0fv+utenFFOrLW2L6KEWHLMDdqXKbKW4rPu KIGSqqWtRqv35w5Yz9iiy6fUx50ALW9AY47vQfTdPtTPdy2Gth3FNto/+/EvXTL3IdoO UpKri3808FH6qUuzrZaOS8H21LQEzYnR3WhN3YV44G+n1wlbKDnMq3PxrIx8CrZDFOab eLFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="h1/OQul1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 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 pete.vger.email (pete.vger.email. [23.128.96.36]) by mx.google.com with ESMTPS id bz8-20020a05651c0c8800b002bce5e3799csi223431ljb.133.2023.10.16.10.47.40 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 16 Oct 2023 10:47:40 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) client-ip=23.128.96.36; Authentication-Results: mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b="h1/OQul1"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.36 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from out1.vger.email (depot.vger.email [IPv6:2620:137:e000::3:0]) by pete.vger.email (Postfix) with ESMTP id DD21D803DAEA; Mon, 16 Oct 2023 10:47:36 -0700 (PDT) X-Virus-Status: Clean X-Virus-Scanned: clamav-milter 0.103.10 at pete.vger.email Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233688AbjJPRr0 (ORCPT + 99 others); Mon, 16 Oct 2023 13:47:26 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55732 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231675AbjJPRrZ (ORCPT ); Mon, 16 Oct 2023 13:47:25 -0400 Received: from mgamail.intel.com (mgamail.intel.com [134.134.136.65]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 68AD2EB for ; Mon, 16 Oct 2023 10:47:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1697478443; x=1729014443; h=message-id:date:mime-version:subject:to:cc:references: from:in-reply-to:content-transfer-encoding; bh=ikln8lrPWrqT1K1fc5FFD3ejuJYCL5iINlPw05Y0fnM=; b=h1/OQul1FkJSBYTpFdo4zxMHZn7zya0wJtjqraog2q9CPOxJHGTdflrT JWYr/Ori9SJxfmrz4XDF7VR/alxWnFSGMh+jK4vfcpmKFhXa10P2ya2gb bh7c6cCS6VbxbHI+y220/OkB9tEJyVyeeyJSjcXiXPfj2yco2PX5aCCpH o29UdvaP2MkOGbIQywZg7j3BMywcViA8zS0GgHuXabXupzVjGPEhFa9A8 J/+KAhrNgfy4ii4enTGyjBOD0/WXsRLQv256s9KFDzSSH8YpYDD3Unig3 2eNlWNWUlbshocAEnzOQx59nz8InMQ+vDQIIoG7hRNoykz8NzAjldk0nA w==; X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="389468084" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="389468084" Received: from fmsmga003.fm.intel.com ([10.253.24.29]) by orsmga103.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 10:47:22 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6600,9927,10865"; a="846483277" X-IronPort-AV: E=Sophos;i="6.03,229,1694761200"; d="scan'208";a="846483277" Received: from linux.intel.com ([10.54.29.200]) by FMSMGA003.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 16 Oct 2023 10:47:22 -0700 Received: from [10.212.72.131] (kliang2-mobl1.ccr.corp.intel.com [10.212.72.131]) (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 6021F580C4A; Mon, 16 Oct 2023 10:47:21 -0700 (PDT) Message-ID: Date: Mon, 16 Oct 2023 13:47:20 -0400 MIME-Version: 1.0 User-Agent: Mozilla Thunderbird Subject: Re: [PATCH 1/5] perf/x86/intel/uncore: Generic uncore_get_uncores and MMIO format of SPR To: peterz@infradead.org, mingo@redhat.com, linux-kernel@vger.kernel.org Cc: eranian@google.com, ak@linux.intel.com References: <20231002150325.2025749-1-kan.liang@linux.intel.com> Content-Language: en-US From: "Liang, Kan" In-Reply-To: <20231002150325.2025749-1-kan.liang@linux.intel.com> Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-0.8 required=5.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI, SPF_HELO_NONE,SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on pete.vger.email Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.6.4 (pete.vger.email [0.0.0.0]); Mon, 16 Oct 2023 10:47:37 -0700 (PDT) Hi Peter & Ingo, Could you please share your comments for this series? The series is to support the uncore PMU on GNR, SRF, and GRR. Thanks, Kan On 2023-10-02 11:03 a.m., kan.liang@linux.intel.com wrote: > From: Kan Liang > > Factor out SPR_UNCORE_MMIO_COMMON_FORMAT which can be reused by > Granite Rapids in the following patch. > > Granite Rapids have more uncore units than Sapphire Rapids. Add new > parameters to support adjustable uncore units. > > No functional change. > > Signed-off-by: Kan Liang > --- > arch/x86/events/intel/uncore_snbep.c | 34 +++++++++++++++++++--------- > 1 file changed, 23 insertions(+), 11 deletions(-) > > diff --git a/arch/x86/events/intel/uncore_snbep.c b/arch/x86/events/intel/uncore_snbep.c > index d49e90dc04a4..cef51b83410a 100644 > --- a/arch/x86/events/intel/uncore_snbep.c > +++ b/arch/x86/events/intel/uncore_snbep.c > @@ -6079,13 +6079,16 @@ static struct uncore_event_desc spr_uncore_imc_events[] = { > { /* end: all zeroes */ }, > }; > > +#define SPR_UNCORE_MMIO_COMMON_FORMAT() \ > + SPR_UNCORE_COMMON_FORMAT(), \ > + .ops = &spr_uncore_mmio_ops > + > static struct intel_uncore_type spr_uncore_imc = { > - SPR_UNCORE_COMMON_FORMAT(), > + SPR_UNCORE_MMIO_COMMON_FORMAT(), > .name = "imc", > .fixed_ctr_bits = 48, > .fixed_ctr = SNR_IMC_MMIO_PMON_FIXED_CTR, > .fixed_ctl = SNR_IMC_MMIO_PMON_FIXED_CTL, > - .ops = &spr_uncore_mmio_ops, > .event_descs = spr_uncore_imc_events, > }; > > @@ -6412,7 +6415,8 @@ static void uncore_type_customized_copy(struct intel_uncore_type *to_type, > > static struct intel_uncore_type ** > uncore_get_uncores(enum uncore_access_type type_id, int num_extra, > - struct intel_uncore_type **extra) > + struct intel_uncore_type **extra, int max_num_types, > + struct intel_uncore_type **uncores) > { > struct intel_uncore_type **types, **start_types; > int i; > @@ -6421,9 +6425,9 @@ uncore_get_uncores(enum uncore_access_type type_id, int num_extra, > > /* Only copy the customized features */ > for (; *types; types++) { > - if ((*types)->type_id >= UNCORE_SPR_NUM_UNCORE_TYPES) > + if ((*types)->type_id >= max_num_types) > continue; > - uncore_type_customized_copy(*types, spr_uncores[(*types)->type_id]); > + uncore_type_customized_copy(*types, uncores[(*types)->type_id]); > } > > for (i = 0; i < num_extra; i++, types++) > @@ -6470,7 +6474,9 @@ void spr_uncore_cpu_init(void) > > uncore_msr_uncores = uncore_get_uncores(UNCORE_ACCESS_MSR, > UNCORE_SPR_MSR_EXTRA_UNCORES, > - spr_msr_uncores); > + spr_msr_uncores, > + UNCORE_SPR_NUM_UNCORE_TYPES, > + spr_uncores); > > type = uncore_find_type_by_id(uncore_msr_uncores, UNCORE_SPR_CHA); > if (type) { > @@ -6542,7 +6548,9 @@ int spr_uncore_pci_init(void) > spr_update_device_location(UNCORE_SPR_M3UPI); > uncore_pci_uncores = uncore_get_uncores(UNCORE_ACCESS_PCI, > UNCORE_SPR_PCI_EXTRA_UNCORES, > - spr_pci_uncores); > + spr_pci_uncores, > + UNCORE_SPR_NUM_UNCORE_TYPES, > + spr_uncores); > return 0; > } > > @@ -6550,12 +6558,16 @@ void spr_uncore_mmio_init(void) > { > int ret = snbep_pci2phy_map_init(0x3250, SKX_CPUNODEID, SKX_GIDNIDMAP, true); > > - if (ret) > - uncore_mmio_uncores = uncore_get_uncores(UNCORE_ACCESS_MMIO, 0, NULL); > - else { > + if (ret) { > + uncore_mmio_uncores = uncore_get_uncores(UNCORE_ACCESS_MMIO, 0, NULL, > + UNCORE_SPR_NUM_UNCORE_TYPES, > + spr_uncores); > + } else { > uncore_mmio_uncores = uncore_get_uncores(UNCORE_ACCESS_MMIO, > UNCORE_SPR_MMIO_EXTRA_UNCORES, > - spr_mmio_uncores); > + spr_mmio_uncores, > + UNCORE_SPR_NUM_UNCORE_TYPES, > + spr_uncores); > > spr_uncore_imc_free_running.num_boxes = uncore_type_max_boxes(uncore_mmio_uncores, UNCORE_SPR_IMC) / 2; > }