@@ -1403,6 +1403,13 @@ long arch_do_domctl(
copyback = 1;
break;
+ case XEN_DOMCTL_PSR_CAT_OP_GET_L2_CBM:
+ ret = psr_get_val(d, domctl->u.psr_cat_op.target,
+ &domctl->u.psr_cat_op.data,
+ PSR_CBM_TYPE_L2);
+ copyback = 1;
+ break;
+
default:
ret = -EOPNOTSUPP;
break;
@@ -730,9 +730,21 @@ static bool l2_cat_get_feat_info(const struct feat_node *feat,
return true;
}
+static bool l2_cat_get_val(const struct feat_node *feat, unsigned int cos,
+ enum cbm_type type, uint64_t *val)
+{
+ if ( cos > feat->info.l2_cat_info.cos_max )
+ cos = 0;
+
+ *val = feat->cos_reg_val[cos];
+
+ return true;
+}
+
struct feat_ops l2_cat_ops = {
.get_cos_max = l2_cat_get_cos_max,
.get_feat_info = l2_cat_get_feat_info,
+ .get_val = l2_cat_get_val,
};
static void __init parse_psr_bool(char *s, char *value, char *feature,
@@ -1138,6 +1138,7 @@ struct xen_domctl_psr_cat_op {
#define XEN_DOMCTL_PSR_CAT_OP_SET_L3_DATA 3
#define XEN_DOMCTL_PSR_CAT_OP_GET_L3_CODE 4
#define XEN_DOMCTL_PSR_CAT_OP_GET_L3_DATA 5
+#define XEN_DOMCTL_PSR_CAT_OP_GET_L2_CBM 7
uint32_t cmd; /* IN: XEN_DOMCTL_PSR_CAT_OP_* */
uint32_t target; /* IN */
uint64_t data; /* IN/OUT */
This patch implements L2 CAT get value callback function and interface in domctl. Signed-off-by: Yi Sun <yi.y.sun@linux.intel.com> --- v5: - remove type check in callback function. --- xen/arch/x86/domctl.c | 7 +++++++ xen/arch/x86/psr.c | 12 ++++++++++++ xen/include/public/domctl.h | 1 + 3 files changed, 20 insertions(+)