Received: by 2002:ac0:a594:0:0:0:0:0 with SMTP id m20-v6csp1989811imm; Tue, 22 May 2018 12:45:08 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqv2qk60pXytoO+MCyT/A5vIv7SSjj/4b3XS+fqnOQIZakIf81I0yL4t5XvQXlc4YFMMb8P X-Received: by 2002:a62:ce4e:: with SMTP id y75-v6mr25026404pfg.175.1527018308150; Tue, 22 May 2018 12:45:08 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527018308; cv=none; d=google.com; s=arc-20160816; b=is2dxybewrril9kDED4Oms/IvtbpcdfE3wSdDTRtnHdckOxo2YyWEOlqLwu7X0g6Rq zV7WfaFWwXAj4sgpQHmocI23pektPIWlDEjhUDfXD/n71hjsgTZVWKv30jMSoiZytWbF XqZ9iCu3nSjnYQkKle/od/Qj+nm2e48wW9EyUZ+AN+FG8i7k1n5Xq+ELQs+sz/Hil7HJ aBz7h4HV+um9RhXHVmGKHhEIa90jI5wwoIhlYVPPnosSNHWRVs8THVDzno7QKgbHlXht a1gpo38RcnxBjvioWfZhzuPcHE3p4r9CC2xsj9ee4O2ypOacTcx2p4G8FAxiFmAvjJ6v j3bw== 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=m9VlYcCKF78as20YwEBc9ULDVwPxdT4kzaf/8TP5CF8=; b=B4AcPM3P3MaRJEKir8p3v2z8KPDsiK5pwqFFpD9ciPBwvsPn6ZIuQQK4gNKZWMfJX4 pjShXFEQaHufR6n3JAts77wFAbS+Nf+e6OkD7TuvDDHQgBOagHw4Ras8z8iOrIXMxGqq xxiA8o1QO0u8gJlNVSfVniljZs9gRK53c1adr2NjgVN7zzVBxWhUPZmei7WbF7dptLF8 uhIuxxke1e/WWDF/kf4jBW1oCQUEDP9LD7W7Ak1czFYGZD9arccSEH9cgkrYyx1CcWCH FFVpq7IZRVIguMrDgFmhz9n2SoK04f3czd4Z7TojDMXyX7/J3XvvDpAYM/SJItb7j+8Q dlfA== 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 g9-v6si13205148pgq.145.2018.05.22.12.44.50; Tue, 22 May 2018 12:45:08 -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 S1753174AbeEVTmG (ORCPT + 99 others); Tue, 22 May 2018 15:42:06 -0400 Received: from mga07.intel.com ([134.134.136.100]:16706 "EHLO mga07.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752075AbeEVTcB (ORCPT ); Tue, 22 May 2018 15:32:01 -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="226406350" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by orsmga005.jf.intel.com with ESMTP; 22 May 2018 12:31:59 -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 05/38] x86/intel_rdt: Introduce test to determine if closid is in use Date: Tue, 22 May 2018 04:28:53 -0700 Message-Id: <26e0715da4e5945b72230c0f72a4399c94bbc2d5.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 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 --- 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 @@ -127,6 +127,18 @@ static void closid_free(int 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 * -- 2.13.6