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

[Xen-changelog] [xen-unstable] x86/mm: set_p2m_entry() should return 0 on error



# HG changeset patch
# User Keir Fraser <keir.fraser@xxxxxxxxxx>
# Date 1259577538 0
# Node ID c4e620a2e65ce57dcee738b520e9ff1d5355a925
# Parent  d0b030008814628b605a2ce441bba9ad62565e8a
x86/mm: set_p2m_entry() should return 0 on error

set_p2m_entry() ignores halfway errors.
It should return 0 on error.

Signed-off-by: Kouya Shimura <kouya@xxxxxxxxxxxxxx>
Acked-by: Tim Deegan <Tim.Deegan@xxxxxxxxxx>
---
 xen/arch/x86/mm/p2m.c |    5 +++--
 1 files changed, 3 insertions(+), 2 deletions(-)

diff -r d0b030008814 -r c4e620a2e65c xen/arch/x86/mm/p2m.c
--- a/xen/arch/x86/mm/p2m.c     Fri Nov 27 08:09:26 2009 +0000
+++ b/xen/arch/x86/mm/p2m.c     Mon Nov 30 10:38:58 2009 +0000
@@ -1497,7 +1497,7 @@ int set_p2m_entry(struct domain *d, unsi
 {
     unsigned long todo = 1ul << page_order;
     unsigned int order;
-    int rc = 0;
+    int rc = 1;
 
     while ( todo )
     {
@@ -1506,7 +1506,8 @@ int set_p2m_entry(struct domain *d, unsi
                 9 : 0;
         else
             order = 0;
-        rc = d->arch.p2m->set_entry(d, gfn, mfn, order, p2mt);
+        if ( !d->arch.p2m->set_entry(d, gfn, mfn, order, p2mt) )
+            rc = 0;
         gfn += 1ul << order;
         if ( mfn_x(mfn) != INVALID_MFN )
             mfn = _mfn(mfn_x(mfn) + (1ul << order));

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