On 17-06-30 01:36:57, Jan Beulich wrote:
> >>> Yi Sun <yi.y....@linux.intel.com> 06/30/17 9:28 AM >>>
> >On 17-06-30 00:58:47, Jan Beulich wrote:
> >> >>> Yi Sun <yi.y....@linux.intel.com> 06/14/17 3:26 AM >>>
> >> > @@ -1407,6 +1424,19 @@ static void psr_cpu_init(void)
> >> >          info->feat_init = true;
> >> >      }
> >> >  
> >> > +    cpuid_count_leaf(PSR_CPUID_LEVEL_CAT, 0, ®s);
> >> > +    if ( regs.b & PSR_RESOURCE_TYPE_L2 )
> >> > +    {
> >> > +        cpuid_count_leaf(PSR_CPUID_LEVEL_CAT, 2, ®s);
> >> > +
> >> > +        feat = feat_l2_cat;
> >> > +        feat_l2_cat = NULL;
> >> > +        feat_props[PSR_SOCKET_L2_CAT] = &l2_cat_props;
> >> > +        cat_init_feature(®s, feat, info, PSR_SOCKET_L2_CAT);
> >> > +
> >> > +        info->feat_init = true;
> >> 
> >> This recurring setting of feat_init starts looking suspicious here. Why 
> >> can't
> >> this be done once at the end of the function, outside of any if()-s?
> >> 
> >I am afraid there is no any feature found through CPUID so I set feat_init in
> >every statement that a feature is found.
> 
> Well, even if no feature is available, you're done with initializing by the 
> time
> you finish this function.
> 
Ok, I get your point. Thanks!


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

Reply via email to