From mboxrd@z Thu Jan 1 00:00:00 1970 From: Andrew Cooper Subject: Re: [PATCH] x86/paging: remove pointless current domain checks Date: Fri, 29 May 2015 10:21:30 +0100 Message-ID: <55682F9A.2010503@citrix.com> References: <556848FA020000780007EDE4@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="===============2549760060814596938==" Return-path: Received: from mail6.bemta5.messagelabs.com ([195.245.231.135]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YyGU4-0008LP-So for xen-devel@lists.xenproject.org; Fri, 29 May 2015 09:21:44 +0000 In-Reply-To: <556848FA020000780007EDE4@mail.emea.novell.com> List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: Jan Beulich , xen-devel Cc: Tim Deegan List-Id: xen-devel@lists.xenproject.org --===============2549760060814596938== Content-Type: multipart/alternative; boundary="------------010905080800010406080006" --------------010905080800010406080006 Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit On 29/05/15 10:09, Jan Beulich wrote: > 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 Reviewed-by: Andrew Cooper > > --- a/xen/arch/x86/mm/hap/hap.c > +++ b/xen/arch/x86/mm/hap/hap.c > @@ -464,13 +464,6 @@ int hap_enable(struct domain *d, u32 mod > > 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 ) > { > --- a/xen/arch/x86/mm/shadow/common.c > +++ b/xen/arch/x86/mm/shadow/common.c > @@ -2972,8 +2972,7 @@ int shadow_enable(struct domain *d, u32 > 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)) ) > { > > > > > > _______________________________________________ > Xen-devel mailing list > Xen-devel@lists.xen.org > http://lists.xen.org/xen-devel --------------010905080800010406080006 Content-Type: text/html; charset="windows-1252" Content-Transfer-Encoding: 7bit
On 29/05/15 10:09, Jan Beulich wrote:
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>


--- a/xen/arch/x86/mm/hap/hap.c
+++ b/xen/arch/x86/mm/hap/hap.c
@@ -464,13 +464,6 @@ int hap_enable(struct domain *d, u32 mod
 
     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 )
     {
--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -2972,8 +2972,7 @@ int shadow_enable(struct domain *d, u32 
     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)) )
     {





_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

--------------010905080800010406080006-- --===============2549760060814596938== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ Xen-devel mailing list Xen-devel@lists.xen.org http://lists.xen.org/xen-devel --===============2549760060814596938==--