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

[Xen-changelog] [xen-unstable] x86: Fix PHYSDEVOP_pirq_eoi_mfn, which I modified and broke.



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1227949672 0
# Node ID a00eb6595d3c4cbfcc24c653c175fe76811c3059
# Parent  4d52d3c53850d998219294941615580be2167964
x86: Fix PHYSDEVOP_pirq_eoi_mfn, which I modified and broke.

Signed-off-by: Keir Fraser <keir.fraser@xxxxxxxxxx>
---
 xen/arch/x86/physdev.c |   28 +++++++++++++++++-----------
 1 files changed, 17 insertions(+), 11 deletions(-)

diff -r 4d52d3c53850 -r a00eb6595d3c xen/arch/x86/physdev.c
--- a/xen/arch/x86/physdev.c    Fri Nov 28 13:28:16 2008 +0000
+++ b/xen/arch/x86/physdev.c    Sat Nov 29 09:07:52 2008 +0000
@@ -202,7 +202,6 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
 
     case PHYSDEVOP_pirq_eoi_mfn: {
         struct physdev_pirq_eoi_mfn info;
-        unsigned long *p;
 
         BUILD_BUG_ON(NR_IRQS > (PAGE_SIZE * 8));
 
@@ -216,16 +215,23 @@ ret_t do_physdev_op(int cmd, XEN_GUEST_H
                                 PGT_writable_page) )
             break;
 
-        ret = -ENOSPC;
-        if ( (p = map_domain_page_global(info.mfn)) == NULL )
-            break;
-
-        ret = -EBUSY;
-        if ( cmpxchg(&v->domain->arch.pirq_eoi_map, NULL, p) != NULL )
-            unmap_domain_page_global(p);
-        else
-            v->domain->arch.pirq_eoi_map_mfn = info.mfn;
-
+        if ( cmpxchg(&v->domain->arch.pirq_eoi_map_mfn, 0, info.mfn) != 0 )
+        {
+            put_page_and_type(mfn_to_page(info.mfn));
+            ret = -EBUSY;
+            break;
+        }
+
+        v->domain->arch.pirq_eoi_map = map_domain_page_global(info.mfn);
+        if ( v->domain->arch.pirq_eoi_map == NULL )
+        {
+            v->domain->arch.pirq_eoi_map_mfn = 0;
+            put_page_and_type(mfn_to_page(info.mfn));
+            ret = -ENOSPC;
+            break;
+        }
+
+        ret = 0;
         break;
     }
 

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