Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp3130386rwl; Mon, 27 Mar 2023 09:35:33 -0700 (PDT) X-Google-Smtp-Source: AK7set8j9KTtXRbhHuhl/qCoOWnui/NfR+AzLFLtJ6xuIe+PUTpd0k1XsEVIJ/20F0uVrz4tQhNz X-Received: by 2002:a05:6a20:1221:b0:da:acdf:d241 with SMTP id v33-20020a056a20122100b000daacdfd241mr9408684pzf.45.1679934933724; Mon, 27 Mar 2023 09:35:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1679934933; cv=none; d=google.com; s=arc-20160816; b=W68cc0BGsxMcr0SlLqJrqAnsd/a+4SCmMdp9pPvXQ071QXCYDWtESvcI4q0+5khq2E KyEhJj0hd8OcusE29cYBvMhnDg5L7gMtyAfIz3bITXPIgDsDb7fA/cso9BlI9RvySGlr BUbRBmnthrq642EWqLTfHOMYqhMSZvWopcJ4698DhBGrWTEdVd+PRXAvHQ4ljyhIDrDa jvp8qdhBXcYmsobyX3SBkk5M4IGnm0ol6N0H1ZMoHEi3tawvqbcH/mB7BfgoZgMnzo/3 xG6yH3arc7jOy7zXPZ2W+DrXr8gT2+ZmAe9/0fU5h/6BziRqeVS+7iA/3P5QLduNroHh w8vg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:cc:to:subject :message-id:date:from:in-reply-to:references:mime-version; bh=7x2051pZkgpJ+AdQpzKooehDWsAojIVmFulYTeYbXM4=; b=xfwrsMsro8KGuvzUwnKbqaBeNH1lbFqD7GcJz7/LdL5G7d0IBhn7y9o3xGP/w78xhg hx7aeoOwUM5n+KRbRRxocn/k1nr5qSgmx9AqMa73LRBKlCDHwOBm64R4cl2q2bEKBNsc OttB5/bC6QdzygGYSt4EThK+Hb/GeDMdACksGCYAAVQWxD5gpOo4FiXGFvaryAocn+H/ zmaNpdacN2JWTLMyoDZdmIc7Ph1/tQGuv0HIeA1Ny9YuphpVAQM52rJvFHyI5MMYibpr ulTjC1Yo/id07brOCy5om6AEK4ZjEsTbb/nYNDY7+VjGBadxBWl2677CfPHrA9ctiMSA Z43w== ARC-Authentication-Results: i=1; mx.google.com; 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=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id s12-20020a056a0008cc00b006256e67028dsi28329196pfu.122.2023.03.27.09.35.22; Mon, 27 Mar 2023 09:35:33 -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; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232345AbjC0QbT convert rfc822-to-8bit (ORCPT + 99 others); Mon, 27 Mar 2023 12:31:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43764 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230386AbjC0QbS (ORCPT ); Mon, 27 Mar 2023 12:31:18 -0400 Received: from mail-ed1-f53.google.com (mail-ed1-f53.google.com [209.85.208.53]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 3B5141BF8; Mon, 27 Mar 2023 09:31:16 -0700 (PDT) Received: by mail-ed1-f53.google.com with SMTP id ek18so38641247edb.6; Mon, 27 Mar 2023 09:31:16 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; t=1679934675; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=9Ze47oiOMMwEVxqfmFdemK0JOgAXssrF7lNQS7gfxOk=; b=qAzAqN/uh3+eKGho/srvYPoyOC3KGmS+xRmqgXoTrVW59idRa/rHRlTAQuoHHU3FyJ 0OJ1/3iTRxcvvB0XduWx9RNdtiN7HX/r2UyE2KbmL3SKkcO8AdDBQu8/sq/xdJg2fGkO +0GR96FYJsIboQWJaZ79o+9C2t+0cn5z+DhUfhMNcHXwREjwHoCrW55AyW8Bb+Que0Kj aqJpw6eRF7oZ70YXAsfUo8cVauCtGAOsA/B9o1XF0gc1nub3FN9dkvBS+Rl4dZ57IFDs O1FUO1p+5/fBMcrTI0hBIyWJgpzOeZmRImfXjyFdoNrpHjwbhsggdQ3R0hZJzxkUA7QB DO3A== X-Gm-Message-State: AAQBX9ehkzJxx1ZALCeDb79aXdjKauT2McpmvDNqEKTp49JT9hWE9fFB sQ5tmcvZ6L7qXsq95U7fqluxUwwryLJcC4x8mx8= X-Received: by 2002:a50:d49e:0:b0:502:148d:9e1e with SMTP id s30-20020a50d49e000000b00502148d9e1emr6145533edi.3.1679934674643; Mon, 27 Mar 2023 09:31:14 -0700 (PDT) MIME-Version: 1.0 References: <20230207051105.11575-1-ricardo.neri-calderon@linux.intel.com> <20230207051105.11575-12-ricardo.neri-calderon@linux.intel.com> In-Reply-To: <20230207051105.11575-12-ricardo.neri-calderon@linux.intel.com> From: "Rafael J. Wysocki" Date: Mon, 27 Mar 2023 18:31:03 +0200 Message-ID: Subject: Re: [PATCH v3 11/24] thermal: intel: hfi: Introduce Intel Thread Director classes To: Ricardo Neri Cc: "Peter Zijlstra (Intel)" , Juri Lelli , Vincent Guittot , Ricardo Neri , "Ravi V. Shankar" , Ben Segall , Daniel Bristot de Oliveira , Dietmar Eggemann , Len Brown , Mel Gorman , "Rafael J. Wysocki" , Srinivas Pandruvada , Steven Rostedt , Tim Chen , Valentin Schneider , Lukasz Luba , Ionela Voinescu , x86@kernel.org, "Joel Fernandes (Google)" , linux-kernel@vger.kernel.org, linux-pm@vger.kernel.org, "Tim C . Chen" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: 8BIT X-Spam-Status: No, score=0.5 required=5.0 tests=FREEMAIL_FORGED_FROMDOMAIN, FREEMAIL_FROM,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=no 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 Tue, Feb 7, 2023 at 6:02 AM Ricardo Neri wrote: > > On Intel hybrid parts, each type of CPU has specific performance and > energy efficiency capabilities. The Intel Thread Director technology > extends the Hardware Feedback Interface (HFI) to provide performance and > energy efficiency data for advanced classes of instructions. > > Add support to parse per-class capabilities. > > Cc: Ben Segall > Cc: Daniel Bristot de Oliveira > Cc: Dietmar Eggemann > Cc: Ionela Voinescu > Cc: Joel Fernandes (Google) > Cc: Len Brown > Cc: Lukasz Luba > Cc: Mel Gorman > Cc: Rafael J. Wysocki > Cc: Srinivas Pandruvada > Cc: Steven Rostedt > Cc: Tim C. Chen > Cc: Valentin Schneider > Cc: x86@kernel.org > Cc: linux-pm@vger.kernel.org > Cc: linux-kernel@vger.kernel.org > Signed-off-by: Ricardo Neri No objections to this patch, so Acked-by: Rafael J. Wysocki > --- > Changes since v2: > * None > > Changes since v1: > * Removed a now obsolete comment. > --- > drivers/thermal/intel/intel_hfi.c | 30 ++++++++++++++++++++++++------ > 1 file changed, 24 insertions(+), 6 deletions(-) > > diff --git a/drivers/thermal/intel/intel_hfi.c b/drivers/thermal/intel/intel_hfi.c > index 6e604bda2b93..2527ae3836c7 100644 > --- a/drivers/thermal/intel/intel_hfi.c > +++ b/drivers/thermal/intel/intel_hfi.c > @@ -77,7 +77,7 @@ union cpuid6_edx { > * @ee_cap: Energy efficiency capability > * > * Capabilities of a logical processor in the HFI table. These capabilities are > - * unitless. > + * unitless and specific to each HFI class. > */ > struct hfi_cpu_data { > u8 perf_cap; > @@ -89,7 +89,8 @@ struct hfi_cpu_data { > * @perf_updated: Hardware updated performance capabilities > * @ee_updated: Hardware updated energy efficiency capabilities > * > - * Properties of the data in an HFI table. > + * Properties of the data in an HFI table. There exists one header per each > + * HFI class. > */ > struct hfi_hdr { > u8 perf_updated; > @@ -127,16 +128,21 @@ struct hfi_instance { > > /** > * struct hfi_features - Supported HFI features > + * @nr_classes: Number of classes supported > * @nr_table_pages: Size of the HFI table in 4KB pages > * @cpu_stride: Stride size to locate the capability data of a logical > * processor within the table (i.e., row stride) > + * @class_stride: Stride size to locate a class within the capability > + * data of a logical processor or the HFI table header > * @hdr_size: Size of the table header > * > * Parameters and supported features that are common to all HFI instances > */ > struct hfi_features { > + unsigned int nr_classes; > size_t nr_table_pages; > unsigned int cpu_stride; > + unsigned int class_stride; > unsigned int hdr_size; > }; > > @@ -333,8 +339,8 @@ static void init_hfi_cpu_index(struct hfi_cpu_info *info) > } > > /* > - * The format of the HFI table depends on the number of capabilities that the > - * hardware supports. Keep a data structure to navigate the table. > + * The format of the HFI table depends on the number of capabilities and classes > + * that the hardware supports. Keep a data structure to navigate the table. > */ > static void init_hfi_instance(struct hfi_instance *hfi_instance) > { > @@ -515,18 +521,30 @@ static __init int hfi_parse_features(void) > /* The number of 4KB pages required by the table */ > hfi_features.nr_table_pages = edx.split.table_pages + 1; > > + /* > + * Capability fields of an HFI class are grouped together. Classes are > + * contiguous in memory. Hence, use the number of supported features to > + * locate a specific class. > + */ > + hfi_features.class_stride = nr_capabilities; > + > + /* For now, use only one class of the HFI table */ > + hfi_features.nr_classes = 1; > + > /* > * The header contains change indications for each supported feature. > * The size of the table header is rounded up to be a multiple of 8 > * bytes. > */ > - hfi_features.hdr_size = DIV_ROUND_UP(nr_capabilities, 8) * 8; > + hfi_features.hdr_size = DIV_ROUND_UP(nr_capabilities * > + hfi_features.nr_classes, 8) * 8; > > /* > * Data of each logical processor is also rounded up to be a multiple > * of 8 bytes. > */ > - hfi_features.cpu_stride = DIV_ROUND_UP(nr_capabilities, 8) * 8; > + hfi_features.cpu_stride = DIV_ROUND_UP(nr_capabilities * > + hfi_features.nr_classes, 8) * 8; > > return 0; > } > -- > 2.25.1 >