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

[Xen-changelog] [xen master] Don't take the domain lock for p2m operations.



commit 4936f1eab977818e441946fa614aa2014e8754cc
Author:     Tim Deegan <tim@xxxxxxx>
AuthorDate: Mon Jul 29 12:12:17 2013 +0100
Commit:     Tim Deegan <tim@xxxxxxx>
CommitDate: Mon Jul 29 16:13:19 2013 +0100

    Don't take the domain lock for p2m operations.
    
    P2M ops are covered by their own locks, and these uses of the domain
    lock are relics of shadow-v1 code.
    
    Signed-off-by: Tim Deegan <tim@xxxxxxx>
    Reviewed-by: Andres Lagar-Cavilla <andres@xxxxxxxxxxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    Acked-by: Keir Fraser <keir@xxxxxxx>
---
 xen/arch/arm/mm.c   |    4 ----
 xen/arch/x86/mm.c   |    9 +++------
 xen/common/memory.c |    4 ----
 3 files changed, 3 insertions(+), 14 deletions(-)

diff --git a/xen/arch/arm/mm.c b/xen/arch/arm/mm.c
index d1290cd..f301e65 100644
--- a/xen/arch/arm/mm.c
+++ b/xen/arch/arm/mm.c
@@ -875,13 +875,9 @@ static int xenmem_add_to_physmap_one(
         return -ENOSYS;
     }
 
-    domain_lock(d);
-
     /* Map at new location. */
     rc = guest_physmap_add_page(d, gpfn, mfn, 0);
 
-    domain_unlock(d);
-
     return rc;
 }
 
diff --git a/xen/arch/x86/mm.c b/xen/arch/x86/mm.c
index c00841c..e7f0e13 100644
--- a/xen/arch/x86/mm.c
+++ b/xen/arch/x86/mm.c
@@ -4596,11 +4596,6 @@ static int xenmem_add_to_physmap_once(
         return -EINVAL;
     }
 
-    domain_lock(d);
-
-    if ( page )
-        put_page(page);
-
     /* Remove previously mapped page if it was present. */
     prev_mfn = mfn_x(get_gfn(d, xatp->gpfn, &p2mt));
     if ( mfn_valid(prev_mfn) )
@@ -4631,7 +4626,9 @@ static int xenmem_add_to_physmap_once(
     if ( xatp->space == XENMAPSPACE_gmfn ||
          xatp->space == XENMAPSPACE_gmfn_range )
         put_gfn(d, gfn);
-    domain_unlock(d);
+
+    if ( page )
+        put_page(page);
 
     return rc;
 }
diff --git a/xen/common/memory.c b/xen/common/memory.c
index 06a0d0a..50b740f 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -693,8 +693,6 @@ long do_memory_op(unsigned long cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
             return rc;
         }
 
-        domain_lock(d);
-
         page = get_page_from_gfn(d, xrfp.gpfn, NULL, P2M_ALLOC);
         if ( page )
         {
@@ -704,8 +702,6 @@ long do_memory_op(unsigned long cmd, 
XEN_GUEST_HANDLE_PARAM(void) arg)
         else
             rc = -ENOENT;
 
-        domain_unlock(d);
-
         rcu_unlock_domain(d);
 
         break;
--
generated by git-patchbot for /home/xen/git/xen.git#master

_______________________________________________
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®.