Re: [PATCH v3 00/12] x86/resctrl: Add kernel-mode (e.g., PLZA) support to the resctrl subsystem

From: Qinyun Tan

Date: Mon Jun 08 2026 - 05:30:26 EST


Hi Babu,

While reviewing this series I noticed two cross-architecture issues.

1) aarch64 allyesconfig link failure

resctrl_arch_configure_kmode() and resctrl_arch_get_kmode_support()
are declared in include/linux/resctrl.h:

void resctrl_arch_get_kmode_support(struct resctrl_kmode_cfg *kcfg);
void resctrl_arch_configure_kmode(const struct cpumask *cpu_mask,
u32 closid, u32 rmid, bool enable);

but only implemented under arch/x86/. ARM MPAM selects
CONFIG_RESCTRL_FS, so fs/resctrl/rdtgroup.c is compiled on aarch64
and the linker fails:

ld: fs/resctrl/rdtgroup.o: in function `rdtgroup_config_kmode_clear':
rdtgroup.c: undefined reference to `resctrl_arch_configure_kmode'
ld: fs/resctrl/rdtgroup.o: in function `resctrl_init':
rdtgroup.c: undefined reference to `resctrl_arch_get_kmode_support'

Other arch-specific functions already have empty stubs in
drivers/resctrl/mpam_resctrl.c, e.g.:

int resctrl_arch_io_alloc_enable(struct rdt_resource *r, bool enable)
{
return -EOPNOTSUPP;
}

Adding the same for the two kmode functions would fix the build.

2) info/kernel_mode visible on non-PLZA platforms

The "kernel_mode" entry is registered with fflags = RFTYPE_TOP_INFO:

{
.name = "kernel_mode",
.mode = 0644,
...
.fflags = RFTYPE_TOP_INFO,
},

This makes the file appear unconditionally under info/ -- even on
platforms without PLZA (ARM MPAM, older AMD/Intel without
X86_FEATURE_PLZA). On those platforms the file only shows the
default inherit_ctrl_and_mon mode, which is confusing since there
are no other modes to switch to.

The io_alloc file handles this by starting with fflags = 0 and
enabling it conditionally:

/* io_alloc: fflags defaults to 0 (hidden) */

static void io_alloc_init(void)
{
if (r->cache.io_alloc_capable) {
resctrl_file_fflags_init("io_alloc", ...);
}
}

The same pattern could work for kernel_mode: set fflags = 0 and
call resctrl_file_fflags_init("kernel_mode", RFTYPE_TOP_INFO)
in resctrl_kmode_init() only when resctrl_arch_get_kmode_support()
registers modes beyond INHERIT_CTRL_AND_MON.

Thanks,
Qinyun