]> xenbits.xensource.com Git - people/liuw/libxenctrl-split/xen.git/commitdiff
x86/paging: remove pointless current domain checks
authorJan Beulich <jbeulich@suse.com>
Fri, 5 Jun 2015 10:09:18 +0000 (12:09 +0200)
committerJan Beulich <jbeulich@suse.com>
Fri, 5 Jun 2015 10:09:18 +0000 (12:09 +0200)
Checking that the subject domain is not the current one is pointless
when already having paused that domain: domain_pause() already
ASSERT()s this to be the case.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Tim Deegan <tim@xen.org>
xen/arch/x86/mm/hap/hap.c
xen/arch/x86/mm/shadow/common.c

index cea7990fe958f1946cbf9d0df29e6b8b5accd2dd..d0d3f1e645a2fa6efd3d2f34b056af57244564a8 100644 (file)
@@ -464,13 +464,6 @@ int hap_enable(struct domain *d, u32 mode)
 
     domain_pause(d);
 
-    /* error check */
-    if ( (d == current->domain) )
-    {
-        rv = -EINVAL;
-        goto out;
-    }
-
     old_pages = d->arch.paging.hap.total_pages;
     if ( old_pages == 0 )
     {
index 654bacc72fabeef7f4c6be574644d80aa0579977..919b15b777dc4fd5624da14b41e1e670949d8034 100644 (file)
@@ -2972,8 +2972,7 @@ int shadow_enable(struct domain *d, u32 mode)
     domain_pause(d);
 
     /* Sanity check the arguments */
-    if ( (d == current->domain) ||
-         shadow_mode_enabled(d) ||
+    if ( shadow_mode_enabled(d) ||
          ((mode & PG_translate) && !(mode & PG_refcounts)) ||
          ((mode & PG_external) && !(mode & PG_translate)) )
     {