@@ -75,10 +75,13 @@ 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 ( flags & ~FLUSH_TLB_FLAGS_MASK )
+ return -EINVAL;
+
if ( ops.flush_tlb )
- return alternative_call(ops.flush_tlb, mask, va, order);
+ return alternative_call(ops.flush_tlb, mask, va, flags);
return -ENOSYS;
}
@@ -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);
}
@@ -258,9 +258,8 @@ void flush_area_mask(const cpumask_t *mask, const void *va, unsigned int flags)
!cpumask_subset(mask, cpumask_of(cpu)) )
{
if ( cpu_has_hypervisor &&
- !(flags & ~(FLUSH_TLB | FLUSH_TLB_GLOBAL | FLUSH_VA_VALID |
- FLUSH_ORDER_MASK)) &&
- !hypervisor_flush_tlb(mask, va, flags & FLUSH_ORDER_MASK) )
+ !(flags & ~FLUSH_TLB_FLAGS_MASK) &&
+ !hypervisor_flush_tlb(mask, va, flags) )
{
if ( tlb_clk_enabled )
tlb_clk_enabled = false;
@@ -123,6 +123,9 @@ void switch_cr3_cr4(unsigned long cr3, unsigned long cr4);
/* Flush all HVM guests linear TLB (using ASID/VPID) */
#define FLUSH_GUESTS_TLB 0x4000
+#define FLUSH_TLB_FLAGS_MASK (FLUSH_TLB | FLUSH_TLB_GLOBAL | FLUSH_VA_VALID | \
+ FLUSH_ORDER_MASK)
+
/* Flush local TLBs/caches. */
unsigned int flush_area_local(const void *va, unsigned int flags);
#define flush_local(flags) flush_area_local(NULL, flags)
@@ -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 -ENOSYS;
}