1 #ifndef _ASM_X86_INTEL_RDT_H
2 #define _ASM_X86_INTEL_RDT_H
4 #include <linux/jump_label.h>
6 #define IA32_L3_QOS_CFG 0xc81
7 #define IA32_L3_CBM_BASE 0xc90
8 #define IA32_L2_CBM_BASE 0xd10
10 #define L3_QOS_CDP_ENABLE 0x01ULL
13 * struct rdtgroup - store rdtgroup's data in resctrl file system.
15 * @rdtgroup_list: linked list for all rdtgroups
16 * @closid: closid for this rdtgroup
19 struct kernfs_node *kn;
20 struct list_head rdtgroup_list;
24 /* List of all resource groups */
25 extern struct list_head rdt_all_groups;
27 int __init rdtgroup_init(void);
30 * struct rdt_resource - attributes of an RDT resource
31 * @enabled: Is this feature enabled on this machine
32 * @capable: Is this feature available on this machine
33 * @name: Name to use in "schemata" file
34 * @num_closid: Number of CLOSIDs available
35 * @max_cbm: Largest Cache Bit Mask allowed
36 * @min_cbm_bits: Minimum number of consecutive bits to be set
38 * @domains: All domains for this resource
39 * @num_domains: Number of domains active
40 * @msr_base: Base MSR address for CBMs
41 * @tmp_cbms: Scratch space when updating schemata
42 * @cache_level: Which cache level defines scope of this domain
43 * @cbm_idx_multi: Multiplier of CBM index
44 * @cbm_idx_offset: Offset of CBM index. CBM index is computed by:
45 * closid * cbm_idx_multi + cbm_idx_offset
55 struct list_head domains;
65 * struct rdt_domain - group of cpus sharing an RDT resource
66 * @list: all instances of this resource
67 * @id: unique id for this instance
68 * @cpu_mask: which cpus share this resource
69 * @cbm: array of cache bit masks (indexed by CLOSID)
72 struct list_head list;
74 struct cpumask cpu_mask;
79 * struct msr_param - set a range of MSRs from a domain
80 * @res: The resource to use
81 * @low: Beginning index from base MSR
85 struct rdt_resource *res;
90 extern struct mutex rdtgroup_mutex;
92 extern struct rdt_resource rdt_resources_all[];
93 extern struct rdtgroup rdtgroup_default;
94 DECLARE_STATIC_KEY_FALSE(rdt_enable_key);
96 int __init rdtgroup_init(void);
104 /* Must be the last */
108 #define for_each_capable_rdt_resource(r) \
109 for (r = rdt_resources_all; r < rdt_resources_all + RDT_NUM_RESOURCES;\
113 #define for_each_enabled_rdt_resource(r) \
114 for (r = rdt_resources_all; r < rdt_resources_all + RDT_NUM_RESOURCES;\
118 /* CPUID.(EAX=10H, ECX=ResID=1).EAX */
119 union cpuid_0x10_1_eax {
121 unsigned int cbm_len:5;
126 /* CPUID.(EAX=10H, ECX=ResID=1).EDX */
127 union cpuid_0x10_1_edx {
129 unsigned int cos_max:16;
134 void rdt_cbm_update(void *arg);
135 #endif /* _ASM_X86_INTEL_RDT_H */