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: Inline assembler for clear_page() and copy_page()

To: poff@xxxxxxxxxxxxxx
Subject: Re: [XenPPC] PATCH: Inline assembler for clear_page() and copy_page()
From: Hollis Blanchard <hollisb@xxxxxxxxxx>
Date: Mon, 28 Aug 2006 09:50:20 -0500
Cc: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Delivery-date: Mon, 28 Aug 2006 07:49:57 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <200608252148.k7PLmVt946426@xxxxxxxxxxxxxxxxxxxx>
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 Linux Technology Center
References: <200608252148.k7PLmVt946426@xxxxxxxxxxxxxxxxxxxx>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
On Fri, 2006-08-25 at 17:48 -0400, poff@xxxxxxxxxxxxxx wrote:
> +/* assumes destination page, *dp, is cacheable */
> +static __inline__ void copy_page_cacheable(void *dp, void *sp)
> +{
> +       unsigned long dwords, dword_size;
> +
> +       dword_size = 8;
> +       dwords = (PAGE_SIZE / dword_size) - 1;
> +
> +       clear_page_cacheable(dp);
> +
> +       __asm__ __volatile__(
> +       "mtctr  %2      # copy_page\n\
> +       ld      %2,0(%1)\n\
> +       std     %2,0(%0)\n\
> +1:     ldu     %2,8(%1)\n\
> +       stdu    %2,8(%0)\n\
> +       bdnz    1b"
> +       : /* no result */
> +       : "r" (dp), "r" (sp), "r" (dwords)
> +       : "%ctr", "memory");
> +} 

I would expect to see dcbtst in here, no?

Both functions (copy and clear) could stand a little loop unrolling.

I can understand if you're not *really* trying to optimize these, but in
that case why do you want to add dcbz? Is there a noticeable performance
improvement?

Also, it looks like you've removed support for mambo_memcpy(). I don't
use Mambo *ahem* systemsim myself, but that seems worth keeping. I guess
you could rename the function while you're in there. :)

-- 
Hollis Blanchard
IBM Linux Technology Center


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