[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Xen-devel] [PATCH v9 15/25] x86: refactor psr: CDP: implement get hw info flow.



>>> On 16.03.17 at 12:08, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> --- a/xen/arch/x86/sysctl.c
> +++ b/xen/arch/x86/sysctl.c
> @@ -180,10 +180,36 @@ long arch_do_sysctl(
>  
>              ret = psr_get_info(sysctl->u.psr_cat_op.target,
>                                 PSR_CBM_TYPE_L3, data, ARRAY_SIZE(data));
> -
> -            sysctl->u.psr_cat_op.u.l3_info.cbm_len = 
> data[PSR_INFO_IDX_CBM_LEN];
> -            sysctl->u.psr_cat_op.u.l3_info.cos_max = 
> data[PSR_INFO_IDX_COS_MAX];
> -            sysctl->u.psr_cat_op.u.l3_info.flags   = data[PSR_INFO_IDX_FLAG];
> +            if ( !ret )
> +            {
> +                sysctl->u.psr_cat_op.u.l3_info.cbm_len =
> +                                               data[PSR_INFO_IDX_CBM_LEN];
> +                sysctl->u.psr_cat_op.u.l3_info.cos_max =
> +                                               data[PSR_INFO_IDX_COS_MAX];
> +                sysctl->u.psr_cat_op.u.l3_info.flags =
> +                                               data[PSR_INFO_IDX_FLAG];
> +            }
> +            else
> +            {
> +                /*
> +                 * Check if CDP is enabled.
> +                 *
> +                 * Per spec, L3 CAT and CDP cannot co-exist. So, we need 
> replace
> +                 * output values to CDP's if it is enabled.
> +                 */
> +                ret = psr_get_info(sysctl->u.psr_cat_op.target,
> +                                   PSR_CBM_TYPE_L3_CODE, data,
> +                                   ARRAY_SIZE(data));

I think this could/should be done without such a strange retry
mechanism. You can find out which of the features is available,
can't you?

> +                if ( !ret )
> +                {
> +                    sysctl->u.psr_cat_op.u.l3_info.cbm_len =
> +                                               data[PSR_INFO_IDX_CBM_LEN];
> +                    sysctl->u.psr_cat_op.u.l3_info.cos_max =
> +                                               data[PSR_INFO_IDX_COS_MAX];
> +                    sysctl->u.psr_cat_op.u.l3_info.flags =
> +                                               data[PSR_INFO_IDX_FLAG];
> +                }
> +            }
>  
>              if ( !ret && __copy_field_to_guest(u_sysctl, sysctl, 
> u.psr_cat_op) )
>                  ret = -EFAULT;

So where is PSR_CBM_TYPE_L3_DATA being handled?

Jan


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxx
https://lists.xen.org/xen-devel

 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.