From: Ian Campbell Subject: Re: [PATCH v2 3/4] libxc/tbuf: Use the xc_hypercall_bounce_[pre|post] instead of memcpy Date: Wed, 18 Jun 2014 14:55:05 +0100 Message-ID: <1403099705.6568.26.camel@kazak.uk.xensource.com> References: <1402692084-931-1-git-send-email-konrad.wilk@oracle.com> <1402692084-931-4-git-send-email-konrad.wilk@oracle.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1402692084-931-4-git-send-email-konrad.wilk@oracle.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: Konrad Rzeszutek Wilk Cc: george.dunlap@eu.citrix.com, ian.jackson@eu.citrix.com, xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org On Fri, 2014-06-13 at 16:41 -0400, Konrad Rzeszutek Wilk wrote: > for bounce buffer of the xc_cpumask_t. You just added this stuff in the previous patch. Why not fold? > Signed-off-by: Konrad Rzeszutek Wilk > --- > tools/libxc/xc_tbuf.c | 13 ++++++------- > 1 files changed, 6 insertions(+), 7 deletions(-) > > diff --git a/tools/libxc/xc_tbuf.c b/tools/libxc/xc_tbuf.c > index 2828aee..85156dd 100644 > --- a/tools/libxc/xc_tbuf.c > +++ b/tools/libxc/xc_tbuf.c > @@ -116,7 +116,7 @@ int xc_tbuf_disable(xc_interface *xch) > int xc_tbuf_set_cpu_mask(xc_interface *xch, xc_cpumap_t mask, int bits) > { > DECLARE_SYSCTL; > - DECLARE_HYPERCALL_BUFFER(uint8_t, bytemap); > + DECLARE_HYPERCALL_BOUNCE(mask, 0, XC_HYPERCALL_BUFFER_BOUNCE_IN); s/0/DIV_ROUND_UP(bits, 8)/ works here and avoids the need for HYPERCALL_BOUNCE_SET_SIZE (I think). The SET_SIZE macro is only generally used when you don't know the size at declaration time (i.e. because you need to query it first). Ian.