]> xenbits.xensource.com Git - people/dariof/xen.git/commitdiff
x86/hypervisor: pass flags to hypervisor_flush_tlb
authorWei Liu <wl@xen.org>
Thu, 9 Apr 2020 17:41:02 +0000 (18:41 +0100)
committerWei Liu <wl@xen.org>
Wed, 29 Apr 2020 09:32:18 +0000 (10:32 +0100)
Hyper-V's L0 assisted flush has fine-grained control over what gets
flushed. We need all the flags available to make the best decisions
possible.

No functional change because Xen's implementation doesn't care about
what is passed to it.

Signed-off-by: Wei Liu <liuwe@microsoft.com>
Reviewed-by: Roger Pau Monné <roger.pau@citrix.com>
Reviewed-by: Paul Durrant <pdurrant@amazon.com>
Acked-by: Jan Beulich <jbeulich@suse.com>
xen/arch/x86/guest/hypervisor.c
xen/arch/x86/guest/xen/xen.c
xen/arch/x86/smp.c
xen/include/asm-x86/guest/hypervisor.h

index e46de42ded604946f9d0dfb4bf8b3ab2aa3314a7..366af1d6500104dd97ca592c1a5a6d58bb4296f7 100644 (file)
@@ -79,10 +79,10 @@ void __init hypervisor_e820_fixup(struct e820map *e820)
 }
 
 int hypervisor_flush_tlb(const cpumask_t *mask, const void *va,
-                         unsigned int order)
+                         unsigned int flags)
 {
     if ( ops.flush_tlb )
-        return alternative_call(ops.flush_tlb, mask, va, order);
+        return alternative_call(ops.flush_tlb, mask, va, flags);
 
     return -EOPNOTSUPP;
 }
index 3bc01c8723bf31ee907932b4cebe2ea42a8daf57..2ff63d370a8a12fef166677e2ded7ed82a628ce8 100644 (file)
@@ -324,7 +324,7 @@ static void __init e820_fixup(struct e820map *e820)
         pv_shim_fixup_e820(e820);
 }
 
-static int flush_tlb(const cpumask_t *mask, const void *va, unsigned int order)
+static int flush_tlb(const cpumask_t *mask, const void *va, unsigned int flags)
 {
     return xen_hypercall_hvm_op(HVMOP_flush_tlbs, NULL);
 }
index 1d9fec65de0693251a63764034a5b97ac41ec624..6f1aaa2106dc19cd40d4d848711829c181a91eb0 100644 (file)
@@ -272,7 +272,7 @@ void flush_area_mask(const cpumask_t *mask, const void *va, unsigned int flags)
         if ( cpu_has_hypervisor &&
              !(flags & ~(FLUSH_TLB | FLUSH_TLB_GLOBAL | FLUSH_VA_VALID |
                          FLUSH_ORDER_MASK)) &&
-             !hypervisor_flush_tlb(mask, va, (flags - 1) & FLUSH_ORDER_MASK) )
+             !hypervisor_flush_tlb(mask, va, flags) )
             return;
 
         spin_lock(&flush_lock);
index 77a1d21824d90b70b078871e9ccc61f048da150c..0a6c3b47ab36cb4a1f6dffdef1e7535c96c49638 100644 (file)
@@ -35,7 +35,7 @@ struct hypervisor_ops {
     /* Fix up e820 map */
     void (*e820_fixup)(struct e820map *e820);
     /* L0 assisted TLB flush */
-    int (*flush_tlb)(const cpumask_t *mask, const void *va, unsigned int order);
+    int (*flush_tlb)(const cpumask_t *mask, const void *va, unsigned int flags);
 };
 
 #ifdef CONFIG_GUEST
@@ -48,11 +48,11 @@ void hypervisor_e820_fixup(struct e820map *e820);
 /*
  * L0 assisted TLB flush.
  * mask: cpumask of the dirty vCPUs that should be flushed.
- * va: linear address to flush, or NULL for global flushes.
- * order: order of the linear address pointed by va.
+ * va: linear address to flush, or NULL for entire address space.
+ * flags: flags for flushing, including the order of va.
  */
 int hypervisor_flush_tlb(const cpumask_t *mask, const void *va,
-                         unsigned int order);
+                         unsigned int flags);
 
 #else
 
@@ -65,7 +65,7 @@ static inline int hypervisor_ap_setup(void) { return 0; }
 static inline void hypervisor_resume(void) { ASSERT_UNREACHABLE(); }
 static inline void hypervisor_e820_fixup(struct e820map *e820) {}
 static inline int hypervisor_flush_tlb(const cpumask_t *mask, const void *va,
-                                       unsigned int order)
+                                       unsigned int flags)
 {
     return -EOPNOTSUPP;
 }