[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v12 11/23] x86: refactor psr: L3 CAT: set value: implement cos id picking flow.
>>> Yi Sun <yi.y.sun@xxxxxxxxxxxxxxx> 06/14/17 3:25 AM >>> > --- a/xen/arch/x86/psr.c > +++ b/xen/arch/x86/psr.c > @@ -845,12 +845,97 @@ static int find_cos(const uint32_t val[], unsigned int > array_len, > return -ENOENT; > } > > +static bool fits_cos_max(const uint32_t val[], > + uint32_t array_len, > + const struct psr_socket_info *info, > + unsigned int cos) > +{ > + unsigned int i; > + > + for ( i = 0; i < ARRAY_SIZE(info->features); i++ ) > + { > + const struct feat_node *feat = info->features[i]; > + const struct feat_props *props = feat_props[i]; > + > + if ( !feat ) > + continue; > + > + if ( !props ) > + { > + ASSERT_UNREACHABLE(); > + return false; > + } > + > + if ( array_len < props->cos_num ) > + return false; > + > + if ( cos > feat->cos_max ) > + { > + unsigned int j; > + > + for ( j = 0; j < props->cos_num; j++ ) > + { > + /* > + * Get default value which cos id is 0. "Get default value, the COS ID of which is zero" perhaps? > + * For CDP: > + * - DATA default value stored in cos_reg_val[0]; > + * - CODE default value stored in cos_reg_val[1]. Strictly speaking this doesn't belong into this patch, as you're not at CDP yet. In fact I wonder whether this couldn't be dropped altogether. > + */ > + uint32_t default_val = feat->cos_reg_val[j]; > + > + if ( val[j] != default_val ) > + return false; > + } > + } > + > + array_len -= props->cos_num; > + > + val += props->cos_num; Well, you already know my comment here by now, I guess. In any case again Reviewed-by: Jan Beulich <jbeulich@xxxxxxxx> Jan _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |