WARNING - OLD ARCHIVES

This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
   
 
 
Xen 
 
Home Products Support Community News
 
   
 

xen-ppc-devel

Re: [XenPPC] [PATCH] Fix xchg api to for Xen-unstable

To: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
Subject: Re: [XenPPC] [PATCH] Fix xchg api to for Xen-unstable
From: Jerone Young <jyoung5@xxxxxxxxxx>
Date: Wed, 04 Apr 2007 21:43:31 -0500
Cc: xen-ppc-devel <xen-ppc-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Wed, 04 Apr 2007 19:42:12 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <7891B38F-BA8D-4E57-9662-0B289F739656@xxxxxxxxxxxxxx>
List-help: <mailto:xen-ppc-devel-request@lists.xensource.com?subject=help>
List-id: Xen PPC development <xen-ppc-devel.lists.xensource.com>
List-post: <mailto:xen-ppc-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-ppc-devel>, <mailto:xen-ppc-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM
References: <1175666682.23487.10.camel@laptop> <7891B38F-BA8D-4E57-9662-0B289F739656@xxxxxxxxxxxxxx>
Reply-to: jyoung5@xxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Wed, 2007-04-04 at 08:57 -0400, Jimi Xenidis wrote:
> hmm, how did this ever work?!
> I your problem with a direct caller of __xchg() or is this thru the  
> macro xchg()?

The caller is in common/domain.c @ line 310:

/* Already dying? Then bail. */
    if ( xchg(&d->is_dying, 1) )
    {
        domain_unpause(d);
        return;
    }


The current macro matches that one in x86. But the parameters we have
for __xchg are not in the same order. So one has to change to be right.

> 
> I notice we have the macro wrong (at least in my copy of xen source):
>    #define xchg(ptr,v) ((__typeof__(*(ptr)))__xchg((unsigned long)(v), 
> (ptr),sizeof(*(ptr))))
> 
> where it should be (from Linux):
>    #define xchg(ptr,x)                                                        
>      \
>    ({                                                                      \
>       __typeof__(*(ptr)) _x_ = (x);                                        \
>       (__typeof__(*(ptr))) __xchg((ptr), (unsigned long)_x_, sizeof(* 
> (ptr))); \
>    })
> 
> Will that change fix your issue?

Doubtful..see use of code above.

> I'd rather not change __xchg().

Ok .. I've attached a patch to this email with that change instead of
changing __xchg()
> 
> -JX
> 
> On Apr 4, 2007, at 2:04 AM, Jerone Young wrote:
> 
> > This fixes the api for __xchg function in system.h so that PPC Xen can
> > build correctly in Xen unstable. This is the same API used in the  
> > __xchg
> > on x86.
> >
> > Signed-off-by: Jerone Young <jyoung5@xxxxxxxxxx>
> >
> >
> > diff -r 7e431ea834a8 xen/include/asm-powerpc/system.h
> > --- a/xen/include/asm-powerpc/system.h  Tue Apr 03 13:22:37 2007 +0100
> > +++ b/xen/include/asm-powerpc/system.h  Wed Jan 29 05:37:30 2031 -0600
> > @@ -73,7 +73,7 @@ extern void __xchg_called_with_bad_point
> >  extern void __xchg_called_with_bad_pointer(void);
> >
> >  static __inline__ unsigned long
> > -__xchg(volatile void *ptr, unsigned long x, int size)
> > +__xchg(unsigned long x, volatile void *ptr, int size)
> >  {
> >      switch (size) {
> >      case 4:
> >
> >
> >
> >
> > _______________________________________________
> > Xen-ppc-devel mailing list
> > Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
> > http://lists.xensource.com/xen-ppc-devel
> 


_______________________________________________
Xen-ppc-devel mailing list
Xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-ppc-devel