All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/paging: remove pointless current domain checks
@ 2015-05-29  9:09 Jan Beulich
  2015-05-29  9:21 ` Andrew Cooper
  2015-06-04 13:15 ` Tim Deegan
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2015-05-29  9:09 UTC (permalink / raw)
  To: xen-devel; +Cc: Tim Deegan

[-- Attachment #1: Type: text/plain, Size: 1043 bytes --]

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>

--- 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)) )
     {




[-- Attachment #2: x86-paging-current-domain-checks.patch --]
[-- Type: text/plain, Size: 1091 bytes --]

x86/paging: remove pointless current domain checks

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>

--- 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)) )
     {

[-- Attachment #3: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/paging: remove pointless current domain checks
  2015-05-29  9:09 [PATCH] x86/paging: remove pointless current domain checks Jan Beulich
@ 2015-05-29  9:21 ` Andrew Cooper
  2015-06-04 13:15 ` Tim Deegan
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2015-05-29  9:21 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Tim Deegan


[-- Attachment #1.1: Type: text/plain, Size: 1309 bytes --]

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


[-- Attachment #1.2: Type: text/html, Size: 2208 bytes --]

[-- Attachment #2: Type: text/plain, Size: 126 bytes --]

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] x86/paging: remove pointless current domain checks
  2015-05-29  9:09 [PATCH] x86/paging: remove pointless current domain checks Jan Beulich
  2015-05-29  9:21 ` Andrew Cooper
@ 2015-06-04 13:15 ` Tim Deegan
  1 sibling, 0 replies; 3+ messages in thread
From: Tim Deegan @ 2015-06-04 13:15 UTC (permalink / raw)
  To: Jan Beulich; +Cc: xen-devel

At 10:09 +0100 on 29 May (1432894186), 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: Tim Deegan <tim@xen.org>

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-06-04 13:15 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-05-29  9:09 [PATCH] x86/paging: remove pointless current domain checks Jan Beulich
2015-05-29  9:21 ` Andrew Cooper
2015-06-04 13:15 ` Tim Deegan

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.