]> xenbits.xensource.com Git - people/andrewcoop/xen.git/commitdiff
make tlbflush_filter()'s first parameter a pointer
authorJan Beulich <jbeulich@suse.com>
Mon, 12 Dec 2016 08:34:09 +0000 (09:34 +0100)
committerJan Beulich <jbeulich@suse.com>
Mon, 12 Dec 2016 08:34:09 +0000 (09:34 +0100)
This brings it in line with most other functions dealing with CPU
masks. Convert both implementations to inline functions at once.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Andrew Cooper <andrew.cooper3@citrix.com>
Reviewed-by: Wei Liu <wei.liu2@citrix.com>
Acked-by: Julien Grall <julien.grall@arm.com>
xen/arch/x86/mm.c
xen/arch/x86/mm/shadow/common.c
xen/include/asm-arm/flushtlb.h
xen/include/asm-x86/flushtlb.h
xen/include/xen/mm.h

index 3ff0e9737d8860193951f1fc0dd18541b0a67de5..c5dd6f22afff2ecf325ef09466caa7bf0f0be1b2 100644 (file)
@@ -2514,7 +2514,7 @@ static int __get_page_type(struct page_info *page, unsigned long type,
                 cpumask_copy(&mask, d->domain_dirty_cpumask);
 
                 /* Don't flush if the timestamp is old enough */
-                tlbflush_filter(mask, page->tlbflush_timestamp);
+                tlbflush_filter(&mask, page->tlbflush_timestamp);
 
                 if ( unlikely(!cpumask_empty(&mask)) &&
                      /* Shadow mode: track only writable pages. */
index 39be564e5d42a29dfcfc95b08b1449bffedd583f..acb35c2eb8cf7cfab2ccefe64474175317f6344e 100644 (file)
@@ -1471,7 +1471,7 @@ mfn_t shadow_alloc(struct domain *d,
         /* Before we overwrite the old contents of this page,
          * we need to be sure that no TLB holds a pointer to it. */
         cpumask_copy(&mask, d->domain_dirty_cpumask);
-        tlbflush_filter(mask, sp->tlbflush_timestamp);
+        tlbflush_filter(&mask, sp->tlbflush_timestamp);
         if ( unlikely(!cpumask_empty(&mask)) )
         {
             perfc_incr(shadow_alloc_tlbflush);
index 329fbb427e35ad8ff9608664887d23136c8f9d91..a8e8a0536344b8d311c184ca90bdee486e92d2c2 100644 (file)
@@ -8,9 +8,7 @@
  * TLB since @page_timestamp.
  */
 /* XXX lazy implementation just doesn't clear anything.... */
-#define tlbflush_filter(mask, page_timestamp)                           \
-do {                                                                    \
-} while ( 0 )
+static inline void tlbflush_filter(cpumask_t *mask, uint32_t page_timestamp) {}
 
 #define tlbflush_current_time()                 (0)
 
index 2e7ed6b56204021d456af411f6d5bec325856c17..4dc506a50a434490aa72b1cdfe0e1cf2928c99b6 100644 (file)
@@ -50,13 +50,14 @@ static inline int NEED_FLUSH(u32 cpu_stamp, u32 lastuse_stamp)
  * Filter the given set of CPUs, removing those that definitely flushed their
  * TLB since @page_timestamp.
  */
-#define tlbflush_filter(mask, page_timestamp)                           \
-do {                                                                    \
-    unsigned int cpu;                                                   \
-    for_each_cpu ( cpu, &(mask) )                                       \
-        if ( !NEED_FLUSH(per_cpu(tlbflush_time, cpu), page_timestamp) ) \
-            cpumask_clear_cpu(cpu, &(mask));                            \
-} while ( 0 )
+static inline void tlbflush_filter(cpumask_t *mask, uint32_t page_timestamp)
+{
+    unsigned int cpu;
+
+    for_each_cpu ( cpu, mask )
+        if ( !NEED_FLUSH(per_cpu(tlbflush_time, cpu), page_timestamp) )
+            cpumask_clear_cpu(cpu, mask);
+}
 
 void new_tlbflush_clock_period(void);
 
index 76fbb82333593fef6848c982136403fc51191ba4..88de3c1fa6bb64bde8867ec4b53a18844b099be4 100644 (file)
@@ -588,9 +588,10 @@ static inline void accumulate_tlbflush(bool *need_tlbflush,
 
 static inline void filtered_flush_tlb_mask(uint32_t tlbflush_timestamp)
 {
-    cpumask_t mask = cpu_online_map;
+    cpumask_t mask;
 
-    tlbflush_filter(mask, tlbflush_timestamp);
+    cpumask_copy(&mask, &cpu_online_map);
+    tlbflush_filter(&mask, tlbflush_timestamp);
     if ( !cpumask_empty(&mask) )
     {
         perfc_incr(need_flush_tlb_flush);