[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-changelog] [xen master] x86: refactor psr: CDP: implement get hw info flow.
commit b64596e9cbb6c4a867269f8f6704db3faffefae1 Author: Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx> AuthorDate: Tue Aug 1 11:04:00 2017 +0200 Commit: Jan Beulich <jbeulich@xxxxxxxx> CommitDate: Thu Aug 3 12:36:04 2017 +0200 x86: refactor psr: CDP: implement get hw info flow. This patch implements get HW info flow for CDP including L3 CDP callback function. The flow is almost same as L3 CAT. With this patch, 'psr-hwinfo' can work for L3 CDP. Signed-off-by: Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx> Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> --- xen/arch/x86/psr.c | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c index 0dccb925..b86271c 100644 --- a/xen/arch/x86/psr.c +++ b/xen/arch/x86/psr.c @@ -222,7 +222,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(); } @@ -350,7 +364,12 @@ static const struct feat_props l3_cat_props = { static bool l3_cdp_get_feat_info(const struct feat_node *feat, uint32_t data[], uint32_t array_len) { - return false; + 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 void l3_cdp_write_msr(unsigned int cos, uint32_t val, enum cbm_type type) -- generated by git-patchbot for /home/xen/git/xen.git#master _______________________________________________ Xen-changelog mailing list Xen-changelog@xxxxxxxxxxxxx https://lists.xenproject.org/xen-changelog
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |