[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] Re: [Xen-devel] [PATCH v2 05/15] x86: implement get hw info flow for MBA
On Thu, Aug 24, 2017 at 09:14:39AM +0800, Yi Sun wrote: > diff --git a/xen/arch/x86/sysctl.c b/xen/arch/x86/sysctl.c > index df54d38..cbab85a 100644 > --- a/xen/arch/x86/sysctl.c > +++ b/xen/arch/x86/sysctl.c > @@ -214,6 +214,25 @@ long arch_do_sysctl( > break; > } > > + case XEN_SYSCTL_PSR_MBA_get_info: > + { > + ret = psr_get_info(sysctl->u.psr_alloc_op.target, > + PSR_VAL_TYPE_MBA, data, ARRAY_SIZE(data)); > + if ( ret ) > + break; > + > + sysctl->u.psr_alloc_op.u.mba_info.cos_max = > + data[PSR_INFO_IDX_COS_MAX]; > + sysctl->u.psr_alloc_op.u.mba_info.thrtl_max = > + data[PSR_INFO_IDX_MBA_THRTL_MAX]; > + sysctl->u.psr_alloc_op.u.mba_info.flags = > + data[PSR_INFO_IDX_MBA_FLAG]; > + > + if ( !ret && __copy_field_to_guest(u_sysctl, sysctl, > u.psr_alloc_op) ) > + ret = -EFAULT; The !ret is not needed here AFAICT. If psr_get_info sets ret to != 0 you will break, so you cannot get here with ret != 0. Roger. _______________________________________________ Xen-devel mailing list Xen-devel@xxxxxxxxxxxxx https://lists.xen.org/xen-devel
|
Lists.xenproject.org is hosted with RackSpace, monitoring our |