From mboxrd@z Thu Jan 1 00:00:00 1970 From: David Vrabel Subject: Re: [PATCH v4 1/9] libxc: add DECLARE_HYPERCALL_BUFFER_SHADOW() Date: Wed, 7 May 2014 13:00:45 +0100 Message-ID: <536A206D.2050805@citrix.com> References: <1398883012-28413-1-git-send-email-andrew.cooper3@citrix.com> <1398883012-28413-2-git-send-email-andrew.cooper3@citrix.com> <1399463154.13430.13.camel@kazak.uk.xensource.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1399463154.13430.13.camel@kazak.uk.xensource.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: Ian Campbell , Andrew Cooper Cc: Xen-devel List-Id: xen-devel@lists.xenproject.org On 07/05/14 12:45, Ian Campbell wrote: > On Wed, 2014-04-30 at 19:36 +0100, Andrew Cooper wrote: >> From: David Vrabel >> >> DECLARE_HYPERCALL_BUFFER_SHADOW() is like DECLARE_HYPERCALL_BUFFER() >> except it is backed by an already allocated hypercall buffer. > > I suppose enhancing DECLARE_HYPERCALL_BUFFER_ARGUMENT to have this > property has issues with unused variables? Yes, I think so. Although I didn't actually try it... Perhaps I should. > HYPERCALL_BUFFER_AS_PTR() would have been an alternative implementation > (similar to AS_ARG), I suppose there is no particular reason to prefer > one over the other? Usage of the buffer wouldn't be consistent with a regular DECLARE_HYPERCALL_BUFFER(). It would lead to slightly more confusing code like: DECLARE_HYPERCALL_BUFFER(hbuf); unsigned long *to_send = HYPERCALL_BUFFER_AS_PTR(hbuf); ... if ( test_bit(p, to_send) ) ... rc = xc_shadow_control(xch, ctx->domid, XEN_DOMCTL_SHADOW_OP_CLEAN, hbuf, ctx->save.p2m_size NULL, 0, shadow_stats); And it's not as obvious that hbuf and to_send are really the same buffer without going back to the declarations. David