Received: by 10.223.185.116 with SMTP id b49csp27200wrg; Tue, 13 Feb 2018 15:54:13 -0800 (PST) X-Google-Smtp-Source: AH8x227lJ9Tf26iG05hCEo7qV0CwJNhnJi5232uLmo6z3+XTPi/Sa4RTZQrzhGumcIdYNZ9+VQ2c X-Received: by 10.99.117.74 with SMTP id f10mr2238702pgn.385.1518566053670; Tue, 13 Feb 2018 15:54:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518566053; cv=none; d=google.com; s=arc-20160816; b=mPt6TjPx0L4pVUUwMr6eF4Pf06T9k7MRt/0ONUVdlwOCmwjaulneQOSVfqq6SNxwSy e450K7c/SCBv8w8dC+obGZgrU38lGKBLmzqrtHdvR7euQ08KEf1dL4PI1cLbIBUhjWTJ pgjrH17PH1N+fd2pUVzh7VB7yLHpvJr/XzIPvAGmZOXLnVWZlookwyMmMAtdBflRDi3V ERC6RkUXDliO3M/oTpnLt7waFvANbX29JtvkMwSBYWggcVKnXlL6xqHKBzJAXYalzSkD DMc592Gx7C34tFOYEyM1+8qN4SI+qtVPWVXkc5OuiL3Xbobls86cPG7l3zvSzOBnxHTu gWqw== 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=EdJpv3IJIbW0XjbGla2RWOlFELiacEY3A0vsxzQag74=; b=Vkdh3wO+BEvncwOVDws5CS25o0pJKgvF+80GAlHTqwy3yiUXmrQm7P3wWby0T+5zzW Kchsrp72Ma+lUxSpFSxNPt3MsbCfJmda6vJyWtRCn0a8AXm0nFJz05v5iNdJHZ41O7gs I1kxy98yXmtBSNRTDIXWmwIIHYGtRk/u2X8ATLYyW6v8S5mYVPh+esCVEAk2HGXy/e13 96fIJugPAoVX2u8PoGj26exSm4n5SVxA1jVkY5QH/GY8EoE+ev7KjrD1i9+Rx9iyyyK+ 61C6dDu8ODgozC6+80/vJ+wz2Sa7YcoOUbDgf2rBRMdhKGQwlKxFF7yFUyNUcoW+MT7C 3/9A== 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 1-v6si4586194plj.456.2018.02.13.15.53.59; Tue, 13 Feb 2018 15:54:13 -0800 (PST) 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 S966265AbeBMXw1 (ORCPT + 99 others); Tue, 13 Feb 2018 18:52:27 -0500 Received: from mga17.intel.com ([192.55.52.151]:53397 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966196AbeBMXtg (ORCPT ); Tue, 13 Feb 2018 18:49:36 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2018 15:49:35 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,509,1511856000"; d="scan'208";a="29822327" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by fmsmga004.fm.intel.com with ESMTP; 13 Feb 2018 15:49:35 -0800 From: Reinette Chatre To: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com Cc: gavin.hindman@intel.com, vikas.shivappa@linux.intel.com, dave.hansen@intel.com, mingo@redhat.com, hpa@zytor.com, x86@kernel.org, linux-kernel@vger.kernel.org, Reinette Chatre Subject: [RFC PATCH V2 10/22] x86/intel_rdt: Disable pseudo-locking if CDP enabled Date: Tue, 13 Feb 2018 07:46:54 -0800 Message-Id: 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 Pseudo-locking can work when Code and Data Prioritization (CDP) is enabled, but there are a few additional checks and actions involved. At this time it is not clear if users would want to use pseudo-locking and CDP at the same time so the support of this is delayed until we understand the usage better. Disable pseudo-locking if CDP is enabled. Add the details of things to keep in mind for anybody considering enabling this support. Signed-off-by: Reinette Chatre --- arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c | 30 +++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c index a0c144b5b09b..f6932a7de6e7 100644 --- a/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c +++ b/arch/x86/kernel/cpu/intel_rdt_pseudo_lock.c @@ -443,6 +443,36 @@ int rdt_pseudo_lock_fs_init(struct kernfs_node *root) lockdep_assert_held(&rdtgroup_mutex); /* + * Pseudo-locking not supported when CDP is enabled. + * + * Some things to consider if you would like to enable this support + * (using L3 CDP as example): + * - When CDP is enabled two separate resources are exposed, L3DATA + * and L3CODE, but they are actually on the same cache. The + * implication for pseudo-locking is that if a pseudo-locked + * region is created on a domain of one resource (eg. L3CODE), + * then a pseudo-locked region cannot be created on that same + * domain of the other resource (eg. L3DATA). This is because + * the creation of a pseudo-locked region involves a call to + * wbinvd that will affect all cache allocations on particular + * domain. + * - Considering the previous, it may be possible to only expose + * one of the CDP resources to pseudo-locking and hide the other. + * For example, we could consider to only expose L3DATA and since + * the L3 cache is unified it is still possible to place + * instructions there are execute it. + * - If only one region is exposed to pseudo-locking we should still + * keep in mind that availability of a portion of cache for + * pseudo-locking should take into account both resources. Similarly, + * if a pseudo-locked region is created in one resource, the portion + * of cache used by it should be made unavailable to all future + * allocations from both resources. + */ + if (rdt_resources_all[RDT_RESOURCE_L3DATA].alloc_enabled || + rdt_resources_all[RDT_RESOURCE_L2DATA].alloc_enabled) + return 0; + + /* * Not knowing the bits to disable prefetching is not a failure * that should be propagated since we only return prefetching bits * for those platforms pseudo-locking has been tested on. If -- 2.13.6