|
@@ -1005,6 +1005,11 @@ static void l2_qos_cfg_update(void *arg)
|
|
wrmsrl(IA32_L2_QOS_CFG, *enable ? L2_QOS_CDP_ENABLE : 0ULL);
|
|
wrmsrl(IA32_L2_QOS_CFG, *enable ? L2_QOS_CDP_ENABLE : 0ULL);
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+static inline bool is_mba_linear(void)
|
|
|
|
+{
|
|
|
|
+ return rdt_resources_all[RDT_RESOURCE_MBA].membw.delay_linear;
|
|
|
|
+}
|
|
|
|
+
|
|
static int set_cache_qos_cfg(int level, bool enable)
|
|
static int set_cache_qos_cfg(int level, bool enable)
|
|
{
|
|
{
|
|
void (*update)(void *arg);
|
|
void (*update)(void *arg);
|
|
@@ -1041,6 +1046,25 @@ static int set_cache_qos_cfg(int level, bool enable)
|
|
return 0;
|
|
return 0;
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+/*
|
|
|
|
+ * Enable or disable the MBA software controller
|
|
|
|
+ * which helps user specify bandwidth in MBps.
|
|
|
|
+ * MBA software controller is supported only if
|
|
|
|
+ * MBM is supported and MBA is in linear scale.
|
|
|
|
+ */
|
|
|
|
+static int set_mba_sc(bool mba_sc)
|
|
|
|
+{
|
|
|
|
+ struct rdt_resource *r = &rdt_resources_all[RDT_RESOURCE_MBA];
|
|
|
|
+
|
|
|
|
+ if (!is_mbm_enabled() || !is_mba_linear() ||
|
|
|
|
+ mba_sc == is_mba_sc(r))
|
|
|
|
+ return -EINVAL;
|
|
|
|
+
|
|
|
|
+ r->membw.mba_sc = mba_sc;
|
|
|
|
+
|
|
|
|
+ return 0;
|
|
|
|
+}
|
|
|
|
+
|
|
static int cdp_enable(int level, int data_type, int code_type)
|
|
static int cdp_enable(int level, int data_type, int code_type)
|
|
{
|
|
{
|
|
struct rdt_resource *r_ldata = &rdt_resources_all[data_type];
|
|
struct rdt_resource *r_ldata = &rdt_resources_all[data_type];
|
|
@@ -1123,6 +1147,10 @@ static int parse_rdtgroupfs_options(char *data)
|
|
ret = cdpl2_enable();
|
|
ret = cdpl2_enable();
|
|
if (ret)
|
|
if (ret)
|
|
goto out;
|
|
goto out;
|
|
|
|
+ } else if (!strcmp(token, "mba_MBps")) {
|
|
|
|
+ ret = set_mba_sc(true);
|
|
|
|
+ if (ret)
|
|
|
|
+ goto out;
|
|
} else {
|
|
} else {
|
|
ret = -EINVAL;
|
|
ret = -EINVAL;
|
|
goto out;
|
|
goto out;
|
|
@@ -1445,6 +1473,8 @@ static void rdt_kill_sb(struct super_block *sb)
|
|
cpus_read_lock();
|
|
cpus_read_lock();
|
|
mutex_lock(&rdtgroup_mutex);
|
|
mutex_lock(&rdtgroup_mutex);
|
|
|
|
|
|
|
|
+ set_mba_sc(false);
|
|
|
|
+
|
|
/*Put everything back to default values. */
|
|
/*Put everything back to default values. */
|
|
for_each_alloc_enabled_rdt_resource(r)
|
|
for_each_alloc_enabled_rdt_resource(r)
|
|
reset_all_ctrls(r);
|
|
reset_all_ctrls(r);
|