Received: by 2002:ac0:a581:0:0:0:0:0 with SMTP id m1-v6csp1377944imm; Fri, 22 Jun 2018 15:51:49 -0700 (PDT) X-Google-Smtp-Source: ADUXVKKjvl/Fihk3glxHlA3tznoTEhCP/EyRqO5BWS8gVKXtfHSG+x9zDQiShljMfXtPgxIA8SwM X-Received: by 2002:a17:902:5a1:: with SMTP id f30-v6mr3428265plf.167.1529707909547; Fri, 22 Jun 2018 15:51:49 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1529707909; cv=none; d=google.com; s=arc-20160816; b=Zrmaff6r/cperMZbsAtHDSBPSZxB/h5TI2gcOIOd+eoSSY/jkes7dT+Pi+/JHjlGlz e7Kh4gPbmsG2dCBZcOUSHx24/nHjj/x6LkxIkFkO16bYStev6y34ZnjeXgaJz8Wv8gKW pNwlbiJ34wr4SSViVme2aJlDqjt7MF42YdH+REcYqyUzPieDoauao3dNVaZ4xuUWWzz6 ONA5sLzr/AFk8ngGzpXdM1l49qwGJTnod+WSz5wUXvA2do9r/Olbn8XDb9vULUaKEj8C RKRvsrRlJupjV5F1YUTCCrb5BF4Svy8f4WhWQeec0bPp7lIDFtltSHFLX9RLGIvTfY4x 4kWg== 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=ozOfAVGisSa8lBKppBr66d/kpwAuayYb8h/KU1/SxPE=; b=0i8tVdi3xhYGohvCLyZhB7l/BFnxSu+INPxGwaQhxUJG9hE0O49IYsfNGb1tF3djkH bo9kMVyonsTkVX4V5Rjn6Ld9r3Y3CP7h3Jg42FFjdnIfY19jC0IN9/7ae47QtNkSO+da iYgi06sym7bChGpLnYjo0tTN3xO2X1zqETh+fmbgsB9f4fsCHcj8LZZN5DFrt7IswsxX BuP2DB+sCTViWcmbrCYSNQDJxA81Ak4fEW8jNAH/nxSMRjZE4G6lmQWo9RT6ogRH9LIx 5YVZk0KtVIXJTKP+pNBzxMBt0YDy44s9H9iHEYVRlwyM0CGeqes7nKHDJBuptX8h0Er3 CizQ== 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 t4-v6si8509680plb.313.2018.06.22.15.51.35; Fri, 22 Jun 2018 15:51:49 -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 S1754781AbeFVWui (ORCPT + 99 others); Fri, 22 Jun 2018 18:50:38 -0400 Received: from mga17.intel.com ([192.55.52.151]:52514 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S933585AbeFVWmt (ORCPT ); Fri, 22 Jun 2018 18:42:49 -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 fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 22 Jun 2018 15:42:48 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,259,1526367600"; d="scan'208";a="234843365" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by orsmga005.jf.intel.com with ESMTP; 22 Jun 2018 15:42:47 -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 V7 06/41] x86/intel_rdt: Introduce test to determine if closid is in use Date: Fri, 22 Jun 2018 15:41:57 -0700 Message-Id: <798f8d89cd9b12df492d48c14bdc8ee3b39b1c6f.1529706536.git.reinette.chatre@intel.com> X-Mailer: git-send-email 2.17.0 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 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 e161e52aed3b..9847971cd3dc 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 -- 2.17.0