Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1902435imm; Sat, 23 Jun 2018 05:16:39 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKzY3zHc6w1goMiU9Sb3DnylXqhc7nf9JLJFrLKBo+5s2pPgC17aXgYblcjIg/WI03oqaJK X-Received: by 2002:a62:a09c:: with SMTP id p28-v6mr5707864pfl.9.1529756199454; Sat, 23 Jun 2018 05:16:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529756199; cv=none; d=google.com; s=arc-20160816; b=OOEmNeIA0bX1/CVIIOIU8LtqsnJQuTvhSUH6QuWqDqgcu31l8H4k7EMsBo+L80d/nO BrfiCIJ4duGk/WYQEl/rwWJDxD2Cb3eDCP+EJpdGgWiMd4xaCJ/wyNL7mfFOrqdfbv29 ixfn9hbxD7xXesglE/tiGPIT415nZ34Fxt6SEq2CdRYV7V345Xl+rZlXACAQdfKDs7Qp K+7D5qdpoDmJQTy2+gzgWRcHRRyAXtCpd6eB8hbjM5rVxtAQDEaH4vs0Hj9IR/xx2D7D q21Kwek2QCbQSX8KpWbgP1TrkQ7BONvXRJa1cMsRsC5Bg64i9E7Med1XyPBZ9Jh7rcsY hs2w== 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=sKXVkWJNgIlMnm6vXvE77itELrtNE2SV7xbg4Z5dBG8=; b=qcKjjyVoEe9wheFgS6Siiy0c6YF05c4VTqRzndK1/4Hv8i0bo773SVrR4Npn5q9hDQ tFqRY8urrCLP9GxnUKrdYTDscF+19+OjatREsMm7wHQ5OlJjsZ/zid6fElGNQL16J3ez MSVRECmtyyDRagKxkdP/dIWgDhEy7tBru9F7YzDK7rcWWTNPJYpfuP1MSXZnUYu8CFM8 4TkWEH7BNb+I1lGSLgjxYqCvJkSt6zOUB6cMQFNUEOqwdQPBfw5W2p4BirCbC49rDgJO Mbz9vBMo4kUAl5iWUFh/uf3xS0CLmF1mQMd/8M3c+E3e6njoukYP2onz8/xNk29280VD QDBA== 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 u22-v6si9394745pfg.62.2018.06.23.05.16.25; Sat, 23 Jun 2018 05:16:39 -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 S1752023AbeFWMPp (ORCPT + 99 others); Sat, 23 Jun 2018 08:15:45 -0400 Received: from terminus.zytor.com ([198.137.202.136]:47869 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751787AbeFWMPn (ORCPT ); Sat, 23 Jun 2018 08:15:43 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w5NCFdP5464352 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Sat, 23 Jun 2018 05:15:39 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w5NCFd4s464349; Sat, 23 Jun 2018 05:15:39 -0700 Date: Sat, 23 Jun 2018 05:15:39 -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: reinette.chatre@intel.com, hpa@zytor.com, mingo@kernel.org, tglx@linutronix.de, linux-kernel@vger.kernel.org Reply-To: mingo@kernel.org, reinette.chatre@intel.com, hpa@zytor.com, tglx@linutronix.de, linux-kernel@vger.kernel.org In-Reply-To: <98d6ca129bbe7dd0932d1fcfeb3cbb65f29a8d9d.1529706536.git.reinette.chatre@intel.com> References: <98d6ca129bbe7dd0932d1fcfeb3cbb65f29a8d9d.1529706536.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: bb9fec69cb41380428d6b8dab3a303189a9b480a 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, 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: bb9fec69cb41380428d6b8dab3a303189a9b480a Gitweb: https://git.kernel.org/tip/bb9fec69cb41380428d6b8dab3a303189a9b480a Author: Reinette Chatre AuthorDate: Fri, 22 Jun 2018 15:42:08 -0700 Committer: Thomas Gleixner CommitDate: Sat, 23 Jun 2018 13:03:45 +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/98d6ca129bbe7dd0932d1fcfeb3cbb65f29a8d9d.1529706536.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 ed20e91c28ed..7b872f2cc294 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 cde0f4114d4e..fef92b939f0f 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);