Message ID | 20230202010738.2186174-1-srinivas.pandruvada@linux.intel.com |
---|---|
Headers |
Return-Path: <linux-kernel-owner@vger.kernel.org> Delivered-To: ouuuleilei@gmail.com Received: by 2002:adf:eb09:0:0:0:0:0 with SMTP id s9csp606441wrn; Wed, 1 Feb 2023 17:09:57 -0800 (PST) X-Google-Smtp-Source: AK7set9paRzis2kWkFjWVwUAM5N1o2lwqu0v0yt9n5xzvmjKVsjw2NYzkVKPIUkom0sY/XzExQK7 X-Received: by 2002:aa7:c515:0:b0:4a2:20ba:71e5 with SMTP id o21-20020aa7c515000000b004a220ba71e5mr4101409edq.26.1675300196860; Wed, 01 Feb 2023 17:09:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1675300196; cv=none; d=google.com; s=arc-20160816; b=n4+9PIPoWE8YUCdqk9eB37xoTZ7b1XOpFvh4iuGqruGxl7t+LK7ykc7efPCoAmidZM bJ0jkPtnZhxLha+F3xfYJCqg0G+E4wyybDtjG5r5fMXFX5djDiWgHmvTGqrMdi6PcUC5 euA/enMSjI4/PVjKJsaT7Ok8UnEAYzrZH9HKwNKy7l6/pXujMFjBXKhBglEF8UhPs2qa x9xIYkgZ4QCvZjDnZK6eNNpJKQZ9rNF0YQeqGdcEedY7ajjhlRNYHuRefhJ3lfn4nYzs 1N3uJhyPV2Z/shq458zniBuOWie7hXUb7JpujgLys9pXif+oGor6wY+zi5U01Cc5svYK 3MKw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=pV/QvHoe40xYCwW5Fy/F7cwciqWnGoUKc5I94rPozfo=; b=agJ+lfnlSRl9+UgEjiVkJMRvM9L1K4pFnYh3etF9PuTg3bqTDZkcJeSVsWb4rwKIOW gVx3XMJMN1btg5UuaBptz4cA27quJMm1HdVhXDsg02nbV4OVncjtJ8m9HC4gxEuu1N4O xk9e9wokXlfx4b5p1pRmbbytP3Wn+/YvooKuvtvksxiwH5qFLXpCmflQTzMztHOoPX6/ QopIAFm2AnVMy0/WqwBs5jZ29PTrKpy+xsybE+rYJqn6vo4SgTo6HP7kUAw+hYTq6Bu+ cA0awSIqVpZdtYWayA/5HK4DeF8kpSe8PxK0SsJLVDTd0hsfna5FBp3f/2ELZ2uJyixN b7cw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@intel.com header.s=Intel header.b=npLb678l; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id k20-20020aa7d8d4000000b0049e27c2853bsi8483941eds.281.2023.02.01.17.09.32; Wed, 01 Feb 2023 17:09:56 -0800 (PST) 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=npLb678l; 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 S229630AbjBBBJF (ORCPT <rfc822;il.mystafa@gmail.com> + 99 others); Wed, 1 Feb 2023 20:09:05 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55112 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229470AbjBBBJC (ORCPT <rfc822;linux-kernel@vger.kernel.org>); Wed, 1 Feb 2023 20:09:02 -0500 Received: from mga01.intel.com (mga01.intel.com [192.55.52.88]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B286D3F2A9; Wed, 1 Feb 2023 17:08:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=intel.com; i=@intel.com; q=dns/txt; s=Intel; t=1675300139; x=1706836139; h=from:to:cc:subject:date:message-id:mime-version: content-transfer-encoding; bh=2E9LVcJw3Kk6q7B8/ENCBNmYX418E19egKvZ3PU0pdA=; b=npLb678luk+QFjh54XlgrmchfiBAoHOkqe/4ExF6vOxZ3oLkjc51e6qc gGjYHEmlEGpJZC9wWjp1+Wjt09jT9PKQoJbF9e7rRtopat9oPJHNt1+A2 sYOSGxB0rnTNBkYm0nXxWWUPToHRwbPW3B8bN4MrmCapZOyuAmWUQCS4/ Ru+wmguKXIUVanFU830hxbSQCej6kCD6YWRUK8xDgElzTOjpsVJXiiXub cdxIrxRElK+3WsXIj4DVAUoP1riEzgJ8J2uemG47ljCjjC7xz9X0z1GGp GmpqbrfCqo5ZKsI63mzYMHknOGyrOdexpeYWsAd6VU4U2SMfbI8xnv76R w==; X-IronPort-AV: E=McAfee;i="6500,9779,10608"; a="355654298" X-IronPort-AV: E=Sophos;i="5.97,266,1669104000"; d="scan'208";a="355654298" Received: from orsmga002.jf.intel.com ([10.7.209.21]) by fmsmga101.fm.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 01 Feb 2023 17:08:15 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=McAfee;i="6500,9779,10608"; a="665087923" X-IronPort-AV: E=Sophos;i="5.97,266,1669104000"; d="scan'208";a="665087923" Received: from spandruv-desk.jf.intel.com ([10.54.75.8]) by orsmga002.jf.intel.com with ESMTP; 01 Feb 2023 17:08:15 -0800 From: Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> To: hdegoede@redhat.com, markgross@kernel.org Cc: platform-driver-x86@vger.kernel.org, linux-kernel@vger.kernel.org, Srinivas Pandruvada <srinivas.pandruvada@linux.intel.com> Subject: [PATCH 0/7] Add TPMI support Date: Wed, 1 Feb 2023 17:07:31 -0800 Message-Id: <20230202010738.2186174-1-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.39.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-4.3 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_EF,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_NONE,SPF_NONE 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: <linux-kernel.vger.kernel.org> X-Mailing-List: linux-kernel@vger.kernel.org X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1756679579098427131?= X-GMAIL-MSGID: =?utf-8?q?1756679579098427131?= |
Series |
Add TPMI support
|
|
Message
srinivas pandruvada
Feb. 2, 2023, 1:07 a.m. UTC
The TPMI (Topology Aware Register and PM Capsule Interface) provides a flexible, extendable and PCIe enumerable MMIO interface for PM features. For example Intel Speed Select Technology (Intel SST) can replace all mailbox commands with direct MMIO access. This reduces latency for SST commands and also defines an architectural interface which will persist for several next generations. Also Intel RAPL (Running Average Power Limit) provides a MMIO interface using TPMI. This has advantage over traditional MSR (Model Specific Register) interface, where a thread needs to be scheduled on the target CPU to read or write. Also the RAPL features vary between CPU models, and hence lot of model specific code. Here TPMI provides an architectural interface by providing hierarchical tables and fields, which will not need any model specific implementation. Same value is for Intel Uncore frequency where MSR interface can't be used because of multiple domains. The TPMI interface uses a PCI VSEC structure to expose the location of MMIO region, which is handled by Intel VSEC driver. Intel VSEC driver is already present in upstream kernel. This series contains the base driver, which parses TPMI MMIO region and creates device nodes for supported features. The current set of PM feature support includes, Intel Speed Select, RAPL, Uncore frequency scaling. The first there patches updates Intel VSEC driver to add TPMI VSEC ID and enhance to reuse the code. The next three patches adds TPMI base driver support. The last patch adds MAINTAINERS entry. The TPMI documentation can be downloaded from: https://github.com/intel/tpmi_power_management This series cleanly applies on 6.2-rc1. Srinivas Pandruvada (7): platform/x86/intel/vsec: Add TPMI ID platform/x86/intel/vsec: Enhance and Export intel_vsec_add_aux() platform/x86/intel/vsec: Support private data platform/x86/intel: Intel TPMI enumeration driver platform/x86/intel/tpmi: Process CPU package mapping platform/x86/intel/tpmi: ADD tpmi external interface for tpmi feature drivers MAINTAINERS: Add entry for TPMI driver MAINTAINERS | 6 + drivers/platform/x86/intel/Kconfig | 13 + drivers/platform/x86/intel/Makefile | 4 + drivers/platform/x86/intel/tpmi.c | 415 ++++++++++++++++++++++++++++ drivers/platform/x86/intel/vsec.c | 21 +- drivers/platform/x86/intel/vsec.h | 6 + include/linux/intel_tpmi.h | 30 ++ 7 files changed, 490 insertions(+), 5 deletions(-) create mode 100644 drivers/platform/x86/intel/tpmi.c create mode 100644 include/linux/intel_tpmi.h
Comments
Hi, On 2/2/23 02:07, Srinivas Pandruvada wrote: > The TPMI (Topology Aware Register and PM Capsule Interface) provides a > flexible, extendable and PCIe enumerable MMIO interface for PM features. > > For example Intel Speed Select Technology (Intel SST) can replace all > mailbox commands with direct MMIO access. This reduces latency for > SST commands and also defines an architectural interface which will > persist for several next generations. > > Also Intel RAPL (Running Average Power Limit) provides a MMIO > interface using TPMI. This has advantage over traditional MSR > (Model Specific Register) interface, where a thread needs to be scheduled > on the target CPU to read or write. Also the RAPL features vary between > CPU models, and hence lot of model specific code. Here TPMI provides an > architectural interface by providing hierarchical tables and fields, > which will not need any model specific implementation. > > Same value is for Intel Uncore frequency where MSR interface can't > be used because of multiple domains. > > The TPMI interface uses a PCI VSEC structure to expose the location of > MMIO region, which is handled by Intel VSEC driver. Intel VSEC driver is > already present in upstream kernel. > > This series contains the base driver, which parses TPMI MMIO region > and creates device nodes for supported features. The current set of > PM feature support includes, Intel Speed Select, RAPL, Uncore frequency > scaling. > > The first there patches updates Intel VSEC driver to add TPMI VSEC ID > and enhance to reuse the code. > The next three patches adds TPMI base driver support. > The last patch adds MAINTAINERS entry. > > The TPMI documentation can be downloaded from: > https://github.com/intel/tpmi_power_management > > This series cleanly applies on 6.2-rc1. Thank you for your patch-series, I've applied the series to my review-hans branch: https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans Note it will show up in my review-hans branch once I've pushed my local branch there, which might take a while. Once I've run some tests on this branch the patches there will be added to the platform-drivers-x86/for-next branch and eventually will be included in the pdx86 pull-request to Linus for the next merge-window. Regards, Hans > Srinivas Pandruvada (7): > platform/x86/intel/vsec: Add TPMI ID > platform/x86/intel/vsec: Enhance and Export intel_vsec_add_aux() > platform/x86/intel/vsec: Support private data > platform/x86/intel: Intel TPMI enumeration driver > platform/x86/intel/tpmi: Process CPU package mapping > platform/x86/intel/tpmi: ADD tpmi external interface for tpmi feature > drivers > MAINTAINERS: Add entry for TPMI driver > > MAINTAINERS | 6 + > drivers/platform/x86/intel/Kconfig | 13 + > drivers/platform/x86/intel/Makefile | 4 + > drivers/platform/x86/intel/tpmi.c | 415 ++++++++++++++++++++++++++++ > drivers/platform/x86/intel/vsec.c | 21 +- > drivers/platform/x86/intel/vsec.h | 6 + > include/linux/intel_tpmi.h | 30 ++ > 7 files changed, 490 insertions(+), 5 deletions(-) > create mode 100644 drivers/platform/x86/intel/tpmi.c > create mode 100644 include/linux/intel_tpmi.h >
Hi, On 2/6/23 13:49, Hans de Goede wrote: > Thank you for your patch-series, I've applied the series to my > review-hans branch: > https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans > > Note it will show up in my review-hans branch once I've pushed my > local branch there, which might take a while. > > Once I've run some tests on this branch the patches there will be > added to the platform-drivers-x86/for-next branch and eventually > will be included in the pdx86 pull-request to Linus for the next > merge-window. One thing which I did notice, which is a pre-existing problem is that the IDA accesses in drivers/platform/x86/intel/vsec.c are not protected by any locking. This is likely ok for now because there is only 1 PCI device per type of ida and the enumeration of the vsec devices under the PCI device is done in a single loop, so all IDA accesses are single threaded atm. But still IMHO it would be good to protect the IDA accesses (ida_alloc() / ida_free()) with a mutex to protect against any future races. I think that a single global static mutex inside drivers/platform/x86/intel/vsec.c to protect the ida calls there should suffice for this. Regards, Hans
Hi Hans, On Mon, 2023-02-06 at 13:55 +0100, Hans de Goede wrote: > Hi, > > On 2/6/23 13:49, Hans de Goede wrote: > > > Thank you for your patch-series, I've applied the series to my > > review-hans branch: > > https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans > > > > Note it will show up in my review-hans branch once I've pushed my > > local branch there, which might take a while. > > > > Once I've run some tests on this branch the patches there will be > > added to the platform-drivers-x86/for-next branch and eventually > > will be included in the pdx86 pull-request to Linus for the next > > merge-window. > > One thing which I did notice, which is a pre-existing problem > is that the IDA accesses in drivers/platform/x86/intel/vsec.c > are not protected by any locking. > > This is likely ok for now because there is only 1 PCI device > per type of ida and the enumeration of the vsec devices > under the PCI device is done in a single loop, so all > IDA accesses are single threaded atm. > > But still IMHO it would be good to protect the IDA accesses > (ida_alloc() / ida_free()) with a mutex to protect against > any future races. > > I think that a single global static mutex inside > drivers/platform/x86/intel/vsec.c to protect the > ida calls there should suffice for this. Let me look into this and get back. Thanks, Srinivas > > Regards, > > Hans > > >
Hi Hans, On Mon, 2023-02-06 at 13:49 +0100, Hans de Goede wrote: > Hi, > > On 2/2/23 02:07, Srinivas Pandruvada wrote: > > [...] > Thank you for your patch-series, I've applied the series to my > review-hans branch: > https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans > > Thanks for the help here. > Note it will show up in my review-hans branch once I've pushed my > local branch there, which might take a while. > > Once I've run some tests on this branch the patches there will be > added to the platform-drivers-x86/for-next branch and eventually > will be included in the pdx86 pull-request to Linus for the next > merge-window. I guess this will appear in 6.3 merge window. Can I post next set of patches (targeted for 6.4)? Thanks, Srinivas > > Regards, > > Hans > > > > > > Srinivas Pandruvada (7): > > platform/x86/intel/vsec: Add TPMI ID > > platform/x86/intel/vsec: Enhance and Export intel_vsec_add_aux() > > platform/x86/intel/vsec: Support private data > > platform/x86/intel: Intel TPMI enumeration driver > > platform/x86/intel/tpmi: Process CPU package mapping > > platform/x86/intel/tpmi: ADD tpmi external interface for tpmi > > feature > > drivers > > MAINTAINERS: Add entry for TPMI driver > > > > MAINTAINERS | 6 + > > drivers/platform/x86/intel/Kconfig | 13 + > > drivers/platform/x86/intel/Makefile | 4 + > > drivers/platform/x86/intel/tpmi.c | 415 > > ++++++++++++++++++++++++++++ > > drivers/platform/x86/intel/vsec.c | 21 +- > > drivers/platform/x86/intel/vsec.h | 6 + > > include/linux/intel_tpmi.h | 30 ++ > > 7 files changed, 490 insertions(+), 5 deletions(-) > > create mode 100644 drivers/platform/x86/intel/tpmi.c > > create mode 100644 include/linux/intel_tpmi.h > > >
Hi, On 2/10/23 09:04, srinivas pandruvada wrote: > Hi Hans, > > On Mon, 2023-02-06 at 13:49 +0100, Hans de Goede wrote: >> Hi, >> >> On 2/2/23 02:07, Srinivas Pandruvada wrote: >> >> > [...] > >> Thank you for your patch-series, I've applied the series to my >> review-hans branch: >> https://git.kernel.org/pub/scm/linux/kernel/git/pdx86/platform-drivers-x86.git/log/?h=review-hans >> >> > Thanks for the help here. You're welcome. >> Note it will show up in my review-hans branch once I've pushed my >> local branch there, which might take a while. >> >> Once I've run some tests on this branch the patches there will be >> added to the platform-drivers-x86/for-next branch and eventually >> will be included in the pdx86 pull-request to Linus for the next >> merge-window. > I guess this will appear in 6.3 merge window. Yes I plan to push my review-hans branch to for-next shortly. > Can I post next set of patches (targeted for 6.4)? Yes please, I'm not sure if I can review them next week, but that will also give other people a chance to take a look and comment so getting them out there would be good. Regards, Hans >>> Srinivas Pandruvada (7): >>> platform/x86/intel/vsec: Add TPMI ID >>> platform/x86/intel/vsec: Enhance and Export intel_vsec_add_aux() >>> platform/x86/intel/vsec: Support private data >>> platform/x86/intel: Intel TPMI enumeration driver >>> platform/x86/intel/tpmi: Process CPU package mapping >>> platform/x86/intel/tpmi: ADD tpmi external interface for tpmi >>> feature >>> drivers >>> MAINTAINERS: Add entry for TPMI driver >>> >>> MAINTAINERS | 6 + >>> drivers/platform/x86/intel/Kconfig | 13 + >>> drivers/platform/x86/intel/Makefile | 4 + >>> drivers/platform/x86/intel/tpmi.c | 415 >>> ++++++++++++++++++++++++++++ >>> drivers/platform/x86/intel/vsec.c | 21 +- >>> drivers/platform/x86/intel/vsec.h | 6 + >>> include/linux/intel_tpmi.h | 30 ++ >>> 7 files changed, 490 insertions(+), 5 deletions(-) >>> create mode 100644 drivers/platform/x86/intel/tpmi.c >>> create mode 100644 include/linux/intel_tpmi.h >>> >> >