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