[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v8 14/24] x86: refactor psr: implement get hw info flow for CDP.
On Wed, Feb 15, 2017 at 04:49:29PM +0800, Yi Sun wrote: [...] > > static void __init parse_psr_bool(char *s, char *value, char *feature, > diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c > index e340baa..568bfe9 100644 > --- a/xen/arch/x86/sysctl.c > +++ b/xen/arch/x86/sysctl.c > @@ -181,9 +181,27 @@ long arch_do_sysctl( > ret = psr_get_info(sysctl->u.psr_cat_op.target, > PSR_CBM_TYPE_L3, data, 3); > > - sysctl->u.psr_cat_op.u.l3_info.cbm_len = data[CBM_LEN]; > - sysctl->u.psr_cat_op.u.l3_info.cos_max = data[COS_MAX]; > - sysctl->u.psr_cat_op.u.l3_info.flags = data[PSR_FLAG]; > + if ( !ret ) > + { > + sysctl->u.psr_cat_op.u.l3_info.cbm_len = data[CBM_LEN]; > + sysctl->u.psr_cat_op.u.l3_info.cos_max = data[COS_MAX]; > + sysctl->u.psr_cat_op.u.l3_info.flags = data[PSR_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, 3); Indentation. > + if ( !ret ) > + { > + sysctl->u.psr_cat_op.u.l3_info.cbm_len = data[CBM_LEN]; > + sysctl->u.psr_cat_op.u.l3_info.cos_max = data[COS_MAX]; > + sysctl->u.psr_cat_op.u.l3_info.flags = data[PSR_FLAG]; > + } > + } > > if ( !ret && __copy_field_to_guest(u_sysctl, sysctl, > u.psr_cat_op) ) > ret = -EFAULT; > -- > 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 |