From: "Jan Beulich" Subject: [PATCH] x86/paging: remove pointless current domain checks Date: Fri, 29 May 2015 10:09:46 +0100 Message-ID: <556848FA020000780007EDE4@mail.emea.novell.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=__PartB38783CA.0__=" Return-path: Received: from mail6.bemta3.messagelabs.com ([195.245.230.39]) by lists.xen.org with esmtp (Exim 4.72) (envelope-from ) id 1YyGIX-0006qh-DD for xen-devel@lists.xenproject.org; Fri, 29 May 2015 09:09:49 +0000 List-Unsubscribe: , List-Post: List-Help: List-Subscribe: , Sender: xen-devel-bounces@lists.xen.org Errors-To: xen-devel-bounces@lists.xen.org To: xen-devel Cc: Tim Deegan List-Id: xen-devel@lists.xenproject.org This is a MIME message. If you are reading this text, you may want to consider changing to a mail reader or gateway that understands how to properly handle MIME multipart messages. --=__PartB38783CA.0__= Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable Content-Disposition: inline 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 --- 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 =20 domain_pause(d); =20 - /* error check */ - if ( (d =3D=3D current->domain) ) - { - rv =3D -EINVAL; - goto out; - } - old_pages =3D d->arch.paging.hap.total_pages; if ( old_pages =3D=3D 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=20 domain_pause(d); =20 /* Sanity check the arguments */ - if ( (d =3D=3D current->domain) || - shadow_mode_enabled(d) || + if ( shadow_mode_enabled(d) || ((mode & PG_translate) && !(mode & PG_refcounts)) || ((mode & PG_external) && !(mode & PG_translate)) ) { --=__PartB38783CA.0__= Content-Type: text/plain; name="x86-paging-current-domain-checks.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="x86-paging-current-domain-checks.patch" x86/paging: remove pointless current domain checks=0A=0AChecking that the = subject domain is not the current one is pointless=0Awhen already having = paused that domain: domain_pause() already=0AASSERT()s this to be the = case.=0A=0ASigned-off-by: Jan Beulich =0A=0A--- = a/xen/arch/x86/mm/hap/hap.c=0A+++ b/xen/arch/x86/mm/hap/hap.c=0A@@ -464,13 = +464,6 @@ int hap_enable(struct domain *d, u32 mod=0A =0A domain_pause(= d);=0A =0A- /* error check */=0A- if ( (d =3D=3D current->domain) = )=0A- {=0A- rv =3D -EINVAL;=0A- goto out;=0A- }=0A-=0A = old_pages =3D d->arch.paging.hap.total_pages;=0A if ( old_pages = =3D=3D 0 )=0A {=0A--- a/xen/arch/x86/mm/shadow/common.c=0A+++ = b/xen/arch/x86/mm/shadow/common.c=0A@@ -2972,8 +2972,7 @@ int shadow_enable= (struct domain *d, u32 =0A domain_pause(d);=0A =0A /* Sanity check = the arguments */=0A- if ( (d =3D=3D current->domain) ||=0A- = shadow_mode_enabled(d) ||=0A+ if ( shadow_mode_enabled(d) ||=0A = ((mode & PG_translate) && !(mode & PG_refcounts)) ||=0A ((mode & = PG_external) && !(mode & PG_translate)) )=0A {=0A --=__PartB38783CA.0__= 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 --=__PartB38783CA.0__=--