Received: by 10.223.164.202 with SMTP id h10csp203139wrb; Mon, 13 Nov 2017 16:46:13 -0800 (PST) X-Google-Smtp-Source: AGs4zMaQil2w0sek70HoUDDoDUt5Bmka9Oy7U1rG2mlZzcePPghEFKU/jjaGJQs7iXyL8jIgUTs4 X-Received: by 10.159.249.3 with SMTP id bf3mr5605069plb.354.1510620373151; Mon, 13 Nov 2017 16:46:13 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1510620373; cv=none; d=google.com; s=arc-20160816; b=dwGgmAaS9QyXbm5SJFxbj4TqPWyvXYkS/7C46n6NcyVghvvveoewMKD8MPTPAcneb/ KZf5kpmj8wkBwPcBlEJ1UM2ty32ndtqMdz8lo6FxDU7yMVb2VDtPYJoyeMEheeiw3FmG PZDO32oLXCVAW/q9T+/XZrHbCde6LidegnjAkXXDPtHxnvOeMMS1ZalreWNJgCL2L1C1 gGDpF6WAfJMP94D6fpthW5d0T/9A+Xsrq9R8M6x/FsOeXw29KtkEKRAJAAy5f6VQ5wwq sb2iL2XscbW3YFT1aJbQJEr/Zwr1vBrIZjFYDE6fKghavg8cKRHYtUF03P8f1vWV82/5 Pn9Q== 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=Xc3hd+5yomE5ECJRh4QlLVMeidxZbXsJdwxhruEzNXY=; b=bWqU6ztiW90Re7fFddxMTar4VaNJenerB7hSOVX6lQxQ4rLvLV4bglTYi+9+70YG7I 34Kgd+CafrL/pMtZODNusUhzyA+SflWYGJCF4wAUkEly0a3X6OtgIc7JpEVTeVhO3ocp /vYnfX1CMsLWZBOVQpG8YTTaaIll8nhopwlNiVTSlGrz+t3O2Z4z7loUZM7ceUSg/gbm GWnC3lR4tGujf5ybvZ3vNpMmQXdN+RyK8DLOKKK1HGIovpatys/3HkfQMq9ZshFPtNxD GuwVtx4P++kUKQuX9TQuOcYHVBPKOl8ok7XeN9enjkA4BNR1OcKG6aPm5y2mKr2767RK xANQ== 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 f2si15907706plr.422.2017.11.13.16.46.00; Mon, 13 Nov 2017 16:46: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 S1752933AbdKNAmd (ORCPT + 90 others); Mon, 13 Nov 2017 19:42:33 -0500 Received: from mga01.intel.com ([192.55.52.88]:37793 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752398AbdKNAmT (ORCPT ); Mon, 13 Nov 2017 19:42:19 -0500 Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Nov 2017 16:42:18 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.44,392,1505804400"; d="scan'208";a="2288264" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by fmsmga001.fm.intel.com with ESMTP; 13 Nov 2017 16:42:17 -0800 From: Reinette Chatre To: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com Cc: 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 04/20] x86/intel_rdt: Introduce test to determine if closid is in use Date: Mon, 13 Nov 2017 08:39:27 -0800 Message-Id: X-Mailer: git-send-email 2.13.5 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 During CAT feature discovery the capacity bitmasks (CBMs) associated with all the classes of service are initialized to all ones, even if the class of service is not in use. Introduce a test that can be used to determine if a class of service is in use. This test enables code interested in parsing the CBMs to know if its values are meaningful or can be ignored. Signed-off-by: Reinette Chatre --- arch/x86/kernel/cpu/intel_rdt.h | 1 + arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/arch/x86/kernel/cpu/intel_rdt.h b/arch/x86/kernel/cpu/intel_rdt.h index 4d3b03685fda..48efcc2e27dd 100644 --- a/arch/x86/kernel/cpu/intel_rdt.h +++ b/arch/x86/kernel/cpu/intel_rdt.h @@ -430,6 +430,7 @@ int rdtgroup_kn_set_ugid(struct kernfs_node *kn); struct rdt_domain *get_domain_from_cpu(int cpu, struct rdt_resource *r); int closid_alloc(void); void closid_free(int closid); +bool closid_allocated(unsigned int closid); int update_domains(struct rdt_resource *r, int closid); int alloc_rmid(void); void free_rmid(u32 rmid); diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index f8dc41e15d13..c711df201e57 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -126,6 +126,12 @@ void closid_free(int closid) closid_free_map |= 1 << closid; } +/* closid_allocated - test if provided closid is in use */ +bool closid_allocated(unsigned int closid) +{ + return (closid_free_map & (1 << closid)) == 0; +} + /* set uid and gid of rdtgroup dirs and files to that of the creator */ int rdtgroup_kn_set_ugid(struct kernfs_node *kn) { -- 2.13.5 From 1583970483745312103@xxx Mon Nov 13 16:52:48 +0000 2017 X-GM-THRID: 1583631232449764782 X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread