Received: by 10.223.185.116 with SMTP id b49csp28592wrg; Tue, 13 Feb 2018 15:56:10 -0800 (PST) X-Google-Smtp-Source: AH8x2262aF2h4Hd2KEsQBMcG9lDQU37iI3fy/ny8vhBZYCR7VH+C+IkXuiF0egcJ0182Sgl0Y0n0 X-Received: by 2002:a17:902:2843:: with SMTP id e61-v6mr2663959plb.260.1518566170118; Tue, 13 Feb 2018 15:56:10 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518566170; cv=none; d=google.com; s=arc-20160816; b=gypwE9sFJaQDe/KGduyPADRx7C12oGRsoPbmzAkJOWloniI6Acj95RlkIcycMsXT/4 GgeJbfFcwtixirnsISny7b1q0ugyhHJxcZxmTIea9vwv7aTHuN0+Za0fm/LA93/yL2qZ pXFEus2jPiQtN4c69F9FWcsd4illiclZibn3u6JOb/oaEs+w2lLbH7O3Zy50ys/g8gJs xk1CBYP8UoTKadIZqcnvsYomP2QFMCz5NCYbOT8b5tZXujnSgdM3zneDWhSJ7GC4x6MM AEGTSS4heFiJBI7iBAX3VOdZSElZAFk2Flc37b9pmgHvUrXkh6ApcYFUePbR4GqAZHqn qq9A== 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=8WA5rpwCxyz3qbaadA+M2DLY/1nxbfKnD2NKKWW8CPg=; b=jjM396HuYmKoWZeGlp+hzKAeJ3ZXh3f1BISRRCVUjfo91WbiPHEEP3hbCSiPVPzVeJ 6k8QM9a5YSyZ1rvlsd37iG62IGibPsHi5IevrNBDVYUeaiQeGOodRxy+N6rG92EFGIre te7CCPri7Ibol3c5fDN9R9cVmMuyK1xDKK9B9PALADoTUtz3OIc/FUjC9PUN8R58u3i+ EyvbgnU4N4gBbH92N8H9Lvtoq7vIHIzLhbtxgIJImKzRsuNMKKEqw4YYTpGWwAEt2itW yFBWKCGi8sVuoSOPhqt6Aqk6vsU8Q+XQVcgaDoETSb43kgmyckH6ikXFntbrJb/QaHKZ 38hw== 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 q6-v6si1145621pli.790.2018.02.13.15.55.55; Tue, 13 Feb 2018 15:56:10 -0800 (PST) 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 S966313AbeBMXyf (ORCPT + 99 others); Tue, 13 Feb 2018 18:54:35 -0500 Received: from mga17.intel.com ([192.55.52.151]:53393 "EHLO mga17.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S966120AbeBMXtd (ORCPT ); Tue, 13 Feb 2018 18:49:33 -0500 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga004.fm.intel.com ([10.253.24.48]) by fmsmga107.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 13 Feb 2018 15:49:32 -0800 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.46,509,1511856000"; d="scan'208";a="29822298" Received: from rchatre-s.jf.intel.com ([10.54.70.76]) by fmsmga004.fm.intel.com with ESMTP; 13 Feb 2018 15:49:32 -0800 From: Reinette Chatre To: tglx@linutronix.de, fenghua.yu@intel.com, tony.luck@intel.com Cc: gavin.hindman@intel.com, vikas.shivappa@linux.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 V2 02/22] x86/intel_rdt: Make useful functions available internally Date: Tue, 13 Feb 2018 07:46:46 -0800 Message-Id: <8a7d55dae1d5a103b30faeaf45f107697718929e.1518443616.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 In preparation for support of pseudo-locking we move some static functions to be available for sharing amongst all RDT components. Signed-off-by: Reinette Chatre --- arch/x86/kernel/cpu/intel_rdt.h | 5 +++++ arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c | 2 +- arch/x86/kernel/cpu/intel_rdt_rdtgroup.c | 8 ++++---- 3 files changed, 10 insertions(+), 5 deletions(-) diff --git a/arch/x86/kernel/cpu/intel_rdt.h b/arch/x86/kernel/cpu/intel_rdt.h index 3fd7a70ee04a..df4db23ddd74 100644 --- a/arch/x86/kernel/cpu/intel_rdt.h +++ b/arch/x86/kernel/cpu/intel_rdt.h @@ -430,7 +430,12 @@ ssize_t rdtgroup_schemata_write(struct kernfs_open_file *of, char *buf, size_t nbytes, loff_t off); int rdtgroup_schemata_show(struct kernfs_open_file *of, struct seq_file *s, void *v); +int rdtgroup_add_files(struct kernfs_node *kn, unsigned long fflags); +int rdtgroup_kn_set_ugid(struct kernfs_node *kn); struct rdt_domain *get_domain_from_cpu(int cpu, struct rdt_resource *r); +int closid_alloc(void); +void closid_free(int closid); +int update_domains(struct rdt_resource *r, int closid); int alloc_rmid(void); void free_rmid(u32 rmid); int rdt_get_mon_l3_config(struct rdt_resource *r); diff --git a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c index 23e1d5c249c6..9e1a455e4d9b 100644 --- a/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c +++ b/arch/x86/kernel/cpu/intel_rdt_ctrlmondata.c @@ -174,7 +174,7 @@ static int parse_line(char *line, struct rdt_resource *r) return -EINVAL; } -static int update_domains(struct rdt_resource *r, int closid) +int update_domains(struct rdt_resource *r, int closid) { struct msr_param msr_param; cpumask_var_t cpu_mask; diff --git a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c index bdab7d2f51af..2a14867a14f7 100644 --- a/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c +++ b/arch/x86/kernel/cpu/intel_rdt_rdtgroup.c @@ -109,7 +109,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); @@ -121,13 +121,13 @@ static int closid_alloc(void) return closid; } -static void closid_free(int closid) +void closid_free(int closid) { closid_free_map |= 1 << closid; } /* set uid and gid of rdtgroup dirs and files to that of the creator */ -static int rdtgroup_kn_set_ugid(struct kernfs_node *kn) +int rdtgroup_kn_set_ugid(struct kernfs_node *kn) { struct iattr iattr = { .ia_valid = ATTR_UID | ATTR_GID, .ia_uid = current_fsuid(), @@ -855,7 +855,7 @@ static struct rftype res_common_files[] = { }, }; -static int rdtgroup_add_files(struct kernfs_node *kn, unsigned long fflags) +int rdtgroup_add_files(struct kernfs_node *kn, unsigned long fflags) { struct rftype *rfts, *rft; int ret, len; -- 2.13.6