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

[Xen-devel] Re: [Xen-changelog] [xen-unstable] xen: Split domain_flags i

To: Keir Fraser <keir@xxxxxxxxxxxxx>
Subject: [Xen-devel] Re: [Xen-changelog] [xen-unstable] xen: Split domain_flags into discrete first-class fields in the
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Thu, 05 Apr 2007 10:44:03 -0500
Cc: xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxx>, xen-ppc-devel <xen-ppc-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 05 Apr 2007 08:43:00 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200703302310.l2UNAF7O021926@xxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Organization: IBM Linux Technology Center
References: <200703302310.l2UNAF7O021926@xxxxxxxxxxxxxxxxxxxxxx>
Reply-to: Hollis Blanchard <hollisb@xxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, 2007-03-30 at 16:10 -0700, Xen patchbot-unstable wrote:
> # HG changeset patch
> # User kfraser@xxxxxxxxxxxxxxxxxxxxx
> # Date 1175177666 -3600
> # Node ID 4b13fc910acf0019c27cbae35181433b381e88d1
> # Parent  31f20aaac8188bc1366b80e55e47b328db425180
> xen: Split domain_flags into discrete first-class fields in the
> domain structure. This makes them quicker to access, and simplifies
> domain pause and checking of runnable status.

> diff -r 31f20aaac818 -r 4b13fc910acf xen/common/domain.c
> --- a/xen/common/domain.c     Thu Mar 29 13:29:24 2007 +0100
> +++ b/xen/common/domain.c     Thu Mar 29 15:14:26 2007 +0100
> @@ -262,8 +264,12 @@ void domain_kill(struct domain *d)
>  {
>      domain_pause(d);
> 
> -    if ( test_and_set_bit(_DOMF_dying, &d->domain_flags) )
> +    /* Already dying? Then bail. */
> +    if ( xchg(&d->is_dying, 1) )
>          return;
> +
> +    /* Tear down state /after/ setting the dying flag. */
> +    smp_wmb();
> 
>      gnttab_release_mappings(d);
>      domain_relinquish_resources(d);

You're now doing xchg() on a 1-byte variable, which does not work on
PowerPC.

This is an interface problem: using the interface in a way that works on
x86 fails on other architectures. PLEASE let's redefine the interface to
prevent this from happening. In this case, that means replacing the
xchg() macro with
        static inline xchg(atomic_t *ptr, atomic_t val)
and changing the type of 'is_dying'.

-- 
Hollis Blanchard
IBM Linux Technology Center


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