[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Xen-changelog] [xen stable-4.4] memory: fix XSA-158 fix



commit 8fc45c1ce8ee883a9422ac471256c7c6125cef25
Author:     Jan Beulich <jbeulich@xxxxxxxx>
AuthorDate: Wed Dec 9 13:56:40 2015 +0100
Commit:     Jan Beulich <jbeulich@xxxxxxxx>
CommitDate: Wed Dec 9 13:56:40 2015 +0100

    memory: fix XSA-158 fix
    
    For one the uses of domu_max_order and ptdom_max_order were swapped.
    
    And then gcc warns about an unused result of a __must_check function
    in the control part of a conditional expression when both other
    expressions can be determined by the compiler to produce the same value
    (see https://gcc.gnu.org/bugzilla/show_bug.cgi?id=68039), which happens
    when HAS_PASSTHROUGH is undefined (i.e. for ARM on 4.4 and older).
    
    Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>
    Acked-by: Ian Campbell <ian.campbell@xxxxxxxxxx>
    master commit: ff841cead287d7913901ba5c4e7628a6958b5bea
    master date: 2015-12-09 13:53:13 +0100
---
 xen/common/memory.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/xen/common/memory.c b/xen/common/memory.c
index e2cfa05..55db10b 100644
--- a/xen/common/memory.c
+++ b/xen/common/memory.c
@@ -58,8 +58,6 @@ static unsigned int __read_mostly ctldom_max_order = 
CONFIG_CTLDOM_MAX_ORDER;
 static unsigned int __read_mostly hwdom_max_order = CONFIG_HWDOM_MAX_ORDER;
 #ifdef HAS_PASSTHROUGH
 static unsigned int __read_mostly ptdom_max_order = CONFIG_PTDOM_MAX_ORDER;
-#else
-# define ptdom_max_order domu_max_order
 #endif
 static void __init parse_max_order(const char *s)
 {
@@ -78,8 +76,12 @@ custom_param("memop-max-order", parse_max_order);
 
 static unsigned int max_order(const struct domain *d)
 {
-    unsigned int order = cache_flush_permitted(d) ? domu_max_order
-                                                  : ptdom_max_order;
+    unsigned int order = domu_max_order;
+
+#ifdef HAS_PASSTHROUGH
+    if ( cache_flush_permitted(d) && order < ptdom_max_order )
+        order = ptdom_max_order;
+#endif
 
     if ( is_control_domain(d) && order < ctldom_max_order )
         order = ctldom_max_order;
--
generated by git-patchbot for /home/xen/git/xen.git#stable-4.4

_______________________________________________
Xen-changelog mailing list
Xen-changelog@xxxxxxxxxxxxx
http://lists.xensource.com/xen-changelog


 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.