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] Alloc IOMMU to map a Foreign p

To: xen-ppc-devel@xxxxxxxxxxxxxxxxxxx
Subject: [XenPPC] [xenppc-unstable] [POWERPC][XEN] Alloc IOMMU to map a Foreign page
From: Xen patchbot-xenppc-unstable <patchbot-xenppc-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Sun, 08 Oct 2006 18:02:44 +0000
Delivery-date: Sun, 08 Oct 2006 11:32:18 -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 aebee004e517fb391c1345749c71a22861ec254d
# Parent  701c68921ff32370caeaaac17a5e0a25ebc8a83a
[POWERPC][XEN] Alloc IOMMU to map a Foreign page

VIO to a physical device reulsts in the granted page getting mapped
into the IOMMU.

Signed-off-by: Jimi Xenidis <jimix@xxxxxxxxxxxxxx>
---
 xen/arch/powerpc/iommu.c |   35 ++++++++++++++++++++++++++++-------
 1 files changed, 28 insertions(+), 7 deletions(-)

diff -r 701c68921ff3 -r aebee004e517 xen/arch/powerpc/iommu.c
--- a/xen/arch/powerpc/iommu.c  Wed Oct 04 14:06:14 2006 -0400
+++ b/xen/arch/powerpc/iommu.c  Sat Oct 07 15:38:27 2006 -0400
@@ -32,6 +32,12 @@
 #include "tce.h"
 #include "iommu.h"
 
+#ifdef DEBUG
+#define DBG(fmt...) printk(fmt)
+#else
+#define DBG(fmt...)
+#endif
+
 struct iommu_funcs {
     int (*iommu_put)(ulong, union tce);
 };
@@ -46,16 +52,31 @@ int iommu_put(u32 buid, ulong ioba, unio
     struct domain *d = v->domain;
 
     if (buid < iommu_phbs_num && iommu_phbs[buid].iommu_put != NULL) {
-        ulong gpfn;
+        ulong gmfn;
         ulong mfn;
+        int mtype;
 
-        gpfn = tce.tce_bits.tce_rpn;
-        mfn = gmfn_to_mfn(d, gpfn);
+        gmfn = tce.tce_bits.tce_rpn;
+
+        
+        mfn = pfn2mfn(d, gmfn, &mtype);
         if (mfn != INVALID_MFN) {
-#ifdef DEBUG
-            printk("%s: ioba=0x%lx pfn=0x%lx mfn=0x%lx\n", __func__,
-                   ioba, pfn, mfn);
-#endif
+            switch (mtype) {
+            case PFN_TYPE_RMA:
+            case PFN_TYPE_LOGICAL:
+                break;
+            case PFN_TYPE_FOREIGN:
+                DBG("%s: assigning to Foriegn page: "
+                    "gmfn: 0x%lx mfn: 0x%lx\n",  __func__, gmfn, mfn);
+                break;
+            default:
+                printk("%s: unsupported type[%d]: gmfn: 0x%lx mfn: 0x%lx\n",
+                       __func__, mtype, gmfn, mfn);
+                return -1;
+            break;
+            }
+            DBG("%s: ioba=0x%lx gmfn=0x%lx mfn=0x%lx\n", __func__,
+                ioba, gmfn, mfn);
             tce.tce_bits.tce_rpn = mfn;
             return iommu_phbs[buid].iommu_put(ioba, tce);
         }

_______________________________________________
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] Alloc IOMMU to map a Foreign page, Xen patchbot-xenppc-unstable <=