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-changelog

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

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] [XEN] gnttab: Read domid/flags atomically.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Wed, 06 Sep 2006 04:01:09 +0000
Delivery-date: Tue, 05 Sep 2006 21:01:40 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-changelog-request@lists.xensource.com?subject=help>
List-id: BK change log <xen-changelog.lists.xensource.com>
List-post: <mailto:xen-changelog@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=unsubscribe>
Reply-to: xen-devel@xxxxxxxxxxxxxxxxxxx
Sender: xen-changelog-bounces@xxxxxxxxxxxxxxxxxxx
# 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] [XEN] gnttab: Read domid/flags atomically., Xen patchbot-unstable <=