hypercall.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594
  1. /******************************************************************************
  2. * hypercall.h
  3. *
  4. * Linux-specific hypervisor handling.
  5. *
  6. * Copyright (c) 2002-2004, K A Fraser
  7. *
  8. * This program is free software; you can redistribute it and/or
  9. * modify it under the terms of the GNU General Public License version 2
  10. * as published by the Free Software Foundation; or, when distributed
  11. * separately from the Linux kernel or incorporated into other
  12. * software packages, subject to the following license:
  13. *
  14. * Permission is hereby granted, free of charge, to any person obtaining a copy
  15. * of this source file (the "Software"), to deal in the Software without
  16. * restriction, including without limitation the rights to use, copy, modify,
  17. * merge, publish, distribute, sublicense, and/or sell copies of the Software,
  18. * and to permit persons to whom the Software is furnished to do so, subject to
  19. * the following conditions:
  20. *
  21. * The above copyright notice and this permission notice shall be included in
  22. * all copies or substantial portions of the Software.
  23. *
  24. * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  25. * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  26. * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  27. * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  28. * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
  29. * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
  30. * IN THE SOFTWARE.
  31. */
  32. #ifndef _ASM_X86_XEN_HYPERCALL_H
  33. #define _ASM_X86_XEN_HYPERCALL_H
  34. #include <linux/kernel.h>
  35. #include <linux/spinlock.h>
  36. #include <linux/errno.h>
  37. #include <linux/string.h>
  38. #include <linux/types.h>
  39. #include <trace/events/xen.h>
  40. #include <asm/page.h>
  41. #include <asm/pgtable.h>
  42. #include <xen/interface/xen.h>
  43. #include <xen/interface/sched.h>
  44. #include <xen/interface/physdev.h>
  45. /*
  46. * The hypercall asms have to meet several constraints:
  47. * - Work on 32- and 64-bit.
  48. * The two architectures put their arguments in different sets of
  49. * registers.
  50. *
  51. * - Work around asm syntax quirks
  52. * It isn't possible to specify one of the rNN registers in a
  53. * constraint, so we use explicit register variables to get the
  54. * args into the right place.
  55. *
  56. * - Mark all registers as potentially clobbered
  57. * Even unused parameters can be clobbered by the hypervisor, so we
  58. * need to make sure gcc knows it.
  59. *
  60. * - Avoid compiler bugs.
  61. * This is the tricky part. Because x86_32 has such a constrained
  62. * register set, gcc versions below 4.3 have trouble generating
  63. * code when all the arg registers and memory are trashed by the
  64. * asm. There are syntactically simpler ways of achieving the
  65. * semantics below, but they cause the compiler to crash.
  66. *
  67. * The only combination I found which works is:
  68. * - assign the __argX variables first
  69. * - list all actually used parameters as "+r" (__argX)
  70. * - clobber the rest
  71. *
  72. * The result certainly isn't pretty, and it really shows up cpp's
  73. * weakness as as macro language. Sorry. (But let's just give thanks
  74. * there aren't more than 5 arguments...)
  75. */
  76. extern struct { char _entry[32]; } hypercall_page[];
  77. #define __HYPERCALL "call hypercall_page+%c[offset]"
  78. #define __HYPERCALL_ENTRY(x) \
  79. [offset] "i" (__HYPERVISOR_##x * sizeof(hypercall_page[0]))
  80. #ifdef CONFIG_X86_32
  81. #define __HYPERCALL_RETREG "eax"
  82. #define __HYPERCALL_ARG1REG "ebx"
  83. #define __HYPERCALL_ARG2REG "ecx"
  84. #define __HYPERCALL_ARG3REG "edx"
  85. #define __HYPERCALL_ARG4REG "esi"
  86. #define __HYPERCALL_ARG5REG "edi"
  87. #else
  88. #define __HYPERCALL_RETREG "rax"
  89. #define __HYPERCALL_ARG1REG "rdi"
  90. #define __HYPERCALL_ARG2REG "rsi"
  91. #define __HYPERCALL_ARG3REG "rdx"
  92. #define __HYPERCALL_ARG4REG "r10"
  93. #define __HYPERCALL_ARG5REG "r8"
  94. #endif
  95. #define __HYPERCALL_DECLS \
  96. register unsigned long __res asm(__HYPERCALL_RETREG); \
  97. register unsigned long __arg1 asm(__HYPERCALL_ARG1REG) = __arg1; \
  98. register unsigned long __arg2 asm(__HYPERCALL_ARG2REG) = __arg2; \
  99. register unsigned long __arg3 asm(__HYPERCALL_ARG3REG) = __arg3; \
  100. register unsigned long __arg4 asm(__HYPERCALL_ARG4REG) = __arg4; \
  101. register unsigned long __arg5 asm(__HYPERCALL_ARG5REG) = __arg5;
  102. #define __HYPERCALL_0PARAM "=r" (__res)
  103. #define __HYPERCALL_1PARAM __HYPERCALL_0PARAM, "+r" (__arg1)
  104. #define __HYPERCALL_2PARAM __HYPERCALL_1PARAM, "+r" (__arg2)
  105. #define __HYPERCALL_3PARAM __HYPERCALL_2PARAM, "+r" (__arg3)
  106. #define __HYPERCALL_4PARAM __HYPERCALL_3PARAM, "+r" (__arg4)
  107. #define __HYPERCALL_5PARAM __HYPERCALL_4PARAM, "+r" (__arg5)
  108. #define __HYPERCALL_0ARG()
  109. #define __HYPERCALL_1ARG(a1) \
  110. __HYPERCALL_0ARG() __arg1 = (unsigned long)(a1);
  111. #define __HYPERCALL_2ARG(a1,a2) \
  112. __HYPERCALL_1ARG(a1) __arg2 = (unsigned long)(a2);
  113. #define __HYPERCALL_3ARG(a1,a2,a3) \
  114. __HYPERCALL_2ARG(a1,a2) __arg3 = (unsigned long)(a3);
  115. #define __HYPERCALL_4ARG(a1,a2,a3,a4) \
  116. __HYPERCALL_3ARG(a1,a2,a3) __arg4 = (unsigned long)(a4);
  117. #define __HYPERCALL_5ARG(a1,a2,a3,a4,a5) \
  118. __HYPERCALL_4ARG(a1,a2,a3,a4) __arg5 = (unsigned long)(a5);
  119. #define __HYPERCALL_CLOBBER5 "memory"
  120. #define __HYPERCALL_CLOBBER4 __HYPERCALL_CLOBBER5, __HYPERCALL_ARG5REG
  121. #define __HYPERCALL_CLOBBER3 __HYPERCALL_CLOBBER4, __HYPERCALL_ARG4REG
  122. #define __HYPERCALL_CLOBBER2 __HYPERCALL_CLOBBER3, __HYPERCALL_ARG3REG
  123. #define __HYPERCALL_CLOBBER1 __HYPERCALL_CLOBBER2, __HYPERCALL_ARG2REG
  124. #define __HYPERCALL_CLOBBER0 __HYPERCALL_CLOBBER1, __HYPERCALL_ARG1REG
  125. #define _hypercall0(type, name) \
  126. ({ \
  127. __HYPERCALL_DECLS; \
  128. __HYPERCALL_0ARG(); \
  129. asm volatile (__HYPERCALL \
  130. : __HYPERCALL_0PARAM \
  131. : __HYPERCALL_ENTRY(name) \
  132. : __HYPERCALL_CLOBBER0); \
  133. (type)__res; \
  134. })
  135. #define _hypercall1(type, name, a1) \
  136. ({ \
  137. __HYPERCALL_DECLS; \
  138. __HYPERCALL_1ARG(a1); \
  139. asm volatile (__HYPERCALL \
  140. : __HYPERCALL_1PARAM \
  141. : __HYPERCALL_ENTRY(name) \
  142. : __HYPERCALL_CLOBBER1); \
  143. (type)__res; \
  144. })
  145. #define _hypercall2(type, name, a1, a2) \
  146. ({ \
  147. __HYPERCALL_DECLS; \
  148. __HYPERCALL_2ARG(a1, a2); \
  149. asm volatile (__HYPERCALL \
  150. : __HYPERCALL_2PARAM \
  151. : __HYPERCALL_ENTRY(name) \
  152. : __HYPERCALL_CLOBBER2); \
  153. (type)__res; \
  154. })
  155. #define _hypercall3(type, name, a1, a2, a3) \
  156. ({ \
  157. __HYPERCALL_DECLS; \
  158. __HYPERCALL_3ARG(a1, a2, a3); \
  159. asm volatile (__HYPERCALL \
  160. : __HYPERCALL_3PARAM \
  161. : __HYPERCALL_ENTRY(name) \
  162. : __HYPERCALL_CLOBBER3); \
  163. (type)__res; \
  164. })
  165. #define _hypercall4(type, name, a1, a2, a3, a4) \
  166. ({ \
  167. __HYPERCALL_DECLS; \
  168. __HYPERCALL_4ARG(a1, a2, a3, a4); \
  169. asm volatile (__HYPERCALL \
  170. : __HYPERCALL_4PARAM \
  171. : __HYPERCALL_ENTRY(name) \
  172. : __HYPERCALL_CLOBBER4); \
  173. (type)__res; \
  174. })
  175. #define _hypercall5(type, name, a1, a2, a3, a4, a5) \
  176. ({ \
  177. __HYPERCALL_DECLS; \
  178. __HYPERCALL_5ARG(a1, a2, a3, a4, a5); \
  179. asm volatile (__HYPERCALL \
  180. : __HYPERCALL_5PARAM \
  181. : __HYPERCALL_ENTRY(name) \
  182. : __HYPERCALL_CLOBBER5); \
  183. (type)__res; \
  184. })
  185. static inline long
  186. privcmd_call(unsigned call,
  187. unsigned long a1, unsigned long a2,
  188. unsigned long a3, unsigned long a4,
  189. unsigned long a5)
  190. {
  191. __HYPERCALL_DECLS;
  192. __HYPERCALL_5ARG(a1, a2, a3, a4, a5);
  193. asm volatile("call *%[call]"
  194. : __HYPERCALL_5PARAM
  195. : [call] "a" (&hypercall_page[call])
  196. : __HYPERCALL_CLOBBER5);
  197. return (long)__res;
  198. }
  199. static inline int
  200. HYPERVISOR_set_trap_table(struct trap_info *table)
  201. {
  202. return _hypercall1(int, set_trap_table, table);
  203. }
  204. static inline int
  205. HYPERVISOR_mmu_update(struct mmu_update *req, int count,
  206. int *success_count, domid_t domid)
  207. {
  208. return _hypercall4(int, mmu_update, req, count, success_count, domid);
  209. }
  210. static inline int
  211. HYPERVISOR_mmuext_op(struct mmuext_op *op, int count,
  212. int *success_count, domid_t domid)
  213. {
  214. return _hypercall4(int, mmuext_op, op, count, success_count, domid);
  215. }
  216. static inline int
  217. HYPERVISOR_set_gdt(unsigned long *frame_list, int entries)
  218. {
  219. return _hypercall2(int, set_gdt, frame_list, entries);
  220. }
  221. static inline int
  222. HYPERVISOR_stack_switch(unsigned long ss, unsigned long esp)
  223. {
  224. return _hypercall2(int, stack_switch, ss, esp);
  225. }
  226. #ifdef CONFIG_X86_32
  227. static inline int
  228. HYPERVISOR_set_callbacks(unsigned long event_selector,
  229. unsigned long event_address,
  230. unsigned long failsafe_selector,
  231. unsigned long failsafe_address)
  232. {
  233. return _hypercall4(int, set_callbacks,
  234. event_selector, event_address,
  235. failsafe_selector, failsafe_address);
  236. }
  237. #else /* CONFIG_X86_64 */
  238. static inline int
  239. HYPERVISOR_set_callbacks(unsigned long event_address,
  240. unsigned long failsafe_address,
  241. unsigned long syscall_address)
  242. {
  243. return _hypercall3(int, set_callbacks,
  244. event_address, failsafe_address,
  245. syscall_address);
  246. }
  247. #endif /* CONFIG_X86_{32,64} */
  248. static inline int
  249. HYPERVISOR_callback_op(int cmd, void *arg)
  250. {
  251. return _hypercall2(int, callback_op, cmd, arg);
  252. }
  253. static inline int
  254. HYPERVISOR_fpu_taskswitch(int set)
  255. {
  256. return _hypercall1(int, fpu_taskswitch, set);
  257. }
  258. static inline int
  259. HYPERVISOR_sched_op(int cmd, void *arg)
  260. {
  261. return _hypercall2(int, sched_op, cmd, arg);
  262. }
  263. static inline long
  264. HYPERVISOR_set_timer_op(u64 timeout)
  265. {
  266. unsigned long timeout_hi = (unsigned long)(timeout>>32);
  267. unsigned long timeout_lo = (unsigned long)timeout;
  268. return _hypercall2(long, set_timer_op, timeout_lo, timeout_hi);
  269. }
  270. static inline int
  271. HYPERVISOR_set_debugreg(int reg, unsigned long value)
  272. {
  273. return _hypercall2(int, set_debugreg, reg, value);
  274. }
  275. static inline unsigned long
  276. HYPERVISOR_get_debugreg(int reg)
  277. {
  278. return _hypercall1(unsigned long, get_debugreg, reg);
  279. }
  280. static inline int
  281. HYPERVISOR_update_descriptor(u64 ma, u64 desc)
  282. {
  283. if (sizeof(u64) == sizeof(long))
  284. return _hypercall2(int, update_descriptor, ma, desc);
  285. return _hypercall4(int, update_descriptor, ma, ma>>32, desc, desc>>32);
  286. }
  287. static inline int
  288. HYPERVISOR_memory_op(unsigned int cmd, void *arg)
  289. {
  290. return _hypercall2(int, memory_op, cmd, arg);
  291. }
  292. static inline int
  293. HYPERVISOR_multicall(void *call_list, int nr_calls)
  294. {
  295. return _hypercall2(int, multicall, call_list, nr_calls);
  296. }
  297. static inline int
  298. HYPERVISOR_update_va_mapping(unsigned long va, pte_t new_val,
  299. unsigned long flags)
  300. {
  301. if (sizeof(new_val) == sizeof(long))
  302. return _hypercall3(int, update_va_mapping, va,
  303. new_val.pte, flags);
  304. else
  305. return _hypercall4(int, update_va_mapping, va,
  306. new_val.pte, new_val.pte >> 32, flags);
  307. }
  308. static inline int
  309. HYPERVISOR_event_channel_op(int cmd, void *arg)
  310. {
  311. int rc = _hypercall2(int, event_channel_op, cmd, arg);
  312. if (unlikely(rc == -ENOSYS)) {
  313. struct evtchn_op op;
  314. op.cmd = cmd;
  315. memcpy(&op.u, arg, sizeof(op.u));
  316. rc = _hypercall1(int, event_channel_op_compat, &op);
  317. memcpy(arg, &op.u, sizeof(op.u));
  318. }
  319. return rc;
  320. }
  321. static inline int
  322. HYPERVISOR_xen_version(int cmd, void *arg)
  323. {
  324. return _hypercall2(int, xen_version, cmd, arg);
  325. }
  326. static inline int
  327. HYPERVISOR_console_io(int cmd, int count, char *str)
  328. {
  329. return _hypercall3(int, console_io, cmd, count, str);
  330. }
  331. static inline int
  332. HYPERVISOR_physdev_op(int cmd, void *arg)
  333. {
  334. int rc = _hypercall2(int, physdev_op, cmd, arg);
  335. if (unlikely(rc == -ENOSYS)) {
  336. struct physdev_op op;
  337. op.cmd = cmd;
  338. memcpy(&op.u, arg, sizeof(op.u));
  339. rc = _hypercall1(int, physdev_op_compat, &op);
  340. memcpy(arg, &op.u, sizeof(op.u));
  341. }
  342. return rc;
  343. }
  344. static inline int
  345. HYPERVISOR_grant_table_op(unsigned int cmd, void *uop, unsigned int count)
  346. {
  347. return _hypercall3(int, grant_table_op, cmd, uop, count);
  348. }
  349. static inline int
  350. HYPERVISOR_update_va_mapping_otherdomain(unsigned long va, pte_t new_val,
  351. unsigned long flags, domid_t domid)
  352. {
  353. if (sizeof(new_val) == sizeof(long))
  354. return _hypercall4(int, update_va_mapping_otherdomain, va,
  355. new_val.pte, flags, domid);
  356. else
  357. return _hypercall5(int, update_va_mapping_otherdomain, va,
  358. new_val.pte, new_val.pte >> 32,
  359. flags, domid);
  360. }
  361. static inline int
  362. HYPERVISOR_vm_assist(unsigned int cmd, unsigned int type)
  363. {
  364. return _hypercall2(int, vm_assist, cmd, type);
  365. }
  366. static inline int
  367. HYPERVISOR_vcpu_op(int cmd, int vcpuid, void *extra_args)
  368. {
  369. return _hypercall3(int, vcpu_op, cmd, vcpuid, extra_args);
  370. }
  371. #ifdef CONFIG_X86_64
  372. static inline int
  373. HYPERVISOR_set_segment_base(int reg, unsigned long value)
  374. {
  375. return _hypercall2(int, set_segment_base, reg, value);
  376. }
  377. #endif
  378. static inline int
  379. HYPERVISOR_suspend(unsigned long start_info_mfn)
  380. {
  381. struct sched_shutdown r = { .reason = SHUTDOWN_suspend };
  382. /*
  383. * For a PV guest the tools require that the start_info mfn be
  384. * present in rdx/edx when the hypercall is made. Per the
  385. * hypercall calling convention this is the third hypercall
  386. * argument, which is start_info_mfn here.
  387. */
  388. return _hypercall3(int, sched_op, SCHEDOP_shutdown, &r, start_info_mfn);
  389. }
  390. static inline int
  391. HYPERVISOR_nmi_op(unsigned long op, unsigned long arg)
  392. {
  393. return _hypercall2(int, nmi_op, op, arg);
  394. }
  395. static inline unsigned long __must_check
  396. HYPERVISOR_hvm_op(int op, void *arg)
  397. {
  398. return _hypercall2(unsigned long, hvm_op, op, arg);
  399. }
  400. static inline int
  401. HYPERVISOR_tmem_op(
  402. struct tmem_op *op)
  403. {
  404. return _hypercall1(int, tmem_op, op);
  405. }
  406. static inline void
  407. MULTI_fpu_taskswitch(struct multicall_entry *mcl, int set)
  408. {
  409. mcl->op = __HYPERVISOR_fpu_taskswitch;
  410. mcl->args[0] = set;
  411. trace_xen_mc_entry(mcl, 1);
  412. }
  413. static inline void
  414. MULTI_update_va_mapping(struct multicall_entry *mcl, unsigned long va,
  415. pte_t new_val, unsigned long flags)
  416. {
  417. mcl->op = __HYPERVISOR_update_va_mapping;
  418. mcl->args[0] = va;
  419. if (sizeof(new_val) == sizeof(long)) {
  420. mcl->args[1] = new_val.pte;
  421. mcl->args[2] = flags;
  422. } else {
  423. mcl->args[1] = new_val.pte;
  424. mcl->args[2] = new_val.pte >> 32;
  425. mcl->args[3] = flags;
  426. }
  427. trace_xen_mc_entry(mcl, sizeof(new_val) == sizeof(long) ? 3 : 4);
  428. }
  429. static inline void
  430. MULTI_grant_table_op(struct multicall_entry *mcl, unsigned int cmd,
  431. void *uop, unsigned int count)
  432. {
  433. mcl->op = __HYPERVISOR_grant_table_op;
  434. mcl->args[0] = cmd;
  435. mcl->args[1] = (unsigned long)uop;
  436. mcl->args[2] = count;
  437. trace_xen_mc_entry(mcl, 3);
  438. }
  439. static inline void
  440. MULTI_update_va_mapping_otherdomain(struct multicall_entry *mcl, unsigned long va,
  441. pte_t new_val, unsigned long flags,
  442. domid_t domid)
  443. {
  444. mcl->op = __HYPERVISOR_update_va_mapping_otherdomain;
  445. mcl->args[0] = va;
  446. if (sizeof(new_val) == sizeof(long)) {
  447. mcl->args[1] = new_val.pte;
  448. mcl->args[2] = flags;
  449. mcl->args[3] = domid;
  450. } else {
  451. mcl->args[1] = new_val.pte;
  452. mcl->args[2] = new_val.pte >> 32;
  453. mcl->args[3] = flags;
  454. mcl->args[4] = domid;
  455. }
  456. trace_xen_mc_entry(mcl, sizeof(new_val) == sizeof(long) ? 4 : 5);
  457. }
  458. static inline void
  459. MULTI_update_descriptor(struct multicall_entry *mcl, u64 maddr,
  460. struct desc_struct desc)
  461. {
  462. mcl->op = __HYPERVISOR_update_descriptor;
  463. if (sizeof(maddr) == sizeof(long)) {
  464. mcl->args[0] = maddr;
  465. mcl->args[1] = *(unsigned long *)&desc;
  466. } else {
  467. mcl->args[0] = maddr;
  468. mcl->args[1] = maddr >> 32;
  469. mcl->args[2] = desc.a;
  470. mcl->args[3] = desc.b;
  471. }
  472. trace_xen_mc_entry(mcl, sizeof(maddr) == sizeof(long) ? 2 : 4);
  473. }
  474. static inline void
  475. MULTI_memory_op(struct multicall_entry *mcl, unsigned int cmd, void *arg)
  476. {
  477. mcl->op = __HYPERVISOR_memory_op;
  478. mcl->args[0] = cmd;
  479. mcl->args[1] = (unsigned long)arg;
  480. trace_xen_mc_entry(mcl, 2);
  481. }
  482. static inline void
  483. MULTI_mmu_update(struct multicall_entry *mcl, struct mmu_update *req,
  484. int count, int *success_count, domid_t domid)
  485. {
  486. mcl->op = __HYPERVISOR_mmu_update;
  487. mcl->args[0] = (unsigned long)req;
  488. mcl->args[1] = count;
  489. mcl->args[2] = (unsigned long)success_count;
  490. mcl->args[3] = domid;
  491. trace_xen_mc_entry(mcl, 4);
  492. }
  493. static inline void
  494. MULTI_mmuext_op(struct multicall_entry *mcl, struct mmuext_op *op, int count,
  495. int *success_count, domid_t domid)
  496. {
  497. mcl->op = __HYPERVISOR_mmuext_op;
  498. mcl->args[0] = (unsigned long)op;
  499. mcl->args[1] = count;
  500. mcl->args[2] = (unsigned long)success_count;
  501. mcl->args[3] = domid;
  502. trace_xen_mc_entry(mcl, 4);
  503. }
  504. static inline void
  505. MULTI_set_gdt(struct multicall_entry *mcl, unsigned long *frames, int entries)
  506. {
  507. mcl->op = __HYPERVISOR_set_gdt;
  508. mcl->args[0] = (unsigned long)frames;
  509. mcl->args[1] = entries;
  510. trace_xen_mc_entry(mcl, 2);
  511. }
  512. static inline void
  513. MULTI_stack_switch(struct multicall_entry *mcl,
  514. unsigned long ss, unsigned long esp)
  515. {
  516. mcl->op = __HYPERVISOR_stack_switch;
  517. mcl->args[0] = ss;
  518. mcl->args[1] = esp;
  519. trace_xen_mc_entry(mcl, 2);
  520. }
  521. #endif /* _ASM_X86_XEN_HYPERCALL_H */