Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1988046imm; Tue, 22 May 2018 12:43:00 -0700 (PDT) X-Google-Smtp-Source: AB8JxZoW/dErdDvllaAJEkKn0HafXqsk049xUaVMmUoI3cWvjwzaDFl84GS9X9MDrr+gSbdzIO3l X-Received: by 2002:a63:6aca:: with SMTP id f193-v6mr20206171pgc.244.1527018180439; Tue, 22 May 2018 12:43:00 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527018180; cv=none; d=google.com; s=arc-20160816; b=RTIvQnSaBrmAE4vp5y43TCbDHsZ6Nyn3vfpCRCThfip+n6VJqaDUhqY7smfT3Bae++ xAC2VA4juIFw+Bc8IYCS3e71cELH86Ow7y3VthUdiKV8Q91vHGo8uOmO2xzTSukdH87E gSy0Jq6d7FiACAorMksJMjDisq2Bg5lIzownD0FdLLyT/z4baB9SIf85ympSkiyDBGjS Yxutut6i09Oqin27+TMBqoE5m9uXRJxGVV1DxaB8AM1pB8LMSVSU13tJV/cleIJfp8Jh lIuelaeozJ7FN75Xe+rplmLt/5du5VC3qzJHfUcSrmMYHePk/zBw3VZROgVCLuMoS792 QuWQ== 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=ZT/e7nS6x6irmAzsqjHuOxmE6fIsVDgVcf0McTZqIyU=; b=vzoM1Vzse2+mwfTMpbgkTvVwJIF8a/CLcNmgVAWGPuuwVM50HbLIljEhNdMoga1CnP msQ9VMxb4RitvvpI+RO5Qmx6o/gowDxdyGWFtx0wddLFZJsqr5l6kSTRLujpIR9UWHgu bMeySa6Z/qSda9ozMErH03TuBLb+LVdAMRzyixGsFU0dSSD4SIjQL+Div99XKgjgJtsp K9JzN4g/KBtDXgVwrJGtsBr4OiGLMpLGq05LyIyOsrR8L4nDBgHW1spO6V3rx90ID+DE 5/xLfsTwqSpQadFZQsFzbaVQPPo/GnrlmizxXWZG6hq5jEpVZ7zipiSk9AbJD2Hcau51 hStQ== 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 h68-v6si13292998pgc.158.2018.05.22.12.42.35; Tue, 22 May 2018 12:43:00 -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 S1753035AbeEVTj7 (ORCPT + 99 others); Tue, 22 May 2018 15:39:59 -0400 Received: from mga07.intel.com ([134.134.136.100]:16707 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752318AbeEVTcC (ORCPT ); Tue, 22 May 2018 15:32:02 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga005.jf.intel.com ([10.7.209.41]) by orsmga105.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 May 2018 12:32:00 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,430,1520924400"; d="scan'208";a="226406382" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by orsmga005.jf.intel.com with ESMTP; 22 May 2018 12:32:00 -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 V4 16/38] x86/intel_rdt: Introduce the Cache Pseudo-Locking modes Date: Tue, 22 May 2018 04:29:04 -0700 Message-Id: <35492bea9659fe5db706769c4644596a1b6c7d6d.1526987654.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 2af99e03faae..e6069822f592 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