# HG changeset patch
# User Jimi Xenidis <[EMAIL PROTECTED]>
# Node ID 30abfbe6e047859c7ef8884e27594bd41ea45028
# Parent  11ee20d418ea813709da4c86dbc4ae28efb17f36
[LINUX][XEN] Use the arch supplied update_vm_area() function

Some architectures need to update the vm_area after the GNTTAB_map
takes place.

Signed-off-by: Jimi Xenidis <[EMAIL PROTECTED]>
---
 drivers/xen/blkback/interface.c            |    1 +
 drivers/xen/netback/interface.c            |    2 ++
 drivers/xen/tpmback/interface.c            |    1 +
 drivers/xen/xenbus/xenbus_backend_client.c |    1 +
 include/xen/driver_util.h                  |    7 +++++++
 5 files changed, 12 insertions(+)

diff -r 11ee20d418ea -r 30abfbe6e047 drivers/xen/blkback/interface.c
--- a/drivers/xen/blkback/interface.c   Sun Oct 08 12:28:37 2006 -0400
+++ b/drivers/xen/blkback/interface.c   Sun Oct 08 12:34:23 2006 -0400
@@ -64,6 +64,7 @@ static int map_frontend_page(blkif_t *bl
 
        lock_vm_area(blkif->blk_ring_area);
        ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1);
+       update_vm_area(blkif->blk_ring_area, &op);
        unlock_vm_area(blkif->blk_ring_area);
        BUG_ON(ret);
 
diff -r 11ee20d418ea -r 30abfbe6e047 drivers/xen/netback/interface.c
--- a/drivers/xen/netback/interface.c   Sun Oct 08 12:28:37 2006 -0400
+++ b/drivers/xen/netback/interface.c   Sun Oct 08 12:34:23 2006 -0400
@@ -190,6 +190,7 @@ static int map_frontend_pages(
     
        lock_vm_area(netif->tx_comms_area);
        ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1);
+       update_vm_area(netif->tx_comms_area, &op);
        unlock_vm_area(netif->tx_comms_area);
        BUG_ON(ret);
 
@@ -206,6 +207,7 @@ static int map_frontend_pages(
 
        lock_vm_area(netif->rx_comms_area);
        ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1);
+       update_vm_area(netif->rx_comms_area, &op);
        unlock_vm_area(netif->rx_comms_area);
        BUG_ON(ret);
 
diff -r 11ee20d418ea -r 30abfbe6e047 drivers/xen/tpmback/interface.c
--- a/drivers/xen/tpmback/interface.c   Sun Oct 08 12:28:37 2006 -0400
+++ b/drivers/xen/tpmback/interface.c   Sun Oct 08 12:34:23 2006 -0400
@@ -82,6 +82,7 @@ static int map_frontend_page(tpmif_t *tp
 
        lock_vm_area(tpmif->tx_area);
        ret = HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1);
+       update_vm_area(tpmif->tx_area, op);
        unlock_vm_area(tpmif->tx_area);
        BUG_ON(ret);
 
diff -r 11ee20d418ea -r 30abfbe6e047 drivers/xen/xenbus/xenbus_backend_client.c
--- a/drivers/xen/xenbus/xenbus_backend_client.c        Sun Oct 08 12:28:37 
2006 -0400
+++ b/drivers/xen/xenbus/xenbus_backend_client.c        Sun Oct 08 12:34:23 
2006 -0400
@@ -50,6 +50,7 @@ struct vm_struct *xenbus_map_ring_valloc
        
        lock_vm_area(area);
        BUG_ON(HYPERVISOR_grant_table_op(GNTTABOP_map_grant_ref, &op, 1));
+       update_vm_area(area, &op);
        unlock_vm_area(area);
 
        if (op.status != GNTST_okay) {
diff -r 11ee20d418ea -r 30abfbe6e047 include/xen/driver_util.h
--- a/include/xen/driver_util.h Sun Oct 08 12:28:37 2006 -0400
+++ b/include/xen/driver_util.h Sun Oct 08 12:34:23 2006 -0400
@@ -4,10 +4,17 @@
 
 #include <linux/config.h>
 #include <linux/vmalloc.h>
+#include <xen/interface/xen.h>
+#include <xen/interface/grant_table.h>
 
 /* Allocate/destroy a 'vmalloc' VM area. */
 extern struct vm_struct *alloc_vm_area(unsigned long size);
 extern void free_vm_area(struct vm_struct *area);
+#ifdef CONFIG_PPC_XEN
+extern void update_vm_area(struct vm_struct *area, struct gnttab_map_grant_ref 
*op);
+#else
+#define update_vm_area(a,o)
+#endif
 
 /* Lock an area so that PTEs are accessible in the current address space. */
 extern void lock_vm_area(struct vm_struct *area);

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

Reply via email to