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-devel

Re: [Xen-devel] [PATCH 1/9] Xen Share: Simplified I/O Mechanism

To: Rusty Russell <rusty@xxxxxxxxxxxxxxx>
Subject: Re: [Xen-devel] [PATCH 1/9] Xen Share: Simplified I/O Mechanism
From: Harry Butterworth <harry@xxxxxxxxxxxxxxxxxxxxxxxxxxxxx>
Date: Tue, 06 Jun 2006 15:31:53 +0100
Cc: Xen Mailing List <xen-devel@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Tue, 06 Jun 2006 07:33:16 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1149572143.5183.25.camel@xxxxxxxxxxxxxxxxxxxxx>
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>
References: <1149572143.5183.25.camel@xxxxxxxxxxxxxxxxxxxxx>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Tue, 2006-06-06 at 15:35 +1000, Rusty Russell wrote:

>  static inline int get_page(struct page_info *page,
>                             struct domain *domain)
> +{
> +    u32 x, nx, y = page->count_info;
> +    u32 d, nd = page->u.inuse._domain;
> +    u32 _domain = pickle_domptr(domain);
> +
> +    do {
> +        x  = y;
> +        nx = x + 1;
> +        d  = nd;
> +        if ( unlikely((x & PGC_count_mask) == 0) ||  /* Not allocated? */
> +             unlikely((nx & PGC_count_mask) == 0) ) /* Count overflow? */
> +        {
> +         if ( !_shadow_mode_refcounts(domain) )
> +             DPRINTK("Error pfn %lx: rd=%p, od=%p, caf=%08x, taf=%" 
> PRtype_info "\n",
> +                     page_to_pfn(page), domain, unpickle_domptr(d),
> +                     x, page->u.inuse.type_info);
> +         return 0;
> +        }
> +     if ( unlikely(d != _domain) )               /* Wrong owner? */
> +         return try_shared_page(page, domain);
> +        __asm__ __volatile__(
> +            LOCK_PREFIX "cmpxchg8b %3"
> +            : "=d" (nd), "=a" (y), "=c" (d),
> +              "=m" (*(volatile u64 *)(&page->count_info))
> +            : "0" (d), "1" (x), "c" (d), "b" (nx) );
> +    }
> +    while ( unlikely(nd != d) || unlikely(y != x) );
> +
> +    return 1;
> +}

What is the "=c" (d) there for?  And doesn't cmpxchg8b modify the zero
flag---is it necessary to clobber the condition code register?

> diff -r d5f98d23427a xen/include/public/xen.h
> --- a/xen/include/public/xen.h        Tue May 30 10:44:23 2006
> +++ b/xen/include/public/xen.h        Wed May 31 17:39:54 2006
> @@ -64,6 +64,7 @@
>  #define __HYPERVISOR_xenoprof_op          31
>  #define __HYPERVISOR_event_channel_op     32
>  #define __HYPERVISOR_physdev_op           33
> +#define __HYPERVISOR_share_op             33

Sharing no 33?



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