Received: by 10.192.165.148 with SMTP id m20csp1031926imm; Wed, 25 Apr 2018 11:26:31 -0700 (PDT) X-Google-Smtp-Source: AIpwx48e0JXps08iRUIRBUj90HZskOOdCg6Nc4j0EcbifzXGNtBn6Onp3j0alU3VZ1EcmYALIEME X-Received: by 2002:a17:902:189:: with SMTP id b9-v6mr28599208plb.204.1524680791130; Wed, 25 Apr 2018 11:26:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524680791; cv=none; d=google.com; s=arc-20160816; b=jNtJPx3dp94SSWM7Yhlq031x90kf4sHtooVFmwwkj2lFsO4oxSyelb1GPdmdKZxnAN wrXt31CrHFpoW6P2+AJ/MbRqjsp4sI/eMLsPic4t+v1Jcc6z3s3//3C+cmpR9EjbuH8y B6o//kzG3CePIuexHoGvVQ0Y8nPCbVYxT/3StggF596IKIiqllOLDoCSvjy7M7GMfA7u GUS1arrb18cMZsgsEaalsaTgrWkIIEhOZXGRnpVbimm14bnS9mREf+Z6lAZae5nkD9jD ZIVeD8N0zXGQ9nmjg8IPpM1njCCd1it/6zXRXGDQfzruYMc1Yq1kC+lIbjqEosH6Jb1i NsXQ== 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=Q10APRZ8qDZWGe2vshJWj+X6LEugPei6Xi6K+NRAQcI=; b=UYPfVAfJzPgU4DFPUP0KxITgzI5Zj7jyV2JqKS3j0RipxNfngKRCO4e7vQi98P6Y1a 4ALhJAPDzXE32gESIC13XcbhfJwgPJlCX+1OqTTCyfBbrw4z7KlbdAcuqIwMOKUn8d58 WXMoZQCCzVkhzgSidzmf42aTpcandAJH5/YypwZE3S6mxZ346MDJckbHbHVN0e/swFK8 OCexNH1H9I/fYZY/Yj5FZD7bGgED6UII08aTXsllxdKl9bdboY5k7f2CWOGxzyGc98Cv Nu592G+nceSD9rgOebEJYe20OzAfwcEhl03sMPY1xQ4BRuJcx/6agcghRpDEnictu2MY FgRw== 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 j1-v6si16145165pld.108.2018.04.25.11.26.17; Wed, 25 Apr 2018 11:26:31 -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 S932164AbeDYSMm (ORCPT + 99 others); Wed, 25 Apr 2018 14:12:42 -0400 Received: from mga02.intel.com ([134.134.136.20]:41709 "EHLO mga02.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755684AbeDYSMb (ORCPT ); Wed, 25 Apr 2018 14:12:31 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga008.fm.intel.com ([10.253.24.58]) by orsmga101.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 25 Apr 2018 11:12:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.49,327,1520924400"; d="scan'208";a="35243624" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by fmsmga008.fm.intel.com with ESMTP; 25 Apr 2018 11:12:30 -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 V3 05/39] x86/intel_rdt: Introduce test to determine if closid is in use Date: Wed, 25 Apr 2018 03:09:41 -0700 Message-Id: <1ea7a7844a5e33387856e29b1bf447d19cf3cacb.1524649902.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 bc5f98154177..1847a1e3a24f 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