[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen-unstable] xen/arm: grant table


  • To: xen-changelog@xxxxxxxxxxxxxxxxxxx
  • From: Xen patchbot-unstable <patchbot@xxxxxxx>
  • Date: Fri, 19 Oct 2012 22:11:10 +0000
  • Delivery-date: Fri, 19 Oct 2012 22:11:19 +0000
  • List-id: "Change log for Mercurial \(receive only\)" <xen-changelog.lists.xen.org>

# HG changeset patch
# User Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
# Date 1350488627 -3600
# Node ID b146705d70b3c8e135cfc06a38875e45fd34d638
# Parent  bbe9860189490b04a20595328c391b40717fc9cd
xen/arm: grant table

Implement XENMAPSPACE_grant_table and grant_table_op.

Signed-off-by: Stefano Stabellini <stefano.stabellini@xxxxxxxxxxxxx>
Acked-by: Tim Deegan <tim@xxxxxxx>
[ ijc -- fixed reject in traps.c, grant table op is a 3 argument
         hypercall, rebased over "xen: arm: implement
         XENMEM_add_to_physmap_range"
]
Signed-off-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
Committed-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
---


diff -r bbe986018949 -r b146705d70b3 xen/arch/arm/mm.c
--- a/xen/arch/arm/mm.c Wed Oct 17 16:43:46 2012 +0100
+++ b/xen/arch/arm/mm.c Wed Oct 17 16:43:47 2012 +0100
@@ -25,6 +25,7 @@
 #include <xen/mm.h>
 #include <xen/preempt.h>
 #include <xen/errno.h>
+#include <xen/grant_table.h>
 #include <xen/softirq.h>
 #include <xen/event.h>
 #include <xen/guest_access.h>
@@ -473,6 +474,31 @@ static int xenmem_add_to_physmap_one(
 
     switch ( space )
     {
+    case XENMAPSPACE_grant_table:
+        spin_lock(&d->grant_table->lock);
+
+        if ( d->grant_table->gt_version == 0 )
+            d->grant_table->gt_version = 1;
+
+        if ( d->grant_table->gt_version == 2 &&
+                (idx & XENMAPIDX_grant_table_status) )
+        {
+            idx &= ~XENMAPIDX_grant_table_status;
+            if ( idx < nr_status_frames(d->grant_table) )
+                mfn = virt_to_mfn(d->grant_table->status[idx]);
+        }
+        else
+        {
+            if ( (idx >= nr_grant_frames(d->grant_table)) &&
+                    (idx < max_nr_grant_frames) )
+                gnttab_grow_table(d, idx + 1);
+
+            if ( idx < nr_grant_frames(d->grant_table) )
+                mfn = virt_to_mfn(d->grant_table->shared_raw[idx]);
+        }
+
+        spin_unlock(&d->grant_table->lock);
+        break;
     case XENMAPSPACE_shared_info:
         if ( idx == 0 )
             mfn = virt_to_mfn(d->shared_info);
diff -r bbe986018949 -r b146705d70b3 xen/arch/arm/traps.c
--- a/xen/arch/arm/traps.c      Wed Oct 17 16:43:46 2012 +0100
+++ b/xen/arch/arm/traps.c      Wed Oct 17 16:43:47 2012 +0100
@@ -438,6 +438,7 @@ static arm_hypercall_t arm_hypercall_tab
     HYPERCALL(physdev_op, 2),
     HYPERCALL(sysctl, 2),
     HYPERCALL(hvm_op, 2),
+    HYPERCALL(grant_table_op, 3),
 };
 
 static void do_debug_trap(struct cpu_user_regs *regs, unsigned int code)

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.