Re: [Xen-devel] [PATCH] x86/paging: remove pointless current domain checks

2015-06-04 Thread Tim Deegan
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 

Reviewed-by: Tim Deegan 


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


Re: [Xen-devel] [PATCH] x86/paging: remove pointless current domain checks

2015-05-29 Thread Andrew Cooper
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

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


[Xen-devel] [PATCH] x86/paging: remove pointless current domain checks

2015-05-29 Thread Jan Beulich
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
 
 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)) )
 {



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 

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