summaryrefslogtreecommitdiffstats
path: root/arch/x86/include/asm/intel_rdt.h
diff options
context:
space:
mode:
authorFenghua Yu2016-10-29 00:04:43 +0200
committerThomas Gleixner2016-10-31 02:10:14 +0100
commit4e978d06dedb8207b298a5a8a49fce4b2ab80d12 (patch)
treeaa41e31fda672544cfa7898f97cc7b8fa17bfaba /arch/x86/include/asm/intel_rdt.h
parentx86/intel_rdt: Add basic resctrl filesystem support (diff)
downloadkernel-qcow2-linux-4e978d06dedb8207b298a5a8a49fce4b2ab80d12.tar.gz
kernel-qcow2-linux-4e978d06dedb8207b298a5a8a49fce4b2ab80d12.tar.xz
kernel-qcow2-linux-4e978d06dedb8207b298a5a8a49fce4b2ab80d12.zip
x86/intel_rdt: Add "info" files to resctrl file system
For the convenience of applications we make the decoded values of some of the CPUID values available in read-only (0444) files. Signed-off-by: Fenghua Yu <fenghua.yu@intel.com> Cc: "Ravi V Shankar" <ravi.v.shankar@intel.com> Cc: "Tony Luck" <tony.luck@intel.com> Cc: "Shaohua Li" <shli@fb.com> Cc: "Sai Prakhya" <sai.praneeth.prakhya@intel.com> Cc: "Peter Zijlstra" <peterz@infradead.org> Cc: "Stephane Eranian" <eranian@google.com> Cc: "Dave Hansen" <dave.hansen@intel.com> Cc: "David Carrillo-Cisneros" <davidcc@google.com> Cc: "Nilay Vaish" <nilayvaish@gmail.com> Cc: "Vikas Shivappa" <vikas.shivappa@linux.intel.com> Cc: "Ingo Molnar" <mingo@elte.hu> Cc: "Borislav Petkov" <bp@suse.de> Cc: "H. Peter Anvin" <h.peter.anvin@intel.com> Link: http://lkml.kernel.org/r/1477692289-37412-5-git-send-email-fenghua.yu@intel.com Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Diffstat (limited to 'arch/x86/include/asm/intel_rdt.h')
-rw-r--r--arch/x86/include/asm/intel_rdt.h24
1 files changed, 24 insertions, 0 deletions
diff --git a/arch/x86/include/asm/intel_rdt.h b/arch/x86/include/asm/intel_rdt.h
index 09d00e6f7ad6..5b7b3f6f1f96 100644
--- a/arch/x86/include/asm/intel_rdt.h
+++ b/arch/x86/include/asm/intel_rdt.h
@@ -27,6 +27,30 @@ extern struct list_head rdt_all_groups;
int __init rdtgroup_init(void);
/**
+ * struct rftype - describe each file in the resctrl file system
+ * @name: file name
+ * @mode: access mode
+ * @kf_ops: operations
+ * @seq_show: show content of the file
+ * @write: write to the file
+ */
+struct rftype {
+ char *name;
+ umode_t mode;
+ struct kernfs_ops *kf_ops;
+
+ int (*seq_show)(struct kernfs_open_file *of,
+ struct seq_file *sf, void *v);
+ /*
+ * write() is the generic write callback which maps directly to
+ * kernfs write operation and overrides all other operations.
+ * Maximum write size is determined by ->max_write_len.
+ */
+ ssize_t (*write)(struct kernfs_open_file *of,
+ char *buf, size_t nbytes, loff_t off);
+};
+
+/**
* struct rdt_resource - attributes of an RDT resource
* @enabled: Is this feature enabled on this machine
* @capable: Is this feature available on this machine