Received: by 2002:ac0:a5b6:0:0:0:0:0 with SMTP id m51-v6csp3807003imm; Tue, 29 May 2018 14:10:40 -0700 (PDT) X-Google-Smtp-Source: ADUXVKLUnUDx2IP6y6w5FT7bloO35/i//xWFN9irpUJXRBHeRShVwGYiBCb5cRjHYg3mgyU2n12I X-Received: by 2002:a63:8ec8:: with SMTP id k191-v6mr10253pge.435.1527628240122; Tue, 29 May 2018 14:10:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1527628240; cv=none; d=google.com; s=arc-20160816; b=Eyd6zg9vnJX8Dor0NwCnzp7JD0t9gIrmJFneZmFPHhpSrZiiP0d2j0tbQJnniA+6D7 mbiLllDJZqtStR8fBAhh2q++R4oHsaA9u6C/iD+oE210gFZIdH69vY1kwq3V4iSKQBop uYP1GtxEnvc+CLwpycOq781yLkoBUpoy8ntBWqgXrPdvF3Vu8TAHAMX/zRKixG2IsAR4 yTjon4dUpS8MgYM1ujFnyMwSRBB5ppXH8AjNVCe47+P5RSevX7G2J3kKbD9SLpYHAEEn EF6M3VFA3CdRKWvAWpTKEredvStd2YeJMBaA3dXTxS0O89Cur01XcrPabTJrMhxFx9sJ jo+g== 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=AmtdNvQ35tpUj+rMYcW76yPKw0yqgiJD3DRz51+YjbHeSi78+7//CVfgjzmBT72NE1 uX1/XEi0nNYByBKL8ZmoGfJqVPAppLcXbtEVV2hJfSip9H+oWNKmVuQXD6hDHN2fKfUH 3yYnSZpmlInKJmc/kyClhfUOOBVOgGYSZTOXhL9L+uNmlXsJLqQmo4NAv/7/qaMG9hlf 2bVCHe/iQcEweiDP9popz7jrqyHqyLMLaj0EPHeUSFVOw1XHjiY5LKUt1z5oGSZd8qtM Hs39TZCAWvps59mhUvf6obDyX/QQGhI8H5vFiEY0eHPGmA6JpplAhcWPMxfefV+m1GlG 7gkw== 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 i1-v6si25953375pgq.327.2018.05.29.14.10.26; Tue, 29 May 2018 14:10:40 -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 S967250AbeE2VJv (ORCPT + 99 others); Tue, 29 May 2018 17:09:51 -0400 Received: from mga01.intel.com ([192.55.52.88]:53956 "EHLO mga01.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S937050AbeE2VA4 (ORCPT ); Tue, 29 May 2018 17:00:56 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by fmsmga101.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 29 May 2018 14:00:54 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,457,1520924400"; d="scan'208";a="60127682" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by orsmga001.jf.intel.com with ESMTP; 29 May 2018 14:00:54 -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 V5 05/38] x86/intel_rdt: Introduce test to determine if closid is in use Date: Tue, 29 May 2018 05:57:30 -0700 Message-Id: <26e0715da4e5945b72230c0f72a4399c94bbc2d5.1527593970.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