From: Jaeyong Yoo Subject: Re: [PATCH RFC v2 7/9] xen/arm: Missing impl of clear_guest_offset macro Date: Thu, 04 Jul 2013 09:09:58 +0900 Message-ID: <003701ce784a$d1bd24f0$75376ed0$%yoo@samsung.com> References: <1372842943-27482-1-git-send-email-jaeyong.yoo@samsung.com> <1372842943-27482-8-git-send-email-jaeyong.yoo@samsung.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-reply-to: Content-language: ko 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: xen-devel@lists.xen.org List-Id: xen-devel@lists.xenproject.org > -----Original Message----- > From: Stefano Stabellini [mailto:stefano.stabellini@eu.citrix.com] > Sent: Wednesday, July 03, 2013 8:37 PM > To: Jaeyong Yoo > Cc: xen-devel@lists.xen.org > Subject: Re: [Xen-devel] [PATCH RFC v2 7/9] xen/arm: Missing impl of > clear_guest_offset macro > > On Wed, 3 Jul 2013, Jaeyong Yoo wrote: > > This macro is somehow accidently broken. Fill up the rest of it. > > > > Signed-off-by: Jaeyong Yoo > > --- > > xen/include/asm-arm/guest_access.h | 6 ++++-- > > 1 file changed, 4 insertions(+), 2 deletions(-) > > > > diff --git a/xen/include/asm-arm/guest_access.h > > b/xen/include/asm-arm/guest_access.h > > index 34aae14..1104090 100644 > > --- a/xen/include/asm-arm/guest_access.h > > +++ b/xen/include/asm-arm/guest_access.h > > @@ -77,8 +77,10 @@ unsigned long raw_clear_guest(void *to, unsigned len); > > * Clear an array of objects in guest context via a guest handle, > > * specifying an offset into the guest array. > > */ > > -#define clear_guest_offset(hnd, off, ptr, nr) ({ \ > > - raw_clear_guest(_d+(off), nr); \ > > +#define clear_guest_offset(hnd, off, ptr, nr) ({ \ > > + const typeof(*(ptr)) *_s = (ptr); \ > > + char (*_d)[sizeof(*_s)] = (void *)(hnd).p; \ > > + raw_clear_guest(_d+(off), nr); \ > > }) > > You are right that is broken, in fact shouldn't this macro have only 3 > arguments? Oops right! Jaeyong