Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp118727imm; Tue, 19 Jun 2018 17:17:24 -0700 (PDT) X-Google-Smtp-Source: ADUXVKJu+vKamsnnkrsyshPLm0rCwnc1iM4S+M4Zwt966I9OkYHAEXGSBByu/Xc6uP1fvSvnyFEQ X-Received: by 2002:a17:902:6546:: with SMTP id d6-v6mr21083713pln.196.1529453844735; Tue, 19 Jun 2018 17:17:24 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529453844; cv=none; d=google.com; s=arc-20160816; b=BGjpmKCFqT9ncs+hx9AZbX0i2bkyMRVnwX5OxSAGezNCWXpEf66ndeTaXuZfekoyKj fR2jKXVJRdS4m1Jab5S7UJ4LhhMWWih8Y0wAMFQV1B4NVPRuRmZpuAobAM821n8zOW1h FZv/+HCqRo7w8+wBZ1+C2VlcHVV8Y///2gIJ9P006ixWs3RF0Z2cNPa12ETZxFMhurh/ GSzsFawaVnn60wfi2wrGuq6U2WZXZdSQ6lNFSjFTwUSctr4KfBQR2j6uLEBNIHp9s7iw 6hZB3UEHny6hvRqYjGvAO5lDzpLj676Zl9IQAG+7Q0QFkAII1kpxRKNr5fJp8bCKtddZ 32tw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=iXiaUSsOAtykSeJv9kU+Q1z+74PmFXEtKBkRyYJVl+Y=; b=Af/jlCEr07tFTG651uAeu2zWVROyUJhwXGiago1nu/ziXAvCtYTrQJVdhVxdztuVcN ef+u2x2c08iLfrNitXQCEPCx3+Sxq7kPLUWnQG6/RhpJgs7+R82VRcLIYSAYiF39C3E3 iDocHgtXm1rE0tUJ8qY/tZQT0zfR+Ju9/1vruw8TJFS8I2oC9q4LJaBba9v/+4GfeLxd 3kY5tlpD/yEaKt1S3XGiBw2Wi0yVmKf3nnnaYLwXvUTEn3OjNmV2OQoT/S78ui4Q032f XJYfPjRPgHdPbhdAag/8XwJGgtXLPnLIWQT/Z2sdgDOZjH384sFheIHS+XHMNr3YzR8J xxzA== 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 5-v6si927044plx.517.2018.06.19.17.17.10; Tue, 19 Jun 2018 17:17:24 -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 S1753741AbeFTAPW (ORCPT + 99 others); Tue, 19 Jun 2018 20:15:22 -0400 Received: from terminus.zytor.com ([198.137.202.136]:51073 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751337AbeFTAPS (ORCPT ); Tue, 19 Jun 2018 20:15:18 -0400 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTPS id w5K0FDd43296511 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Tue, 19 Jun 2018 17:15:13 -0700 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w5K0FD1k3296508; Tue, 19 Jun 2018 17:15:13 -0700 Date: Tue, 19 Jun 2018 17:15:13 -0700 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Reinette Chatre Message-ID: Cc: reinette.chatre@intel.com, tglx@linutronix.de, mingo@kernel.org, linux-kernel@vger.kernel.org, hpa@zytor.com Reply-To: mingo@kernel.org, tglx@linutronix.de, reinette.chatre@intel.com, hpa@zytor.com, linux-kernel@vger.kernel.org In-Reply-To: <26e0715da4e5945b72230c0f72a4399c94bbc2d5.1527593970.git.reinette.chatre@intel.com> References: <26e0715da4e5945b72230c0f72a4399c94bbc2d5.1527593970.git.reinette.chatre@intel.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/cache] x86/intel_rdt: Introduce test to determine if closid is in use Git-Commit-ID: db436b3135badfa9f701b20f160e19b630538b9b X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00, T_DATE_IN_FUTURE_96_Q autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: db436b3135badfa9f701b20f160e19b630538b9b Gitweb: https://git.kernel.org/tip/db436b3135badfa9f701b20f160e19b630538b9b Author: Reinette Chatre AuthorDate: Tue, 29 May 2018 05:57:30 -0700 Committer: Thomas Gleixner CommitDate: Wed, 20 Jun 2018 00:56:28 +0200 x86/intel_rdt: Introduce test to determine if closid is in use 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. Temporarily mark the function as unused to silence compile warnings until it is used. Signed-off-by: Reinette Chatre Signed-off-by: Thomas Gleixner Cc: fenghua.yu@intel.com Cc: tony.luck@intel.com Cc: vikas.shivappa@linux.intel.com Cc: gavin.hindman@intel.com Cc: jithu.joseph@intel.com Cc: dave.hansen@intel.com Cc: hpa@zytor.com Link: https://lkml.kernel.org/r/26e0715da4e5945b72230c0f72a4399c94bbc2d5.1527593970.git.reinette.chatre@intel.com --- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index eac60602c87b..fdc55357251b 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -126,6 +126,18 @@ static void closid_free(int closid) closid_free_map |= 1 << closid; } +/** + * closid_allocated - test if provided closid is in use + * @closid: closid to be tested + * + * Return: true if @closid is currently associated with a resource group, + * false if @closid is free + */ +static bool __attribute__ ((unused)) closid_allocated(unsigned int closid) +{ + return (closid_free_map & (1 << closid)) == 0; +} + /** * rdtgroup_mode_by_closid - Return mode of resource group with closid * @closid: closid if the resource group