]> xenbits.xensource.com Git - people/liuw/xtf.git/commitdiff
Introduce mmu_update() hypercall infrastructure
authorAndrew Cooper <andrew.cooper3@citrix.com>
Mon, 11 Jul 2016 12:46:53 +0000 (13:46 +0100)
committerAndrew Cooper <andrew.cooper3@citrix.com>
Tue, 12 Jul 2016 09:50:43 +0000 (10:50 +0100)
Signed-off-by: Andrew Cooper <andrew.cooper3@citrix.com>
include/xen/xen.h
include/xtf/hypercall.h

index e276e73213f994c57fa96fcd22361901db892446..302e20a444ffc933789ed0a8d51b8f8a144b970b 100644 (file)
@@ -122,6 +122,18 @@ struct start_info {
 typedef struct start_info start_info_t;
 #endif
 
+/* MMU UPDATE operations */
+#ifndef __ASSEMBLY__
+struct mmu_update {
+#define MMU_NORMAL_PT_UPDATE      0 /* checked '*ptr = val'. ptr is MA.      */
+#define MMU_MACHPHYS_UPDATE       1 /* ptr = MA of frame to modify entry for */
+#define MMU_PT_UPDATE_PRESERVE_AD 2 /* atomically: *ptr = val | (*ptr&(A|D)) */
+    uint64_t ptr;       /* Machine address of PTE. */
+    uint64_t val;       /* New contents of PTE.    */
+};
+typedef struct mmu_update mmu_update_t;
+#endif
+
 /*
  * MMU EXTENDED OPERATIONS
  *
index edcd1486869a4e2cb967b5f240ae908be56bdf77..dd3285b9675b97d6ee27727825833087f4a57877 100644 (file)
@@ -45,6 +45,15 @@ static inline long hypercall_set_trap_table(const struct xen_trap_info *ti)
     return HYPERCALL1(long, __HYPERVISOR_set_trap_table, ti);
 }
 
+static inline long hypercall_mmu_update(const mmu_update_t reqs[],
+                                        unsigned int count,
+                                        unsigned int *done,
+                                        unsigned int foreigndom)
+{
+    return HYPERCALL4(long, __HYPERVISOR_mmu_update,
+                      reqs, count, done, foreigndom);
+}
+
 static inline long hypercall_stack_switch(const unsigned int ss, const void *sp)
 {
     return HYPERCALL2(long, __HYPERVISOR_stack_switch, ss, sp);