@@ -1421,6 +1421,13 @@ long arch_do_domctl(
copyback = 1;
break;
+ case XEN_DOMCTL_PSR_MBA_OP_GET_THRTL:
+ ret = psr_get_val(d, domctl->u.psr_alloc_op.target,
+ &domctl->u.psr_alloc_op.data,
+ PSR_VAL_TYPE_MBA);
+ copyback = 1;
+ break;
+
default:
ret = -EOPNOTSUPP;
break;
@@ -998,10 +998,25 @@ static bool mba_get_feat_info(const struct feat_node *feat,
return true;
}
+static bool mba_get_val(const struct feat_node *feat, unsigned int cos,
+ enum psr_val_type type, uint64_t *val)
+{
+ if ( type != PSR_VAL_TYPE_MBA )
+ return false;
+
+ if ( cos > feat->info.mba_info.cos_max )
+ cos = 0;
+
+ *val = feat->cos_reg_val[cos];
+
+ return true;
+}
+
struct feat_ops mba_ops = {
.init_feature = mba_init_feature,
.get_max_cos_max = mba_get_max_cos_max,
.get_feat_info = mba_get_feat_info,
+ .get_val = mba_get_val,
};
static void __init parse_psr_bool(char *s, char *value, char *feature,
@@ -1140,6 +1140,7 @@ struct xen_domctl_psr_alloc_op {
#define XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA 5
#define XEN_DOMCTL_PSR_CAT_OP_SET_L2_CBM 6
#define XEN_DOMCTL_PSR_CAT_OP_GET_L2_CBM 7
+#define XEN_DOMCTL_PSR_MBA_OP_GET_THRTL 9
uint32_t cmd; /* IN: XEN_DOMCTL_PSR_*_OP_* */
uint32_t target; /* IN */
uint64_t data; /* IN/OUT */
This patch implements get value callback function and domctl interface for MBA. Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com> --- xen/arch/x86/domctl.c | 7 +++++++ xen/arch/x86/psr.c | 15 +++++++++++++++ xen/include/public/domctl.h | 1 + 3 files changed, 23 insertions(+)