From: "Jan Beulich" Subject: Re: [PATCH v5 6/8] xen/arm: introduce GNTTABOP_cache_flush Date: Thu, 16 Oct 2014 13:05:59 +0100 Message-ID: <543FD0C7020000780003F33D@mail.emea.novell.com> References: <1413212324-664-6-git-send-email-stefano.stabellini@eu.citrix.com> <543D1E61020000780003EB16@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1Xejof-0004Ec-Fa for xen-devel@lists.xenproject.org; Thu, 16 Oct 2014 12:06:01 +0000 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: Stefano Stabellini Cc: julien.grall@citrix.com, xen-devel , Ian.Campbell@citrix.com List-Id: xen-devel@lists.xenproject.org >>> On 16.10.14 at 12:55, wrote: > On Tue, 14 Oct 2014, Jan Beulich wrote: >> >>> On 13.10.14 at 16:58, wrote: >> > +static bool_t grant_map_exists(const struct domain *ld, >> > + struct grant_table *rgt, >> > + unsigned long mfn) >> > +{ >> > + const struct active_grant_entry *act; >> > + grant_ref_t ref; >> > + >> > + ASSERT(spin_is_locked(&rgt->lock)); >> > + >> > + for ( ref = 0; ref != nr_grant_entries(rgt); ref++ ) >> >> Unless I overlooked something here or in an earlier patch I think >> you're _still_ not enforcing a suitably low upper limit on the >> variable that controls the maximum iteration count here. Whether >> you enforce this the hard way (by just capping an eventual >> command line specified value) or the soft way (by issuing a >> warning that such a setting may hamper security, plus >> documenting the supported value range) is up to you. > > What value range do you suggest? Whatever is suitable to limit the loop to no more than a few thousand iterations. Jan