From: Andrew Cooper Date: Mon, 11 Jul 2016 12:46:53 +0000 (+0100) Subject: Introduce mmu_update() hypercall infrastructure X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=216af8216fa22f943a21fdfc7a699dcc3e2ea035;p=people%2Fliuw%2Fxtf.git Introduce mmu_update() hypercall infrastructure Signed-off-by: Andrew Cooper --- diff --git a/include/xen/xen.h b/include/xen/xen.h index e276e73..302e20a 100644 --- a/include/xen/xen.h +++ b/include/xen/xen.h @@ -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 * diff --git a/include/xtf/hypercall.h b/include/xtf/hypercall.h index edcd148..dd3285b 100644 --- a/include/xtf/hypercall.h +++ b/include/xtf/hypercall.h @@ -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);