diff options
author | Thomas Gleixner | 2017-04-14 14:14:31 +0200 |
---|---|---|
committer | Thomas Gleixner | 2017-04-14 16:10:07 +0200 |
commit | 0921c54769bac209b302027384e9dc081198c8f5 (patch) | |
tree | ccbfbcfe3a420bdee210d2bb610524e8ce79c169 /arch/x86/include/asm/intel_rdt.h | |
parent | x86/intel_rdt: Move CBM specific data into a struct (diff) | |
download | kernel-qcow2-linux-0921c54769bac209b302027384e9dc081198c8f5.tar.gz kernel-qcow2-linux-0921c54769bac209b302027384e9dc081198c8f5.tar.xz kernel-qcow2-linux-0921c54769bac209b302027384e9dc081198c8f5.zip |
x86/intel_rdt: Add resource specific msr update function
Updating of Cache and Memory bandwidth QOS MSRs is different.
Add a function pointer to struct rdt_resource and convert the cache part
over.
Based on Vikas all in one patch^Wmess.
Signed-off-by: Thomas Gleixner <tglx@linutronix.de>
Cc: ravi.v.shankar@intel.com
Cc: tony.luck@intel.com
Cc: fenghua.yu@intel.com
Cc: vikas.shivappa@intel.com
Diffstat (limited to 'arch/x86/include/asm/intel_rdt.h')
-rw-r--r-- | arch/x86/include/asm/intel_rdt.h | 63 |
1 files changed, 33 insertions, 30 deletions
diff --git a/arch/x86/include/asm/intel_rdt.h b/arch/x86/include/asm/intel_rdt.h index ae61b0fd55bc..51e4a1ca9551 100644 --- a/arch/x86/include/asm/intel_rdt.h +++ b/arch/x86/include/asm/intel_rdt.h @@ -74,6 +74,36 @@ struct rftype { }; /** + * struct rdt_domain - group of cpus sharing an RDT resource + * @list: all instances of this resource + * @id: unique id for this instance + * @cpu_mask: which cpus share this resource + * @ctrl_val: array of cache or mem ctrl values (indexed by CLOSID) + * @new_ctrl: new ctrl value to be loaded + * @have_new_ctrl: did user provide new_ctrl for this domain + */ +struct rdt_domain { + struct list_head list; + int id; + struct cpumask cpu_mask; + u32 *ctrl_val; + u32 new_ctrl; + bool have_new_ctrl; +}; + +/** + * struct msr_param - set a range of MSRs from a domain + * @res: The resource to use + * @low: Beginning index from base MSR + * @high: End index + */ +struct msr_param { + struct rdt_resource *res; + int low; + int high; +}; + +/** * struct rdt_cache - Cache allocation related data * @cbm_len: Length of the cache bit mask * @min_cbm_bits: Minimum number of consecutive bits to be set @@ -98,6 +128,7 @@ struct rdt_cache { * @cache_level: Which cache level defines scope of this resource * @default_ctrl: Specifies default cache cbm or memory B/W percent. * @msr_base: Base MSR address for CBMs + * @msr_update: Function pointer to update QOS MSRs * @data_width: Character width of data when displaying * @domains: All domains for this resource * @cache: Cache allocation related data @@ -110,41 +141,13 @@ struct rdt_resource { int cache_level; u32 default_ctrl; unsigned int msr_base; + void (*msr_update) (struct rdt_domain *d, struct msr_param *m, + struct rdt_resource *r); int data_width; struct list_head domains; struct rdt_cache cache; }; -/** - * struct rdt_domain - group of cpus sharing an RDT resource - * @list: all instances of this resource - * @id: unique id for this instance - * @cpu_mask: which cpus share this resource - * @ctrl_val: array of cache or mem ctrl values (indexed by CLOSID) - * @new_ctrl: new ctrl value to be loaded - * @have_new_ctrl: did user provide new_ctrl for this domain - */ -struct rdt_domain { - struct list_head list; - int id; - struct cpumask cpu_mask; - u32 *ctrl_val; - u32 new_ctrl; - bool have_new_ctrl; -}; - -/** - * struct msr_param - set a range of MSRs from a domain - * @res: The resource to use - * @low: Beginning index from base MSR - * @high: End index - */ -struct msr_param { - struct rdt_resource *res; - int low; - int high; -}; - extern struct mutex rdtgroup_mutex; extern struct rdt_resource rdt_resources_all[]; |