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

[Xen-devel] [PATCH] x86/EPT: adjustments for redundant function arguments



In ept_p2m_type_to_flags() passing in type and access as separate
parameters can be considered an optimization, as all callers set the
respective fields in the entry being updated before the call. Retain
this behavior but add assertions.

Signed-off-by: Jan Beulich <jbeulich@xxxxxxxx>

--- a/xen/arch/x86/mm/p2m-ept.c
+++ b/xen/arch/x86/mm/p2m-ept.c
@@ -75,7 +75,8 @@ static void ept_p2m_type_to_flags(struct
      * D bit is set for all writable types in EPT leaf entry, except for
      * log-dirty type with PML.
      */
-    switch(type)
+    ASSERT(type == entry->sa_p2mt);
+    switch ( type )
     {
         case p2m_invalid:
         case p2m_mmio_dm:
@@ -143,9 +144,9 @@ static void ept_p2m_type_to_flags(struct
             break;
     }
 
-
     /* Then restrict with access permissions */
-    switch (access) 
+    ASSERT(access == entry->access);
+    switch ( access )
     {
         case p2m_access_n:
         case p2m_access_n2rwx:

_______________________________________________
Xen-devel mailing list
Xen-devel@xxxxxxxxxxxxxxxxxxxx
https://lists.xenproject.org/mailman/listinfo/xen-devel

 


Rackspace

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