write_gs(__USER_DS);
/* Unmap page at 0 to catch errors with NULL pointers. */
- rc = hypercall_update_va_mapping(NULL, 0, 2);
+ rc = hypercall_update_va_mapping(NULL, 0, UVMF_INVLPG);
if ( rc )
panic("Failed to unmap page at NULL: %d\n", rc);
if ( !(l1[i1] & _PAGE_USER) )
{
- rc = hypercall_update_va_mapping(_p(va), l1[i1] | _PAGE_USER, 2);
+ rc = hypercall_update_va_mapping(_p(va), l1[i1] | _PAGE_USER,
+ UVMF_INVLPG);
if ( rc )
panic("update_va_mapping(%p, 0x%016"PRIx64") failed: %d\n",
_p(va), l1[i1] | _PAGE_USER, rc);
typedef struct mmuext_op mmuext_op_t;
#endif
+/* These are passed as 'flags' to update_va_mapping. They can be ORed. */
+/* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap. */
+/* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer. */
+#ifndef __ASSEMBLY__
+enum XEN_UVMF {
+ UVMF_NONE = 0 << 0, /* No flushing at all. */
+ UVMF_TLB_FLUSH = 1 << 0, /* Flush entire TLB(s). */
+ UVMF_INVLPG = 2 << 0, /* Flush only one entry. */
+ UVMF_FLUSHTYPE_MASK = 3 << 0,
+ UVMF_MULTI = 0 << 2, /* Flush subset of TLBs. */
+ UVMF_LOCAL = 0 << 2, /* Flush local TLB. */
+ UVMF_ALL = 1 << 2, /* Flush all TLBs. */
+};
+#endif
+
#endif /* XEN_PUBLIC_XEN_H */
/*
}
static inline long hypercall_update_va_mapping(void *va, uint64_t npte,
- unsigned int flags)
+ enum XEN_UVMF flags)
{
#ifdef __x86_64__
return HYPERCALL3(long, __HYPERVISOR_update_va_mapping, va, npte, flags);