Skip to content

Commit 7923ae7

Browse files
babumogerbp3tk0v
authored andcommitted
x86,fs/resctrl: Detect io_alloc feature
AMD's SDCIAE (SDCI Allocation Enforcement) PQE feature enables system software to control the portions of L3 cache used for direct insertion of data from I/O devices into the L3 cache. Introduce a generic resctrl cache resource property "io_alloc_capable" as the first part of the new "io_alloc" resctrl feature that will support AMD's SDCIAE. Any architecture can set a cache resource as "io_alloc_capable" if a portion of the cache can be allocated for I/O traffic. Set the "io_alloc_capable" property for the L3 cache resource on x86 (AMD) systems that support SDCIAE. Signed-off-by: Babu Moger <babu.moger@amd.com> Signed-off-by: Borislav Petkov (AMD) <bp@alien8.de> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Link: https://patch.msgid.link/df85a9a6081674fd3ef6b4170920485512ce2ded.1762995456.git.babu.moger@amd.com
1 parent 4d4840b commit 7923ae7

2 files changed

Lines changed: 10 additions & 0 deletions

File tree

arch/x86/kernel/cpu/resctrl/core.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -274,6 +274,11 @@ static void rdt_get_cdp_config(int level)
274274
rdt_resources_all[level].r_resctrl.cdp_capable = true;
275275
}
276276

277+
static void rdt_set_io_alloc_capable(struct rdt_resource *r)
278+
{
279+
r->cache.io_alloc_capable = true;
280+
}
281+
277282
static void rdt_get_cdp_l3_config(void)
278283
{
279284
rdt_get_cdp_config(RDT_RESOURCE_L3);
@@ -855,6 +860,8 @@ static __init bool get_rdt_alloc_resources(void)
855860
rdt_get_cache_alloc_cfg(1, r);
856861
if (rdt_cpu_has(X86_FEATURE_CDP_L3))
857862
rdt_get_cdp_l3_config();
863+
if (rdt_cpu_has(X86_FEATURE_SDCIAE))
864+
rdt_set_io_alloc_capable(r);
858865
ret = true;
859866
}
860867
if (rdt_cpu_has(X86_FEATURE_CAT_L2)) {

include/linux/resctrl.h

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -206,13 +206,16 @@ struct rdt_mon_domain {
206206
* @arch_has_sparse_bitmasks: True if a bitmask like f00f is valid.
207207
* @arch_has_per_cpu_cfg: True if QOS_CFG register for this cache
208208
* level has CPU scope.
209+
* @io_alloc_capable: True if portion of the cache can be configured
210+
* for I/O traffic.
209211
*/
210212
struct resctrl_cache {
211213
unsigned int cbm_len;
212214
unsigned int min_cbm_bits;
213215
unsigned int shareable_bits;
214216
bool arch_has_sparse_bitmasks;
215217
bool arch_has_per_cpu_cfg;
218+
bool io_alloc_capable;
216219
};
217220

218221
/**

0 commit comments

Comments
 (0)