From: "Jan Beulich" Subject: Re: [PATCH v3 for Xen 4.6 1/4] xen: enable per-VCPU parameter settings for RTDS scheduler Date: Tue, 07 Jul 2015 16:41:37 +0100 Message-ID: <559C0F51020000780008DA51@mail.emea.novell.com> References: <1435545899-22751-1-git-send-email-chong.li@wustl.edu> <1435545899-22751-2-git-send-email-chong.li@wustl.edu> <559BB101020000780008D371@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: Content-Disposition: inline List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Chong Li Cc: Chong Li , Sisu Xi , George Dunlap , "dario.faggioli" , xen-devel , Meng Xu , Dagaen Golomb List-Id: xen-devel@lists.xenproject.org >>> On 07.07.15 at 17:33, wrote: > On Tue, Jul 7, 2015 at 3:59 AM, Jan Beulich wrote: >>>>> On 29.06.15 at 04:44, wrote: >>> + case XEN_DOMCTL_SCHEDOP_putvcpuinfo: >>> + spin_lock_irqsave(&prv->lock, flags); >>> + for( index = 0; index < op->u.v.nr_vcpus; index++ ) >>> + { >>> + if ( copy_from_guest_offset(&local_sched, >>> + op->u.v.vcpus, index, 1) ) >>> + { >>> + rc = -EFAULT; >>> + break; >>> + } >>> + if ( local_sched.vcpuid >= d->max_vcpus >>> + || d->vcpu[local_sched.vcpuid] == NULL ) >>> + { >>> + rc = -EINVAL; >>> + break; >>> + } >>> + svc = rt_vcpu(d->vcpu[local_sched.vcpuid]); >>> + svc->period = MICROSECS(local_sched.s.rtds.period); >>> + svc->budget = MICROSECS(local_sched.s.rtds.budget); >> >> Are all input values valid here? > > Vcpuid, Period and budget have been validated in libxl. But we can > still repeat that validation here, if it's needed. Yes, absolutely. Tool stacks may not be fully trusted (namely in disaggregated setups). Jan