Received: by 2002:a25:f815:0:0:0:0:0 with SMTP id u21csp1326432ybd; Wed, 26 Jun 2019 15:39:19 -0700 (PDT) X-Google-Smtp-Source: APXvYqyV9AZNe9ooj/7GFLfzBc2h7yViLle8Sbdyc5N1N+WG8mIrVwtpCdGxekkdc088OBZ9j4O7 X-Received: by 2002:a63:e156:: with SMTP id h22mr341325pgk.370.1561588759607; Wed, 26 Jun 2019 15:39:19 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1561588759; cv=none; d=google.com; s=arc-20160816; b=IFyUilUBkRdSBKxtkWQSe9dNgTFhaR/n11GhSMq6nCJ7/Gc7mFD/o6VogoRF+T3Dew ya3HEfH2h71f+mqMV4n/UkUaZvUPfcZchfTw9MzqnwyOgLDar/mM+WIXR/gVh0jUqyvO ZYWxs/zaS8NwtaS9ghs/ydEz6b2XUcM4uBGrIRoR+UbfNK/r1vz/1d1kNlyc6IHrV3pW 6N/VLhkNR61CiHfaYQaslEabmQ/FFbo84MPc/aoNBOsVOlwKXcs0gvElOT6nLnMPzNZL /L9K6N5w9aTlqcGWdoXIHuqIHUhMuPd5/8VQRLpYeim91XQl97Q95WTijREAEEPlxvA7 satQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from; bh=GpM9enUbGWZUA3ISYiuW0pgDwoKqu+g2rKwu6wMkvY4=; b=VTMmsamiIhDtJW0xTspulw1Kg+OdJal1sgRUg8aQdaalw8yjVWSTShWjRDAuqo7kBS yEdcB6bLIUA0KlRN7220F3rabaZh+nm6cg9GsXSKEwM8VCE7MLFG1mknPIOAMPx0f4cX tOY1JSpB90RPxDHvCs/Yr+QR8Pr0A79zLc+hFSv2uv9yao/kVNcwl9k/GTVd72hgfFQD Y4jRqZLc6kCx6Erqp/DFmZfGuaDDIcTwHLGjM6LpaMvwF1eO78/l+r3ZGJ57AM90otLw cm2UxWO4/+L4qa5EFf5dFjsoclgBKzNSHCs2zW3NJZrot0I7Bt7KSLSfzh0J5enpcyZ4 O9tA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id x8si265965pgj.322.2019.06.26.15.39.02; Wed, 26 Jun 2019 15:39:19 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726445AbfFZWi4 (ORCPT + 99 others); Wed, 26 Jun 2019 18:38:56 -0400 Received: from mga11.intel.com ([192.55.52.93]:10648 "EHLO mga11.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726289AbfFZWi4 (ORCPT ); Wed, 26 Jun 2019 18:38:56 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by fmsmga102.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 26 Jun 2019 15:38:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.63,421,1557212400"; d="scan'208";a="313574950" Received: from spandruv-mobl.amr.corp.intel.com ([10.251.133.109]) by orsmga004.jf.intel.com with ESMTP; 26 Jun 2019 15:38:54 -0700 From: Srinivas Pandruvada To: dvhart@infradead.org, andy@infradead.org, andriy.shevchenko@intel.com, corbet@lwn.net Cc: rjw@rjwysocki.net, alan@linux.intel.com, lenb@kernel.org, prarit@redhat.com, darcari@redhat.com, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, platform-driver-x86@vger.kernel.org, Srinivas Pandruvada Subject: [PATCH 00/10] Intel(R) Speed Select Technology Date: Wed, 26 Jun 2019 15:38:41 -0700 Message-Id: <20190626223851.19138-1-srinivas.pandruvada@linux.intel.com> X-Mailer: git-send-email 2.17.2 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Intel® Speed Select Technology (Intel® SST) — A powerful new collection of features giving more granular control over CPU performance for optimized total cost of ownership and performance. With Intel® SST, one server can be configured for power and performance for variety of diverse workload requirements. In the Linux submission code. we are using ISST to specify Intel® SST to avoid confusion with existing use of SST for "Smart Sound Technology". Refer to these links for overview of the technology released with some Intel® Xeon® Scalable processor (5218N, 6230N, and 6252N): https://www.intel.com/content/www/us/en/architecture-and-technology/speed-select-technology-article.html https://builders.intel.com/docs/networkbuilders/intel-speed-select-technology-base-frequency-enhancing-performance.pdf The next generation of Intel® Xeon® processors are adding more features to the Intel® Speed Select Technology and allow dynamic configuration of these features from OS-software level instead from BIOS. This submission is adding new features and dynamic configuration capabilities . Intel SST Features: Intel® SST—Performance Profile (PP or perf-profile): This feature allows one server to be configured for different workload requirements instead of deploying different servers based on the workload requirement reducing total cost of ownership. With a single server deployed, the same server can be reconfigured dynamically to one of the supported profiles to suit the specific workload requirements. This feature introduces a mechanism that allows multiple optimized performance profiles per system via static and/or dynamic adjustment of TDP level and other performance parameters. Intel® SST—Core power (CP or core-power): An Interface that allows user to define per core priority. This defines a mechanism to distribute power among cores when there is a power constrained scenario. This defines a class of service configuration. Each CPU core can be tied to a class of service and hence an associated priority. Intel® SST—Base Frequency (BF or base-freq): The Intel® SST-BF feature lets user control and direct base frequency. If some critical workload threads demand constant high guaranteed performance, then this feature can be used to execute the thread at higher base frequency on specific set of CPUs. Intel® SST—Turbo frequency (TF or turbo-freq): Enables the ability to set different all core turbo ratio limits to cores based on the priority. Using this features some cores can be configured to get higher turbo frequency by designating them as high priority at the cost of lower or no turbo frequency on the low priority cores. Implementation The Intel® SST features are implemented in the firmware executing in the the power management unit (we are calling PUNIT here for short). The mechanism to control these features are specific to firmware implementation for Intel® Xeon® CPUs and are not architectural features. The interface mechanism and semantics of the messages can change in future Xeon CPUs. Hence there is minimal kernel implementation by offering direct communication to PUNIT via set of IOCTLs. The actual messages which can be sent to PUNIT are specified in the following document link: https://github.com/intel/CommsPowerManagement/blob/master/intel_sst_os_interface/mailbox.md The idea here is that user space software like cloud orchestration software based on their workload requirement configure the system. There is a full featured "Intel Speed Select" utility submitted to kernel power tools, which can be used to validate and exercise the features. Types of PUNIT interfaces There are two types of interfaces. One using Mail box communications, which is facilitated by a PCI device or in some Xeon® CPUs using MSRs; and other using an MMIO interface, which is used primarily for core prioritization. For hiding details a single character device is created to handle IOCTLs. The following block diagram shows the implementation overview. User User Space tool(intel-speed-select)/Cloud Orchestration software IOCTLs ---------------------------------------character device------------------------------ kernel Common driver handling IOCTLs Mail Box drivers(PCI & MSR) PCI MMIO driver -------------------------------------------------------------------------- Hardware PUNIT Srinivas Pandruvada (10): platform/x86: ISST: Update ioctl-number.txt for Intel Speed Select interface platform/x86: ISST: Add common API to register and handle ioctls platform/x86: ISST: Store per CPU information platform/x86: ISST: Add IOCTL to Translate Linux logical CPU to PUNIT CPU number platform/x86: ISST: Add Intel Speed Select mmio interface platform/x86: ISST: Add Intel Speed Select mailbox interface via PCI platform/x86: ISST: Add Intel Speed Select mailbox interface via MSRs platform/x86: ISST: Add Intel Speed Select PUNIT MSR interface platform/x86: ISST: Restore state on resume tools/power/x86: A tool to validate Intel Speed Select commands Documentation/ioctl/ioctl-number.txt | 1 + drivers/platform/x86/Kconfig | 2 + drivers/platform/x86/Makefile | 1 + .../x86/intel_speed_select_if/Kconfig | 17 + .../x86/intel_speed_select_if/Makefile | 10 + .../intel_speed_select_if/isst_if_common.c | 672 +++++++ .../intel_speed_select_if/isst_if_common.h | 69 + .../intel_speed_select_if/isst_if_mbox_msr.c | 216 +++ .../intel_speed_select_if/isst_if_mbox_pci.c | 214 +++ .../x86/intel_speed_select_if/isst_if_mmio.c | 180 ++ include/uapi/linux/isst_if.h | 172 ++ tools/power/x86/intel_speed_select/Makefile | 31 + tools/power/x86/intel_speed_select/isst.h | 231 +++ .../x86/intel_speed_select/isst_config.c | 1607 +++++++++++++++++ .../power/x86/intel_speed_select/isst_core.c | 721 ++++++++ .../x86/intel_speed_select/isst_display.c | 479 +++++ 16 files changed, 4623 insertions(+) create mode 100644 drivers/platform/x86/intel_speed_select_if/Kconfig create mode 100644 drivers/platform/x86/intel_speed_select_if/Makefile create mode 100644 drivers/platform/x86/intel_speed_select_if/isst_if_common.c create mode 100644 drivers/platform/x86/intel_speed_select_if/isst_if_common.h create mode 100644 drivers/platform/x86/intel_speed_select_if/isst_if_mbox_msr.c create mode 100644 drivers/platform/x86/intel_speed_select_if/isst_if_mbox_pci.c create mode 100644 drivers/platform/x86/intel_speed_select_if/isst_if_mmio.c create mode 100644 include/uapi/linux/isst_if.h create mode 100644 tools/power/x86/intel_speed_select/Makefile create mode 100644 tools/power/x86/intel_speed_select/isst.h create mode 100644 tools/power/x86/intel_speed_select/isst_config.c create mode 100644 tools/power/x86/intel_speed_select/isst_core.c create mode 100644 tools/power/x86/intel_speed_select/isst_display.c -- 2.17.2