From: Ian Campbell Subject: Re: [PATCH v2 3/4] xen/arm: introduce GNTTABOP_cache_flush Date: Fri, 3 Oct 2014 17:37:52 +0100 Message-ID: <1412354272.12695.39.camel@citrix.com> References: <1412347845-27755-3-git-send-email-stefano.stabellini@eu.citrix.com> <542EBDE1.2000702@citrix.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: 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, Andrew Cooper , xen-devel@lists.xensource.com List-Id: xen-devel@lists.xenproject.org On Fri, 2014-10-03 at 17:33 +0100, Stefano Stabellini wrote: > On Fri, 3 Oct 2014, Andrew Cooper wrote: > > On 03/10/14 15:50, Stefano Stabellini wrote: > > > Introduce a new hypercall to perform cache maintenance operation on > > > behalf of the guest. The argument is a machine address and a size. The > > > implementation checks that the memory range is owned by the guest or the > > > guest has been granted access to it by another domain. > > > > > > Signed-off-by: Stefano Stabellini > > > > > > --- > > > > > > Changes in v2: > > > - do not check for mfn_to_page errors; > > > - take a reference to the page; > > > - replace printk with gdprintk; > > > - split long line; > > > - remove out label; > > > - move rcu_lock_current_domain down before the loop. > > > - move the hypercall to GNTTABOP; > > > - take a spin_lock before calling grant_map_exists. > > > --- > > > xen/common/grant_table.c | 73 ++++++++++++++++++++++++++++++++++++++ > > > xen/include/public/grant_table.h | 19 ++++++++++ > > > 2 files changed, 92 insertions(+) > > > > > > diff --git a/xen/common/grant_table.c b/xen/common/grant_table.c > > > index 7a6399b..d5bb4f7 100644 > > > --- a/xen/common/grant_table.c > > > +++ b/xen/common/grant_table.c > > > @@ -2641,6 +2641,79 @@ do_grant_table_op( > > > } > > > break; > > > } > > > + case GNTTABOP_cache_flush: > > > + { > > > + struct gnttab_cache_flush cflush; > > > + struct domain *d, *owner; > > > + struct page_info *page; > > > + uint64_t mfn; > > > + void *v; > > > + > > > + /* currently unimplemented */ > > > + if ( count != 1 ) > > > + return -ENOSYS; > > > > ENOTSUPP (and elsewhere). > > ENOTSUPP doesn't seem to be defined in Xen. Should I take the > opportunity to introduce it as 252? Use EOPNOTSUPP I think.