Received: by 10.192.165.148 with SMTP id m20csp1032157imm; Wed, 25 Apr 2018 11:26:46 -0700 (PDT) X-Google-Smtp-Source: AIpwx4/BS2O3PhpDUZfJ6ZJyUDNM9vccsiwsYI7C962nDLiGG7wwhXn3Cs1rMmLmRARY86PhZX/O X-Received: by 10.98.129.5 with SMTP id t5mr16747599pfd.215.1524680806320; Wed, 25 Apr 2018 11:26:46 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524680806; cv=none; d=google.com; s=arc-20160816; b=wBjGP9gCyxqvYtdHCwZKZwbzzaVB4yXMMKhcccCOgLFLrk8lxXEgeCvX0xHg0oARHR LnIGOVyl2lxh78xwBVzC55y76cT0yumWYlpwV+Bjtq664/9PprGsT40rUCOgL07dA9ub Y5ukprWPwEItYE0Di2wA+9TwVcWnhltEFFGCa8YW873nkSAuiWMvTD08GJ4kCCLEOyts gF7R2t4b82e+r/Jv7B/K/gRk90cYSU+XyOWJtRebFOFYR08lTK3Jn0Am/7jIrPqeww3t xcD17VWmxjRo1pio/MbfwHHYanJ0VyVhrF592ggYcKZku2IXaPv6ysalJfdmwmJnPQiq 1B0w== 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=eVL/Wlm+EwE8+nABVEOvkoow4+hO7gZKs+THqgcPAew=; b=d2RTpeiJ8w93eDcCwiObXD+RImOdW2isD91tqG4usiHgI4c8zYutVGNzOvfL4n17Ah YsSVdi2/L+vdF18+PZNL1D9iBJtyHOXdkKU2PLL8uj+oAagbfbHHeMLAJLwRk0016qQZ xXd0/S9DCeXRVSs4Ub1f2ErOGC5KBERpRTbZ9gfLUOgXXstyssfuZqgNcrBq76j0ICbq fN/9BNHpHI8rIazNQU3OiPbU+W2fl4eU7OO0avoRtyxStsgiW/+HFxxFQr0Xsua75BL7 HFWMWVPmXEgwqRfSUKcrswzrzJCBYmgaIzm4OSQHV+vDdXw90GbOLwjQhLtcU3ArVk74 pPEQ== 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 i75si13663008pgd.399.2018.04.25.11.26.31; Wed, 25 Apr 2018 11:26:46 -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 S1756390AbeDYSZ3 (ORCPT + 99 others); Wed, 25 Apr 2018 14:25:29 -0400 Received: from mga02.intel.com ([134.134.136.20]:41714 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932135AbeDYSMl (ORCPT ); Wed, 25 Apr 2018 14:12:41 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2018 11:12:40 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,327,1520924400"; d="scan'208";a="35243683" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by fmsmga008.fm.intel.com with ESMTP; 25 Apr 2018 11:12:39 -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 V3 16/39] x86/intel_rdt: Introduce the Cache Pseudo-Locking modes Date: Wed, 25 Apr 2018 03:09:52 -0700 Message-Id: <28015495278b862704a3921f33aaeae51a7df50a.1524649902.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 6658608330fb..fa2aa7e8ad73 100644 --- a/arch/x86/kernel/cpu/intel_rdt.h +++ b/arch/x86/kernel/cpu/intel_rdt.h @@ -83,15 +83,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 9337f72983ec..595a40ec69d2 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", }; /** @@ -758,6 +760,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