From: "Jan Beulich" Subject: Re: [PATCH v8 0/8] xen/arm: introduce GNTTABOP_cache_flush Date: Mon, 20 Oct 2014 12:00:06 +0100 Message-ID: <544507560200007800040358@mail.emea.novell.com> References: <5444FF730200007800040308@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 1XgAhB-0007fV-1i for xen-devel@lists.xenproject.org; Mon, 20 Oct 2014 11:00:13 +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 , xen-devel , Ian Campbell List-Id: xen-devel@lists.xenproject.org >>> On 20.10.14 at 12:36, wrote: > On Mon, 20 Oct 2014, Jan Beulich wrote: >> >>> On 20.10.14 at 11:47, wrote: >> > Hi all, >> > this patch series introduces a new hypercall to perform cache >> > maintenance operations on behalf of the guest. It is useful for dom0 to >> > be able to cache flush pages involved in a dma operation with >> > non-coherent devices. >> > >> > It also removes XENFEAT_grant_map_identity as the feature is no longer >> > necessary: it was used to achieve the same goal but the guest can now >> > use the hypercall instead. Keeping the flag would also have a >> > significant performance impact as a new p2m mapping gets created and >> > then destroyed for every grant that is mapped and unmapped in dom0. >> > >> > >> > Changes in v8: >> > - remove unused #include; >> > - set max_nr_grant_frames as __initdata; >> > - set max_grant_frames and max_maptrack_frames as __read_mostly; >> > - respent coding style for comments; >> > - remove MAX_MAPTRACK_TO_GRANTS_RATIO; >> > - avoid security issues, use two separate opaque variables to store the >> > input argument and the output argument; >> >> Security issues? > > The user could have passed in an opaque value for a gnttabop that > doesn't use it, causing Xen to keep looping over the continuation. > I fixed it by using two different variable to save the opaque input and > output. Hmm, but that's not really a security issue, since the preemption in between guarantees Xen's health. All it would end up being is a guest vCPU looping indefinitely. Jan