aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/resctrl.h
diff options
context:
space:
mode:
authorJames Morse <james.morse@arm.com>2021-07-28 17:06:29 +0000
committerBorislav Petkov <bp@suse.de>2021-08-11 17:46:34 +0200
commitf07e9d0250577a23eb06d4334798291616c01f2d (patch)
tree8b1a39254094ec702a9a34db0cf135793e50c488 /include/linux/resctrl.h
parentx86/resctrl: Rename update_domains() to resctrl_arch_update_domains() (diff)
downloadwireguard-linux-f07e9d0250577a23eb06d4334798291616c01f2d.tar.xz
wireguard-linux-f07e9d0250577a23eb06d4334798291616c01f2d.zip
x86/resctrl: Add a helper to read a closid's configuration
Functions like show_doms() reach into the architecture's private structure to retrieve the configuration from the struct rdt_hw_resource. The hardware configuration may look completely different to the values resctrl gets from user-space. The staged configuration and resctrl_arch_update_domains() allow the architecture to convert or translate these values. Resctrl shouldn't read or write the ctrl_val[] values directly. Add a helper to read the current configuration. This will allow another architecture to scale the bitmaps if necessary, and possibly use controls that don't take the user-space control format at all. Of the remaining functions that access ctrl_val[] directly, apply_config() is part of the architecture-specific code, and is called via resctrl_arch_update_domains(). reset_all_ctrls() will be an architecture specific helper. update_mba_bw() manipulates both ctrl_val[], mbps_val[] and the hardware. The mbps_val[] that matches the mba_sc state of the resource is changed, but the other is left unchanged. Abstracting this is the subject of later patches that affect set_mba_sc() too. Signed-off-by: James Morse <james.morse@arm.com> Signed-off-by: Borislav Petkov <bp@suse.de> Reviewed-by: Jamie Iles <jamie@nuviainc.com> Reviewed-by: Reinette Chatre <reinette.chatre@intel.com> Tested-by: Babu Moger <babu.moger@amd.com> Link: https://lkml.kernel.org/r/20210728170637.25610-17-james.morse@arm.com
Diffstat (limited to 'include/linux/resctrl.h')
-rw-r--r--include/linux/resctrl.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/resctrl.h b/include/linux/resctrl.h
index be5881171576..3a2309403094 100644
--- a/include/linux/resctrl.h
+++ b/include/linux/resctrl.h
@@ -200,5 +200,7 @@ struct resctrl_schema {
/* The number of closid supported by this resource regardless of CDP */
u32 resctrl_arch_get_num_closid(struct rdt_resource *r);
int resctrl_arch_update_domains(struct rdt_resource *r, u32 closid);
+void resctrl_arch_get_config(struct rdt_resource *r, struct rdt_domain *d,
+ u32 closid, u32 *value);
#endif /* _RESCTRL_H */