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] x86: Fix PHYSDEVOP_pirq_eoi_mfn, which I

To: xen-changelog@xxxxxxxxxxxxxxxxxxx
Subject: [Xen-changelog] [xen-unstable] x86: Fix PHYSDEVOP_pirq_eoi_mfn, which I modified and broke.
From: Xen patchbot-unstable <patchbot-unstable@xxxxxxxxxxxxxxxxxxx>
Date: Mon, 01 Dec 2008 03:51:04 -0800
Delivery-date: Mon, 01 Dec 2008 03:55:20 -0800
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
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/mailman/listinfo/xen-changelog>, <mailto:xen-changelog-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/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 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

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-changelog] [xen-unstable] x86: Fix PHYSDEVOP_pirq_eoi_mfn, which I modified and broke., Xen patchbot-unstable <=