Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3802910imm; Tue, 29 May 2018 14:05:14 -0700 (PDT) X-Google-Smtp-Source: ADUXVKILKaD89FZaih9UfNqlSjLf5UoJKPNdX/qC6MLMuIAv7zJa182nxRkCp7dW1pb0Ivp5nhPD X-Received: by 2002:a65:480a:: with SMTP id h10-v6mr587pgs.403.1527627914737; Tue, 29 May 2018 14:05:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527627914; cv=none; d=google.com; s=arc-20160816; b=aAQHn2rjjyUFRBZQoLTcXsV1HWOd7pCD/+w7GccQ74gjRGJkyMkj0GwRbFFHpSvKnd FuC4OBqHKAFA+oeeqaxKbqcLIssjDszJr0guvveh0/Pdar7fkDUwp9ekYQ7Okk74h7Qp OKDGcVfbrxCEd+2SR4mGDXZOPBBolF/H9IVpXQzgShlDMhHj4SvNkVyGfoRtacl/Wm4M kabI9H/tAzY8qYLaJMT+MzH5yYpS28wIOPaQy9KuLxV9X6ZEkUyPjF7Fxz5/AexIEA1S Ycp1fPnV7e+JM5ZEYvull/Ov2FgKGuvtX/GGqLbrWKNtADW/GQvOeCChW+htWeRLmAT5 GnBw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:references :in-reply-to:message-id:date:subject:cc:to:from :arc-authentication-results; bh=Ga05y7TGHWKnNGTiq1RHVL3LdwUBtX2syKRn+4W63nk=; b=LIWOSuBeqcbirVNxU2LVuITr8N/hBuPY0J+bpHQ5Pmlui7x7SQXf7QpxCIopJDNOrp LCvXkW66rIW3D6CBji+4BBKCEWUKZObZvbIUvQhlchqPMfJDH6by4bpgy6DLPosJPDCV Yejujj1Q9yX1Y/fiFid2haJMJfmdP6dZng1jdC2k3W5dW0gnKlxnk/j38UjJmaa0NVES qI7NyG8Z69Q4RqDGTOktLUm+6LERli4PXjK7mMIk2O2+SEI6UkBEAQSnDzK2xrYLnYhk tO8dlcMO1JU6WVAUj4FsCGrK7Ov+Zd9UavmZMZSldV7m93ZR3KHkpEh9C0AaQ5zwVlwm Q8Ag== 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 n10-v6si32587446pfe.70.2018.05.29.14.05.01; Tue, 29 May 2018 14:05:14 -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 S967330AbeE2VDu (ORCPT + 99 others); Tue, 29 May 2018 17:03:50 -0400 Received: from mga01.intel.com ([192.55.52.88]:53965 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937192AbeE2VBL (ORCPT ); Tue, 29 May 2018 17:01:11 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2018 14:00:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,457,1520924400"; d="scan'208";a="60127715" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by orsmga001.jf.intel.com with ESMTP; 29 May 2018 14:00:54 -0700 From: Reinette Chatre To: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com, vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com, jithu.joseph@intel.com, dave.hansen@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre Subject: [PATCH V5 16/38] x86/intel_rdt: Introduce the Cache Pseudo-Locking modes Date: Tue, 29 May 2018 05:57:41 -0700 Message-Id: <6ab82fb595f4b0ffa305dc204255b921eed51de7.1527593970.git.reinette.chatre@intel.com> X-Mailer: git-send-email 2.13.6 In-Reply-To: References: In-Reply-To: References: Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 ef86264cf5a9..7ff5f4be2e16 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); -- 2.13.6