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

[Xen-devel] [PATCH] x86: fix error handling in MTRR code

To: <xen-devel@xxxxxxxxxxxxxxxxxxx>
Subject: [Xen-devel] [PATCH] x86: fix error handling in MTRR code
From: "Jan Beulich" <jbeulich@xxxxxxxxxx>
Date: Wed, 04 Oct 2006 17:15:29 +0200
Delivery-date: Wed, 04 Oct 2006 08:14:24 -0700
Envelope-to: www-data@xxxxxxxxxxxxxxxxxx
List-help: <mailto:xen-devel-request@lists.xensource.com?subject=help>
List-id: Xen developer discussion <xen-devel.lists.xensource.com>
List-post: <mailto:xen-devel@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/cgi-bin/mailman/listinfo/xen-devel>, <mailto:xen-devel-request@lists.xensource.com?subject=unsubscribe>
Sender: xen-devel-bounces@xxxxxxxxxxxxxxxxxxx
Signed-off-by: Jan Beulich <jbeulich@xxxxxxxxxx>

Index: 2006-09-21/xen/arch/x86/platform_hypercall.c
===================================================================
--- 2006-09-21.orig/xen/arch/x86/platform_hypercall.c   2006-08-28 
08:32:37.000000000 +0200
+++ 2006-09-21/xen/arch/x86/platform_hypercall.c        2006-09-27 
17:14:22.000000000 +0200
@@ -58,12 +58,17 @@ long do_platform_op(XEN_GUEST_HANDLE(xen
             op->u.add_memtype.nr_mfns,
             op->u.add_memtype.type,
             1);
-        if ( ret > 0 )
+        if ( ret >= 0 )
         {
             op->u.add_memtype.handle = 0;
             op->u.add_memtype.reg    = ret;
-            (void)copy_to_guest(u_xenpf_op, op, 1);
-            ret = 0;
+            if ( copy_to_guest(u_xenpf_op, op, 1) == 0 )
+                ret = 0;
+            else
+            {
+                mtrr_del_page(ret, 0, 0);
+                ret = -EFAULT;
+            }
         }
     }
     break;
@@ -96,8 +101,10 @@ long do_platform_op(XEN_GUEST_HANDLE(xen
             op->u.read_memtype.mfn     = mfn;
             op->u.read_memtype.nr_mfns = nr_mfns;
             op->u.read_memtype.type    = type;
-            (void)copy_to_guest(u_xenpf_op, op, 1);
-            ret = 0;
+            if ( copy_to_guest(u_xenpf_op, op, 1) == 0 )
+                ret = 0;
+            else
+                ret = -EFAULT;
         }
     }
     break;


_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxx
http://lists.xensource.com/xen-devel

<Prev in Thread] Current Thread [Next in Thread>
  • [Xen-devel] [PATCH] x86: fix error handling in MTRR code, Jan Beulich <=