Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp123026imm; Tue, 19 Jun 2018 17:23:33 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJz4ycoP3skBUTAm9ozZqtsV79LEbwyTDPbfqx9ejolkMBd0snrRsGQBhxLkt20E8+Falj2 X-Received: by 2002:a17:902:8341:: with SMTP id z1-v6mr21382270pln.40.1529454213933; Tue, 19 Jun 2018 17:23:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529454213; cv=none; d=google.com; s=arc-20160816; b=Rd09YaGYmhuTtPJtoEIrKgY3wMHd4fGKJW1mBwCG77n8ulDdv8us76V5bujaqG2Wpd FO49RQsaE0otMDdn77G3TkcuQ7Dg0x2TkaKz1LgbZrn7lj/S7jrLWoCpy6K652EE/Ap6 3qhCv+oZAGu7dv+0P2PTqQ8amJPtO5Fw0hfFYO+UUczGdSNZD5drjNhWP+umZ0wisA73 XpaANbspctQH8KY5dIp0pTL8FDXSU1M3sHIm6ylzF4ZOKn7LTumIOQ9V0o8rW1PMDpuo wg8g5Lo9fy/GFpJ+ct2VzvP7aWpOhmtFwVMgVrqMvhKP7G2LxV0BbBN70YC6iX1uiP8G edOw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=OYrvwE6ZTuF4GM3yRjXAN/PMcoUrowrnlM20pto7y44=; b=SWqqBpKFQGirusrdlAp95uKUnhdK858ypwKZXFlc9+PagE4bQPEZxecHsz0OMHXOKf Ht0ZBWQDR4x3Yj/cvw7FARP7Y0aBwuBm0mINKqvjLWgLHk7Dif395LRnumIxevRQ/Wi1 NG4CgFZueKOprvhVOU+qT3Ma+QYB3vW+cX/4O+Z72i1nAE+xFghF5W1I1pyc2QJwkf6b 7ZqdD+0bCKD/D+aRWJPYFNxxnXS1timCy/oVdzo2HUUK2IbBuWHbDXzm3ACeNJo7S18V s7pog9pMyBmR5RCtUXOuDBUcBE5XkxvInUmH0SD/SFuFo2c/9PWz6KtuHTffGmXdUGNO dwtg== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d132-v6si707832pgc.504.2018.06.19.17.23.20; Tue, 19 Jun 2018 17:23:33 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754152AbeFTAVO (ORCPT + 99 others); Tue, 19 Jun 2018 20:21:14 -0400 Received: from terminus.zytor.com ([198.137.202.136]:57045 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752707AbeFTAVL (ORCPT ); Tue, 19 Jun 2018 20:21:11 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w5K0L6l53297476 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 19 Jun 2018 17:21:06 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w5K0L5SV3297473; Tue, 19 Jun 2018 17:21:05 -0700 Date: Tue, 19 Jun 2018 17:21:05 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Reinette Chatre Message-ID: Cc: linux-kernel@vger.kernel.org, reinette.chatre@intel.com, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de Reply-To: reinette.chatre@intel.com, linux-kernel@vger.kernel.org, mingo@kernel.org, hpa@zytor.com, tglx@linutronix.de In-Reply-To: <6ab82fb595f4b0ffa305dc204255b921eed51de7.1527593970.git.reinette.chatre@intel.com> References: <6ab82fb595f4b0ffa305dc204255b921eed51de7.1527593970.git.reinette.chatre@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cache] x86/intel_rdt: Introduce the Cache Pseudo-Locking modes Git-Commit-ID: f438e62bcabd3e616b6280d422c5ba1c70b37f44 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: f438e62bcabd3e616b6280d422c5ba1c70b37f44 Gitweb: https://git.kernel.org/tip/f438e62bcabd3e616b6280d422c5ba1c70b37f44 Author: Reinette Chatre AuthorDate: Tue, 29 May 2018 05:57:41 -0700 Committer: Thomas Gleixner CommitDate: Wed, 20 Jun 2018 00:56:33 +0200 x86/intel_rdt: Introduce the Cache Pseudo-Locking modes The two modes used to manage Cache Pseudo-Locked regions are introduced. A resource group is assigned "pseudo-locksetup" mode when the user indicates that this resource group will be used for a Cache Pseudo-Locked region. When the Cache Pseudo-Locked region has been set up successfully after the user wrote the requested schemata to the "schemata" file, then the mode will automatically changed to "pseudo-locked". The user is not able to modify the mode to "pseudo-locked" by writing "pseudo-locked" to the "mode" file directly. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/6ab82fb595f4b0ffa305dc204255b921eed51de7.1527593970.git.reinette.chatre@intel.com --- arch/x86/kernel/cpu/intel_rdt.h | 10 ++++++++++ arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 13 +++++++++++-- 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/intel_rdt.h b/arch/x86/kernel/cpu/intel_rdt.h index 8bbb047bf37c..bda87f5ef7bc 100644 --- a/arch/x86/kernel/cpu/intel_rdt.h +++ b/arch/x86/kernel/cpu/intel_rdt.h @@ -84,15 +84,25 @@ enum rdt_group_type { * enum rdtgrp_mode - Mode of a RDT resource group * @RDT_MODE_SHAREABLE: This resource group allows sharing of its allocations * @RDT_MODE_EXCLUSIVE: No sharing of this resource group's allocations allowed + * @RDT_MODE_PSEUDO_LOCKSETUP: Resource group will be used for Pseudo-Locking + * @RDT_MODE_PSEUDO_LOCKED: No sharing of this resource group's allocations + * allowed AND the allocations are Cache Pseudo-Locked * * The mode of a resource group enables control over the allowed overlap * between allocations associated with different resource groups (classes * of service). User is able to modify the mode of a resource group by * writing to the "mode" resctrl file associated with the resource group. + * + * The "shareable", "exclusive", and "pseudo-locksetup" modes are set by + * writing the appropriate text to the "mode" file. A resource group enters + * "pseudo-locked" mode after the schemata is written while the resource + * group is in "pseudo-locksetup" mode. */ enum rdtgrp_mode { RDT_MODE_SHAREABLE = 0, RDT_MODE_EXCLUSIVE, + RDT_MODE_PSEUDO_LOCKSETUP, + RDT_MODE_PSEUDO_LOCKED, /* Must be last */ RDT_NUM_MODES, diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index 7d63380abe02..9e69f4dbc686 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -161,8 +161,10 @@ enum rdtgrp_mode rdtgroup_mode_by_closid(int closid) } static const char * const rdt_mode_str[] = { - [RDT_MODE_SHAREABLE] = "shareable", - [RDT_MODE_EXCLUSIVE] = "exclusive", + [RDT_MODE_SHAREABLE] = "shareable", + [RDT_MODE_EXCLUSIVE] = "exclusive", + [RDT_MODE_PSEUDO_LOCKSETUP] = "pseudo-locksetup", + [RDT_MODE_PSEUDO_LOCKED] = "pseudo-locked", }; /** @@ -759,6 +761,13 @@ static int rdt_bit_usage_show(struct kernfs_open_file *of, case RDT_MODE_EXCLUSIVE: exclusive |= *ctrl; break; + /* + * Temporarily handle pseudo-locking enums + * to silence compile warnings until handling + * added in later patches. + */ + case RDT_MODE_PSEUDO_LOCKSETUP: + case RDT_MODE_PSEUDO_LOCKED: case RDT_NUM_MODES: WARN(1, "invalid mode for closid %d\n", i);