From: Andrew Cooper Subject: [PATCH 3/4] sched/arinc653: Remove MAX_VIRT_CPUS bounds check Date: Mon, 19 Jan 2015 11:21:35 +0000 Message-ID: <1421666496-10676-4-git-send-email-andrew.cooper3@citrix.com> References: <1421666496-10676-1-git-send-email-andrew.cooper3@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1421666496-10676-1-git-send-email-andrew.cooper3@citrix.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Xen-devel Cc: Andrew Cooper , Keir Fraser , Nathan Studer , Jan Beulich , Robert VanVossen List-Id: xen-devel@lists.xenproject.org The arinc653 interface is capable of specifying a domain in the schedule (from the toolstack) before the domain itself exists, or is present in the cpupool (The domain is identified by UUID rather than domid). As a result, the schedule can't be validated at this point. The vcpu_id from userspace is only ever used to compare against a list of real vcpus available to the scheduler, which prevents ill-specified vcpus from actually being scheduled. Remove the MAX_VIRT_CPUS test, as it is not an appropriate bound for vcpu_id. Signed-off-by: Andrew Cooper CC: Keir Fraser CC: Jan Beulich CC: Nathan Studer CC: Robert VanVossen --- xen/common/sched_arinc653.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/xen/common/sched_arinc653.c b/xen/common/sched_arinc653.c index 5f09ded..819b869 100644 --- a/xen/common/sched_arinc653.c +++ b/xen/common/sched_arinc653.c @@ -246,9 +246,8 @@ arinc653_sched_set( for ( i = 0; i < schedule->num_sched_entries; i++ ) { - /* Check for a valid VCPU ID and run time. */ - if ( (schedule->sched_entries[i].vcpu_id >= MAX_VIRT_CPUS) - || (schedule->sched_entries[i].runtime <= 0) ) + /* Check for a valid run time. */ + if ( schedule->sched_entries[i].runtime <= 0 ) goto fail; /* Add this entry's run time to total run time. */ -- 1.7.10.4