Skip to content

Commit 1246ae0

Browse files
jsgfJeremy Fitzhardinge
authored andcommitted
xen: add variable hypercall caller
Allow non-constant hypercall to be called, for privcmd. [ Impact: make arbitrary hypercalls; needed for privcmd ] Signed-off-by: Jeremy Fitzhardinge <jeremy.fitzhardinge@citrix.com>
1 parent eba3ff8 commit 1246ae0

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

arch/x86/include/asm/xen/hypercall.h

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -200,6 +200,23 @@ extern struct { char _entry[32]; } hypercall_page[];
200200
(type)__res; \
201201
})
202202

203+
static inline long
204+
privcmd_call(unsigned call,
205+
unsigned long a1, unsigned long a2,
206+
unsigned long a3, unsigned long a4,
207+
unsigned long a5)
208+
{
209+
__HYPERCALL_DECLS;
210+
__HYPERCALL_5ARG(a1, a2, a3, a4, a5);
211+
212+
asm volatile("call *%[call]"
213+
: __HYPERCALL_5PARAM
214+
: [call] "a" (&hypercall_page[call])
215+
: __HYPERCALL_CLOBBER5);
216+
217+
return (long)__res;
218+
}
219+
203220
static inline int
204221
HYPERVISOR_set_trap_table(struct trap_info *table)
205222
{

0 commit comments

Comments
 (0)