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

[Xen-changelog] [xen-unstable] [POWERPC][XEN] Inline clear_page() and us

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [POWERPC][XEN] Inline clear_page() and use DCBZ to optimize
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Tue, 19 Sep 2006 10:03:22 +0000
Delivery-date: Tue, 19 Sep 2006 03:05:35 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# HG changeset patch
# User Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
# Node ID 9bf0fc041e14494796329f001df9b3e715243db9
# Parent  3ee3376a5eb3112af2578509c2354b0605674903
[POWERPC][XEN] Inline clear_page() and use DCBZ to optimize

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

diff -r 3ee3376a5eb3 -r 9bf0fc041e14 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 3ee3376a5eb3 -r 9bf0fc041e14 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-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog

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