All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] common/memory: fix an XSM error path
@ 2015-01-12  8:21 Jan Beulich
  2015-01-12 11:09 ` Andrew Cooper
  2015-01-12 21:53 ` Daniel De Graaf
  0 siblings, 2 replies; 3+ messages in thread
From: Jan Beulich @ 2015-01-12  8:21 UTC (permalink / raw)
  To: xen-devel; +Cc: Ian Campbell, Keir Fraser, dgdegra, Ian Jackson, Tim Deegan

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

XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap
return the extent at which failure was detected, not error indicators.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -747,11 +747,10 @@ long do_memory_op(unsigned long cmd, XEN
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
         }
 
         switch ( op )




[-- Attachment #2: memop-XSM-error-path.patch --]
[-- Type: text/plain, Size: 740 bytes --]

common/memory: fix an XSM error path

XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap
return the extent at which failure was detected, not error indicators.

Signed-off-by: Jan Beulich <jbeulich@suse.com>

--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -747,11 +747,10 @@ long do_memory_op(unsigned long cmd, XEN
             return start_extent;
         args.domain = d;
 
-        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
-        if ( rc )
+        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
         {
             rcu_unlock_domain(d);
-            return rc;
+            return start_extent;
         }
 
         switch ( op )

[-- 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] common/memory: fix an XSM error path
  2015-01-12  8:21 [PATCH] common/memory: fix an XSM error path Jan Beulich
@ 2015-01-12 11:09 ` Andrew Cooper
  2015-01-12 21:53 ` Daniel De Graaf
  1 sibling, 0 replies; 3+ messages in thread
From: Andrew Cooper @ 2015-01-12 11:09 UTC (permalink / raw)
  To: Jan Beulich, xen-devel
  Cc: Ian Campbell, Ian Jackson, dgdegra, Keir Fraser, Tim Deegan


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

On 12/01/15 08:21, Jan Beulich wrote:
> XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap
> return the extent at which failure was detected, not error indicators.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>

>
> --- a/xen/common/memory.c
> +++ b/xen/common/memory.c
> @@ -747,11 +747,10 @@ long do_memory_op(unsigned long cmd, XEN
>              return start_extent;
>          args.domain = d;
>  
> -        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
> -        if ( rc )
> +        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
>          {
>              rcu_unlock_domain(d);
> -            return rc;
> +            return start_extent;
>          }
>  
>          switch ( op )
>
>
>
>
>
> _______________________________________________
> Xen-devel mailing list
> Xen-devel@lists.xen.org
> http://lists.xen.org/xen-devel


[-- Attachment #1.2: Type: text/html, Size: 1849 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] common/memory: fix an XSM error path
  2015-01-12  8:21 [PATCH] common/memory: fix an XSM error path Jan Beulich
  2015-01-12 11:09 ` Andrew Cooper
@ 2015-01-12 21:53 ` Daniel De Graaf
  1 sibling, 0 replies; 3+ messages in thread
From: Daniel De Graaf @ 2015-01-12 21:53 UTC (permalink / raw)
  To: Jan Beulich, xen-devel; +Cc: Ian Campbell, Keir Fraser, Ian Jackson, Tim Deegan

On 01/12/2015 03:21 AM, Jan Beulich wrote:
> XENMEM_{in,de}crease_reservation as well as XENMEM_populate_physmap
> return the extent at which failure was detected, not error indicators.
>
> Signed-off-by: Jan Beulich <jbeulich@suse.com>

Acked-by: Daniel De Graaf <dgdegra@tycho.nsa.gov>
(though I don't think my ack is technically required here)

> --- a/xen/common/memory.c
> +++ b/xen/common/memory.c
> @@ -747,11 +747,10 @@ long do_memory_op(unsigned long cmd, XEN
>               return start_extent;
>           args.domain = d;
>
> -        rc = xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d);
> -        if ( rc )
> +        if ( xsm_memory_adjust_reservation(XSM_TARGET, current->domain, d) )
>           {
>               rcu_unlock_domain(d);
> -            return rc;
> +            return start_extent;
>           }
>
>           switch ( op )
>
>
>


-- 
Daniel De Graaf
National Security Agency

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

end of thread, other threads:[~2015-01-12 21:53 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2015-01-12  8:21 [PATCH] common/memory: fix an XSM error path Jan Beulich
2015-01-12 11:09 ` Andrew Cooper
2015-01-12 21:53 ` Daniel De Graaf

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.