Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp45798imm; Tue, 24 Jul 2018 13:43:23 -0700 (PDT) X-Google-Smtp-Source: AAOMgpcGiugVJxFaCYd95Ubo4BxIvvMYJFvMRMWsZDxCEB3F9EMg+gB0G+mkpT/pz97SsaBN2VtD X-Received: by 2002:a62:6746:: with SMTP id b67-v6mr19249917pfc.243.1532465003095; Tue, 24 Jul 2018 13:43:23 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1532465003; cv=none; d=google.com; s=arc-20160816; b=jO9Zg6KHtxHt5MmNp8+OzwEmHRVOp2eolf6sYndDxqwAUN87pdERGSm96EmRp4OW/n 4j2PwRfJ87y7Y94hkQP2auStpUqdOzoyMklnELt7ZFRGgjqyk5qKZdl22ZtvuMdDbY/I hJrlaC/c56vQMaQkb1NU0svUB2NlIWE5+YRc4axbCvdIPnDDmZFXZ4qBhjxixq5wcruK wD6vC4vzDttVbl1xN7fYqYIYN2swIyiG8104XEf4KzuZ/7tIDoxABZ9jpn08+DszqVQB rAf+bG2bxXCdOAzt/QRwWKtQf2iVflF1k8s95H42kHArTRgM02mIimWS6GhkTygf/xNx OLDQ== 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=0ikGB3yqlw1wX2KxbBkIWhL7AMzCwusmSH/rHfzWBsE=; b=egQKqQEoRUMASdtXJ5QuuqVOe37QeDDQRmJrP39DS75Y8uw8yyrg91OHiVXrFC/MkR 2uoyCE7GfuZ/9H/Nb954RBfca0PfeWhcQlROURRK8fcfyNHxxsbc3lUbWxIgsaMPVo32 tJ9uMm94vhNq1o5wCTsu0yIICmZL1XwL2jI+aDzbWCaGxeBedOR3IgQ1qPPM57QuMmmt EpFAcMxZOJ6jjB+aEdX06irkLMRNd0v/9/sP2Eg8djs20O3ldOtW57zV0SpU6Zv/SpP8 m0GTS5dz+PO0pGepS2o885ATyB8nqzOLzzfqOUCMSrunhXt4wQMydGmG9uJsDYDknhTc o67w== 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 b5-v6si11445089ple.417.2018.07.24.13.43.08; Tue, 24 Jul 2018 13:43:23 -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 S2388833AbeGXVtI (ORCPT + 99 others); Tue, 24 Jul 2018 17:49:08 -0400 Received: from mga09.intel.com ([134.134.136.24]:61798 "EHLO mga09.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S2388721AbeGXVtI (ORCPT ); Tue, 24 Jul 2018 17:49:08 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by orsmga102.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Jul 2018 13:40:55 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.51,399,1526367600"; d="scan'208";a="74172836" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by fmsmga004.fm.intel.com with ESMTP; 24 Jul 2018 13:40:29 -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: [RFC PATCH 1/7] x86/intel_rdt: Expose useful functions to all RDT code Date: Tue, 24 Jul 2018 13:40:12 -0700 Message-Id: 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 In preparation for support of restoring pseudo-locked regions two functions are exposed to all RDT code: closid_alloc() and closid_allocated(). Signed-off-by: Reinette Chatre --- arch/x86/kernel/cpu/intel_rdt.h | 2 ++ arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/arch/x86/kernel/cpu/intel_rdt.h b/arch/x86/kernel/cpu/intel_rdt.h index 4e588f36228f..7afbf1a746b7 100644 --- a/arch/x86/kernel/cpu/intel_rdt.h +++ b/arch/x86/kernel/cpu/intel_rdt.h @@ -536,6 +536,8 @@ int rdtgroup_pseudo_lock_create(struct rdtgroup *rdtgrp); void rdtgroup_pseudo_lock_remove(struct rdtgroup *rdtgrp); struct rdt_domain *get_domain_from_cpu(int cpu, struct rdt_resource *r); int update_domains(struct rdt_resource *r, int closid); +bool closid_allocated(unsigned int closid); +int closid_alloc(void); void closid_free(int closid); int alloc_rmid(void); void free_rmid(u32 rmid); diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index d6d7ea7349d0..73f7ff26e704 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -113,7 +113,7 @@ static void closid_init(void) closid_free_map &= ~1; } -static int closid_alloc(void) +int closid_alloc(void) { u32 closid = ffs(closid_free_map); @@ -137,7 +137,7 @@ void closid_free(int closid) * Return: true if @closid is currently associated with a resource group, * false if @closid is free */ -static bool closid_allocated(unsigned int closid) +bool closid_allocated(unsigned int closid) { return (closid_free_map & (1 << closid)) == 0; } -- 2.17.0