It so far having been ~1 made most of the code preceding the call
pointless, but I assume this wasn't meant to be that way. Also replace
the remaining hard coded ~1 with an expression documenting the
intention a little better.

Signed-off-by: Jan Beulich <jbeul...@suse.com>
---
Couldn't the ~1 instead be SHF_page_type_mask?

--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -3761,7 +3761,7 @@ void shadow_audit_tables(struct vcpu *v)
 #endif
 
     if ( SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_FULL )
-        mask = ~1; /* Audit every table in the system */
+        mask = ~(1 << SH_type_none); /* Audit every table in the system */
     else 
     {
         /* Audit only the current mode's tables */
@@ -3776,7 +3776,7 @@ void shadow_audit_tables(struct vcpu *v)
         }
     }
 
-    hash_foreach(v, ~1, callbacks, _mfn(INVALID_MFN));
+    hash_foreach(v, mask, callbacks, _mfn(INVALID_MFN));
 }
 
 #endif /* Shadow audit */



x86/shadow: adjust mask shadow_audit_tables() passes to hash_foreach()

It so far having been ~1 made most of the code preceding the call
pointless, but I assume this wasn't meant to be that way. Also replace
the remaining hard coded ~1 with an expression documenting the
intention a little better.

Signed-off-by: Jan Beulich <jbeul...@suse.com>
---
Couldn't the ~1 instead be SHF_page_type_mask?

--- a/xen/arch/x86/mm/shadow/common.c
+++ b/xen/arch/x86/mm/shadow/common.c
@@ -3761,7 +3761,7 @@ void shadow_audit_tables(struct vcpu *v)
 #endif
 
     if ( SHADOW_AUDIT & SHADOW_AUDIT_ENTRIES_FULL )
-        mask = ~1; /* Audit every table in the system */
+        mask = ~(1 << SH_type_none); /* Audit every table in the system */
     else 
     {
         /* Audit only the current mode's tables */
@@ -3776,7 +3776,7 @@ void shadow_audit_tables(struct vcpu *v)
         }
     }
 
-    hash_foreach(v, ~1, callbacks, _mfn(INVALID_MFN));
+    hash_foreach(v, mask, callbacks, _mfn(INVALID_MFN));
 }
 
 #endif /* Shadow audit */
_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xen.org
http://lists.xen.org/xen-devel

Reply via email to