@@ -223,7 +223,21 @@ static enum psr_feat_type psr_cbm_type_to_feat_type(enum cbm_type type)
{
case PSR_CBM_TYPE_L3:
feat_type = FEAT_TYPE_L3_CAT;
+
+ /*
+ * If type is L3 CAT but we cannot find it in feat_props array,
+ * try CDP.
+ */
+ if ( !feat_props[feat_type] )
+ feat_type = FEAT_TYPE_L3_CDP;
+
break;
+
+ case PSR_CBM_TYPE_L3_DATA:
+ case PSR_CBM_TYPE_L3_CODE:
+ feat_type = FEAT_TYPE_L3_CDP;
+ break;
+
default:
ASSERT_UNREACHABLE();
}
@@ -348,11 +362,23 @@ static const struct feat_props l3_cat_props = {
};
/* L3 CDP props */
+static bool l3_cdp_get_feat_info(const struct feat_node *feat,
+ uint32_t data[], uint32_t array_len)
+{
+ if ( !cat_get_feat_info(feat, data, array_len) )
+ return false;
+
+ data[PSR_INFO_IDX_CAT_FLAG] |= XEN_SYSCTL_PSR_CAT_L3_CDP;
+
+ return true;
+}
+
static const struct feat_props l3_cdp_props = {
.cos_num = 2,
.type[0] = PSR_CBM_TYPE_L3_DATA,
.type[1] = PSR_CBM_TYPE_L3_CODE,
.alt_type = FEAT_TYPE_L3_CAT,
+ .get_feat_info = l3_cdp_get_feat_info,
};
static void __init parse_psr_bool(char *s, char *value, char *feature,