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

Re: [Xen-devel] [PATCH v8 17/24] x86: L2 CAT: implement CPU init and free flow.



>>> On 15.02.17 at 09:49, <yi.y.sun@xxxxxxxxxxxxxxx> wrote:
> @@ -684,6 +686,53 @@ struct feat_ops l3_cdp_ops = {
>      .write_msr = l3_cdp_write_msr,
>  };
>  
> +/* L2 CAT callback functions implementation. */
> +static void l2_cat_init_feature(struct cpuid_leaf regs,

const struct cpuid_leaf * (and of course I should have noticed this
already in earlier patches, but I didn't)

> +                                struct feat_node *feat,
> +                                struct psr_socket_info *info)
> +{
> +    struct psr_cat_hw_info l2_cat = { };

I realize Konrad did ask for the initializer here, but it's really pointless
to have such when both structure fields get very obviously set right
below. If you want an initializer, just set the fields to their final values.

> +    unsigned int socket;
> +
> +    /* No valid values so do not enable the feature. */
> +    if ( !regs.a || !regs.d )
> +        return;
> +
> +    l2_cat.cbm_len = (regs.a & CAT_CBM_LEN_MASK) + 1;
> +    l2_cat.cos_max = min(opt_cos_max, regs.d & CAT_COS_MAX_MASK);
> +
> +    /* cos=0 is reserved as default cbm(all ones). */
> +    feat->cos_reg_val[0] = (1ull << l2_cat.cbm_len) - 1;
> +
> +    feat->feature = PSR_SOCKET_L2_CAT;
> +    ASSERT(!test_bit(PSR_SOCKET_L2_CAT, &info->feat_mask));
> +    __set_bit(PSR_SOCKET_L2_CAT, &info->feat_mask);
> +
> +    feat->info.l2_cat_info = l2_cat;
> +
> +    info->nr_feat++;

Is this field really used for anything? I don't recall seeing other than
these increments.

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®.