[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [Xen-devel] [PATCH v4 15/24] x86: refactor psr: implement get value flow for CDP.
This patch implements L3 CDP get value callback function. With this patch, 'psr-cat-show' can work for L3 CDP. Signed-off-by: Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx> --- xen/arch/x86/psr.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/xen/arch/x86/psr.c b/xen/arch/x86/psr.c index 99add7a..d0392ca 100644 --- a/xen/arch/x86/psr.c +++ b/xen/arch/x86/psr.c @@ -563,10 +563,29 @@ static bool l3_cdp_get_feat_info(const struct feat_node *feat, return true; } +static bool l3_cdp_get_val(const struct feat_node *feat, unsigned int cos, + enum cbm_type type, uint64_t *val) +{ + if ( type != PSR_CBM_TYPE_L3_DATA && type != PSR_CBM_TYPE_L3_CODE ) + return false; + + if ( cos > feat->info.l3_cdp_info.cos_max ) + /* Use default value. */ + cos = 0; + + if ( type == PSR_CBM_TYPE_L3_DATA ) + *val = get_cdp_data(feat, cos); + else + *val = get_cdp_code(feat, cos); + + return true; +} + struct feat_ops l3_cdp_ops = { .init_feature = l3_cdp_init_feature, .get_max_cos_max = l3_cdp_get_max_cos_max, .get_feat_info = l3_cdp_get_feat_info, + .get_val = l3_cdp_get_val, }; static void __init parse_psr_bool(char *s, char *value, char *feature, -- 1.9.1 _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
![]() |
Lists.xenproject.org is hosted with RackSpace, monitoring our |