Callers of __gpfn_to_mfn() do not need to check
authorkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 25 Jan 2006 18:16:07 +0000 (19:16 +0100)
committerkaf24@firebug.cl.cam.ac.uk <kaf24@firebug.cl.cam.ac.uk>
Wed, 25 Jan 2006 18:16:07 +0000 (19:16 +0100)
shadow-translate mode.

Signed-off-by: Keir Fraser <keir@xensource.com>
xen/arch/x86/mm.c

index 1145af22b947ee93bed1bd8035002693d9d7affc..4253129cce5c305e04ea3f2ee7851e14cadf2d13 100644 (file)
@@ -1826,8 +1826,7 @@ int do_mmuext_op(
             break;
 
         case MMUEXT_NEW_BASEPTR:
-            if (shadow_mode_translate(current->domain))
-                mfn = __gpfn_to_mfn(current->domain, mfn);
+            mfn = __gpfn_to_mfn(current->domain, mfn);
             okay = new_guest_cr3(mfn);
             percpu_info[cpu].deferred_ops &= ~DOP_FLUSH_TLB;
             break;
@@ -2679,10 +2678,9 @@ long set_gdt(struct vcpu *v,
 
 long do_set_gdt(unsigned long *frame_list, unsigned int entries)
 {
-    int nr_pages = (entries + 511) / 512;
+    int i, nr_pages = (entries + 511) / 512;
     unsigned long frames[16];
     long ret;
-    int x;
 
     /* Rechecked in set_gdt, but ensures a sane limit for copy_from_user(). */
     if ( entries > FIRST_RESERVED_GDT_ENTRY )
@@ -2691,10 +2689,8 @@ long do_set_gdt(unsigned long *frame_list, unsigned int entries)
     if ( copy_from_user(frames, frame_list, nr_pages * sizeof(unsigned long)) )
         return -EFAULT;
 
-    if (shadow_mode_translate(current->domain)) {
-        for (x = 0; x < nr_pages; x++)
-            frames[x] = __gpfn_to_mfn(current->domain, frames[x]);
-    }
+    for ( i = 0; i < nr_pages; i++ )
+        frames[i] = __gpfn_to_mfn(current->domain, frames[i]);
 
     LOCK_BIGLOCK(current->domain);