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

[Xen-changelog] [xen-unstable] [XEN] gnttab: Read domid/flags atomically.



# HG changeset patch
# User kfraser@xxxxxxxxxxxxxxxxxxxxxxxxxxx
# Node ID 383bc7c7b19e9a716f6c50bfd978368d8923cf6b
# Parent  698eb277331ca50f4eb514c693e6fae12afdb395
[XEN] gnttab: Read domid/flags atomically.

This more neatly matches how the two adjacent fields in
the grant-table entry are accessed by the cmpxchg()
function.

Signed-off-by: Herbert Xu <herbert@xxxxxxxxxxxxxxxxxxx>
---
 xen/common/grant_table.c |    9 +++------
 1 files changed, 3 insertions(+), 6 deletions(-)

diff -r 698eb277331c -r 383bc7c7b19e xen/common/grant_table.c
--- a/xen/common/grant_table.c  Tue Sep 05 18:28:27 2006 -0700
+++ b/xen/common/grant_table.c  Tue Sep 05 18:36:23 2006 -0700
@@ -184,8 +184,7 @@ __gnttab_map_grant_ref(
          (!(op->flags & GNTMAP_readonly) &&
           !(act->pin & (GNTPIN_hstw_mask|GNTPIN_devw_mask))) )
     {
-        scombo.shorts.flags = sha->flags;
-        scombo.shorts.domid = sha->domid;
+        scombo.word = *(u32 *)&sha->flags;
 
         /*
          * This loop attempts to set the access (reading/writing) flags
@@ -556,8 +555,7 @@ gnttab_prepare_for_transfer(
 
     sha = &rgt->shared[ref];
     
-    scombo.shorts.flags = sha->flags;
-    scombo.shorts.domid = sha->domid;
+    scombo.word = *(u32 *)&sha->flags;
 
     for ( ; ; )
     {
@@ -774,8 +772,7 @@ __acquire_grant_for_copy(
     if ( !act->pin ||
          (!readonly && !(act->pin & (GNTPIN_devw_mask|GNTPIN_hstw_mask))) )
     {
-        scombo.shorts.flags = sha->flags;
-        scombo.shorts.domid = sha->domid;
+        scombo.word = *(u32 *)&sha->flags;
 
         for ( ; ; )
         {

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxxxxxxxx
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®.