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] [RFC][PATCH] 1/5] [POWERPC] Introduce a PFN decoration.

To: XenPPC-devel <xen-ppc-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [XenPPC] [RFC][PATCH] 1/5] [POWERPC] Introduce a PFN decoration.
From: Tony Breeds <tony@xxxxxxxxxxxxxxxxxx>
Date: Fri, 24 Nov 2006 13:36:01 +1100
Delivery-date: Thu, 23 Nov 2006 18:42:00 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
In-reply-to: <1164335761.320976.914870705193.qpush@thor>
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>
Sender: xen-ppc-devel-bounces@xxxxxxxxxxxxxxxxxxx
This bit can be OR'ed into a MFN, to allow dom0 to map it.

Signed-off-by: Tony Breeds <tony@xxxxxxxxxxxxxxxxxx>
---

 xen/arch/powerpc/mm.c        |    5 ++++-
 xen/include/asm-powerpc/mm.h |    3 +++
 2 files changed, 7 insertions(+), 1 deletion(-)

Index: xenppc-unstable.hg.working/xen/arch/powerpc/mm.c
===================================================================
--- xenppc-unstable.hg.working.orig/xen/arch/powerpc/mm.c
+++ xenppc-unstable.hg.working/xen/arch/powerpc/mm.c
@@ -408,7 +408,10 @@ ulong pfn2mfn(struct domain *d, ulong pf
     ulong foreign_map_pfn = 1UL << cpu_foreign_map_order();
 
     /* quick tests first */
-    if (pfn & foreign_map_pfn) {
+    if (pfn & PFN_DECOR) {
+        /* FIXME: Better PFN_TYPE: PFN_TYPE_XEN? */
+        mfn = pfn & ~(PFN_DECOR);
+    } else if (pfn & foreign_map_pfn) {
         t = PFN_TYPE_FOREIGN;
         mfn = foreign_to_mfn(d, pfn);
     } else if (pfn >= max_page && pfn < (max_page + NR_GRANT_FRAMES)) {
Index: xenppc-unstable.hg.working/xen/include/asm-powerpc/mm.h
===================================================================
--- xenppc-unstable.hg.working.orig/xen/include/asm-powerpc/mm.h
+++ xenppc-unstable.hg.working/xen/include/asm-powerpc/mm.h
@@ -246,6 +246,9 @@ extern unsigned long paddr_to_maddr(unsi
 #define PFN_TYPE_FOREIGN 4
 #define PFN_TYPE_GNTTAB 5
 
+/* Or'd into xenheap MFNs to ensure dom0 can access these pages */
+#define PFN_DECOR      (1<<31)
+
 extern ulong pfn2mfn(struct domain *d, ulong pfn, int *type);
 static inline unsigned long gmfn_to_mfn(struct domain *d, unsigned long gmfn)
 {


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