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

[XenPPC] [xenppc-unstable] [POWERPC][XEN] Inline clear_page() and use DC

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [POWERPC][XEN] Inline clear_page() and use DCBZ to optimize
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Thu, 14 Sep 2006 05:40:48 +0000
Delivery-date: Wed, 13 Sep 2006 22:42:32 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
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>
Reply-to: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID f4f153f9960314768307e34700be96139b5faa71
# Parent  e4698a2378a548a4759e0f1f29febc7a706d2364
[POWERPC][XEN] Inline clear_page() and use DCBZ to optimize

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 xen/arch/powerpc/mm.c          |   10 ----------
 xen/include/asm-powerpc/page.h |   19 ++++++++++++++++++-
 2 files changed, 18 insertions(+), 11 deletions(-)

diff -r e4698a2378a5 -r f4f153f99603 xen/arch/powerpc/mm.c
--- a/xen/arch/powerpc/mm.c     Thu Sep 14 01:12:26 2006 -0400
+++ b/xen/arch/powerpc/mm.c     Thu Sep 14 01:36:39 2006 -0400
@@ -207,16 +207,6 @@ long arch_memory_op(int op, XEN_GUEST_HA
 {
     printk("%s: no PPC specific memory ops\n", __func__);
     return -ENOSYS;
-}
-
-void clear_page(void *page)
-{
-    if (on_mambo()) {
-        extern void *mambo_memset(void *,int ,__kernel_size_t);
-        mambo_memset(page, 0, PAGE_SIZE);
-    } else {
-        memset(page, 0, PAGE_SIZE);
-    }
 }
 
 extern void copy_page(void *dp, void *sp)
diff -r e4698a2378a5 -r f4f153f99603 xen/include/asm-powerpc/page.h
--- a/xen/include/asm-powerpc/page.h    Thu Sep 14 01:12:26 2006 -0400
+++ b/xen/include/asm-powerpc/page.h    Thu Sep 14 01:36:39 2006 -0400
@@ -29,6 +29,7 @@
 
 #include <xen/config.h>
 #include <asm/misc.h>
+#include <asm/cache.h>
 
 #define PFN_DOWN(x)   ((x) >> PAGE_SHIFT)
 #define PFN_UP(x)     (((x) + PAGE_SIZE-1) >> PAGE_SHIFT)
@@ -70,7 +71,23 @@ typedef struct { unsigned long l1_lo; } 
 #define pfn_to_paddr(pfn)   ((paddr_t)(pfn) << PAGE_SHIFT)
 #define paddr_to_pfn(pa)    ((unsigned long)((pa) >> PAGE_SHIFT))
 
-extern void clear_page(void *p);
+static __inline__ void clear_page(void *addr)
+{
+       unsigned long lines, line_size;
+
+       line_size = cpu_caches.dline_size;
+       lines = cpu_caches.dlines_per_page;
+
+       __asm__ __volatile__(
+       "mtctr  %1      # clear_page\n\
+1:      dcbz   0,%0\n\
+       add     %0,%0,%3\n\
+       bdnz+   1b"
+    : "=r" (addr)
+    : "r" (lines), "0" (addr), "r" (line_size)
+       : "ctr", "memory");
+}
+
 extern void copy_page(void *dp, void *sp);
 
 #define linear_pg_table linear_l1_table

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

<Prev in Thread] Current Thread [Next in Thread>
  • [XenPPC] [xenppc-unstable] [POWERPC][XEN] Inline clear_page() and use DCBZ to optimize, Xen patchbot-xenppc-unstable <=