xen.h 20 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536
  1. /******************************************************************************
  2. * xen.h
  3. *
  4. * Guest OS interface to Xen.
  5. *
  6. * Copyright (c) 2004, K A Fraser
  7. */
  8. #ifndef __XEN_PUBLIC_XEN_H__
  9. #define __XEN_PUBLIC_XEN_H__
  10. #include <asm/xen/interface.h>
  11. #include <asm/pvclock-abi.h>
  12. /*
  13. * XEN "SYSTEM CALLS" (a.k.a. HYPERCALLS).
  14. */
  15. /*
  16. * x86_32: EAX = vector; EBX, ECX, EDX, ESI, EDI = args 1, 2, 3, 4, 5.
  17. * EAX = return value
  18. * (argument registers may be clobbered on return)
  19. * x86_64: RAX = vector; RDI, RSI, RDX, R10, R8, R9 = args 1, 2, 3, 4, 5, 6.
  20. * RAX = return value
  21. * (argument registers not clobbered on return; RCX, R11 are)
  22. */
  23. #define __HYPERVISOR_set_trap_table 0
  24. #define __HYPERVISOR_mmu_update 1
  25. #define __HYPERVISOR_set_gdt 2
  26. #define __HYPERVISOR_stack_switch 3
  27. #define __HYPERVISOR_set_callbacks 4
  28. #define __HYPERVISOR_fpu_taskswitch 5
  29. #define __HYPERVISOR_sched_op_compat 6
  30. #define __HYPERVISOR_dom0_op 7
  31. #define __HYPERVISOR_set_debugreg 8
  32. #define __HYPERVISOR_get_debugreg 9
  33. #define __HYPERVISOR_update_descriptor 10
  34. #define __HYPERVISOR_memory_op 12
  35. #define __HYPERVISOR_multicall 13
  36. #define __HYPERVISOR_update_va_mapping 14
  37. #define __HYPERVISOR_set_timer_op 15
  38. #define __HYPERVISOR_event_channel_op_compat 16
  39. #define __HYPERVISOR_xen_version 17
  40. #define __HYPERVISOR_console_io 18
  41. #define __HYPERVISOR_physdev_op_compat 19
  42. #define __HYPERVISOR_grant_table_op 20
  43. #define __HYPERVISOR_vm_assist 21
  44. #define __HYPERVISOR_update_va_mapping_otherdomain 22
  45. #define __HYPERVISOR_iret 23 /* x86 only */
  46. #define __HYPERVISOR_vcpu_op 24
  47. #define __HYPERVISOR_set_segment_base 25 /* x86/64 only */
  48. #define __HYPERVISOR_mmuext_op 26
  49. #define __HYPERVISOR_acm_op 27
  50. #define __HYPERVISOR_nmi_op 28
  51. #define __HYPERVISOR_sched_op 29
  52. #define __HYPERVISOR_callback_op 30
  53. #define __HYPERVISOR_xenoprof_op 31
  54. #define __HYPERVISOR_event_channel_op 32
  55. #define __HYPERVISOR_physdev_op 33
  56. #define __HYPERVISOR_hvm_op 34
  57. #define __HYPERVISOR_tmem_op 38
  58. /* Architecture-specific hypercall definitions. */
  59. #define __HYPERVISOR_arch_0 48
  60. #define __HYPERVISOR_arch_1 49
  61. #define __HYPERVISOR_arch_2 50
  62. #define __HYPERVISOR_arch_3 51
  63. #define __HYPERVISOR_arch_4 52
  64. #define __HYPERVISOR_arch_5 53
  65. #define __HYPERVISOR_arch_6 54
  66. #define __HYPERVISOR_arch_7 55
  67. /*
  68. * VIRTUAL INTERRUPTS
  69. *
  70. * Virtual interrupts that a guest OS may receive from Xen.
  71. */
  72. #define VIRQ_TIMER 0 /* Timebase update, and/or requested timeout. */
  73. #define VIRQ_DEBUG 1 /* Request guest to dump debug info. */
  74. #define VIRQ_CONSOLE 2 /* (DOM0) Bytes received on emergency console. */
  75. #define VIRQ_DOM_EXC 3 /* (DOM0) Exceptional event for some domain. */
  76. #define VIRQ_DEBUGGER 6 /* (DOM0) A domain has paused for debugging. */
  77. /* Architecture-specific VIRQ definitions. */
  78. #define VIRQ_ARCH_0 16
  79. #define VIRQ_ARCH_1 17
  80. #define VIRQ_ARCH_2 18
  81. #define VIRQ_ARCH_3 19
  82. #define VIRQ_ARCH_4 20
  83. #define VIRQ_ARCH_5 21
  84. #define VIRQ_ARCH_6 22
  85. #define VIRQ_ARCH_7 23
  86. #define NR_VIRQS 24
  87. /*
  88. * MMU-UPDATE REQUESTS
  89. *
  90. * HYPERVISOR_mmu_update() accepts a list of (ptr, val) pairs.
  91. * A foreigndom (FD) can be specified (or DOMID_SELF for none).
  92. * Where the FD has some effect, it is described below.
  93. * ptr[1:0] specifies the appropriate MMU_* command.
  94. *
  95. * ptr[1:0] == MMU_NORMAL_PT_UPDATE:
  96. * Updates an entry in a page table. If updating an L1 table, and the new
  97. * table entry is valid/present, the mapped frame must belong to the FD, if
  98. * an FD has been specified. If attempting to map an I/O page then the
  99. * caller assumes the privilege of the FD.
  100. * FD == DOMID_IO: Permit /only/ I/O mappings, at the priv level of the caller.
  101. * FD == DOMID_XEN: Map restricted areas of Xen's heap space.
  102. * ptr[:2] -- Machine address of the page-table entry to modify.
  103. * val -- Value to write.
  104. *
  105. * ptr[1:0] == MMU_MACHPHYS_UPDATE:
  106. * Updates an entry in the machine->pseudo-physical mapping table.
  107. * ptr[:2] -- Machine address within the frame whose mapping to modify.
  108. * The frame must belong to the FD, if one is specified.
  109. * val -- Value to write into the mapping entry.
  110. *
  111. * ptr[1:0] == MMU_PT_UPDATE_PRESERVE_AD:
  112. * As MMU_NORMAL_PT_UPDATE above, but A/D bits currently in the PTE are ORed
  113. * with those in @val.
  114. */
  115. #define MMU_NORMAL_PT_UPDATE 0 /* checked '*ptr = val'. ptr is MA. */
  116. #define MMU_MACHPHYS_UPDATE 1 /* ptr = MA of frame to modify entry for */
  117. #define MMU_PT_UPDATE_PRESERVE_AD 2 /* atomically: *ptr = val | (*ptr&(A|D)) */
  118. /*
  119. * MMU EXTENDED OPERATIONS
  120. *
  121. * HYPERVISOR_mmuext_op() accepts a list of mmuext_op structures.
  122. * A foreigndom (FD) can be specified (or DOMID_SELF for none).
  123. * Where the FD has some effect, it is described below.
  124. *
  125. * cmd: MMUEXT_(UN)PIN_*_TABLE
  126. * mfn: Machine frame number to be (un)pinned as a p.t. page.
  127. * The frame must belong to the FD, if one is specified.
  128. *
  129. * cmd: MMUEXT_NEW_BASEPTR
  130. * mfn: Machine frame number of new page-table base to install in MMU.
  131. *
  132. * cmd: MMUEXT_NEW_USER_BASEPTR [x86/64 only]
  133. * mfn: Machine frame number of new page-table base to install in MMU
  134. * when in user space.
  135. *
  136. * cmd: MMUEXT_TLB_FLUSH_LOCAL
  137. * No additional arguments. Flushes local TLB.
  138. *
  139. * cmd: MMUEXT_INVLPG_LOCAL
  140. * linear_addr: Linear address to be flushed from the local TLB.
  141. *
  142. * cmd: MMUEXT_TLB_FLUSH_MULTI
  143. * vcpumask: Pointer to bitmap of VCPUs to be flushed.
  144. *
  145. * cmd: MMUEXT_INVLPG_MULTI
  146. * linear_addr: Linear address to be flushed.
  147. * vcpumask: Pointer to bitmap of VCPUs to be flushed.
  148. *
  149. * cmd: MMUEXT_TLB_FLUSH_ALL
  150. * No additional arguments. Flushes all VCPUs' TLBs.
  151. *
  152. * cmd: MMUEXT_INVLPG_ALL
  153. * linear_addr: Linear address to be flushed from all VCPUs' TLBs.
  154. *
  155. * cmd: MMUEXT_FLUSH_CACHE
  156. * No additional arguments. Writes back and flushes cache contents.
  157. *
  158. * cmd: MMUEXT_SET_LDT
  159. * linear_addr: Linear address of LDT base (NB. must be page-aligned).
  160. * nr_ents: Number of entries in LDT.
  161. */
  162. #define MMUEXT_PIN_L1_TABLE 0
  163. #define MMUEXT_PIN_L2_TABLE 1
  164. #define MMUEXT_PIN_L3_TABLE 2
  165. #define MMUEXT_PIN_L4_TABLE 3
  166. #define MMUEXT_UNPIN_TABLE 4
  167. #define MMUEXT_NEW_BASEPTR 5
  168. #define MMUEXT_TLB_FLUSH_LOCAL 6
  169. #define MMUEXT_INVLPG_LOCAL 7
  170. #define MMUEXT_TLB_FLUSH_MULTI 8
  171. #define MMUEXT_INVLPG_MULTI 9
  172. #define MMUEXT_TLB_FLUSH_ALL 10
  173. #define MMUEXT_INVLPG_ALL 11
  174. #define MMUEXT_FLUSH_CACHE 12
  175. #define MMUEXT_SET_LDT 13
  176. #define MMUEXT_NEW_USER_BASEPTR 15
  177. #ifndef __ASSEMBLY__
  178. struct mmuext_op {
  179. unsigned int cmd;
  180. union {
  181. /* [UN]PIN_TABLE, NEW_BASEPTR, NEW_USER_BASEPTR */
  182. unsigned long mfn;
  183. /* INVLPG_LOCAL, INVLPG_ALL, SET_LDT */
  184. unsigned long linear_addr;
  185. } arg1;
  186. union {
  187. /* SET_LDT */
  188. unsigned int nr_ents;
  189. /* TLB_FLUSH_MULTI, INVLPG_MULTI */
  190. void *vcpumask;
  191. } arg2;
  192. };
  193. DEFINE_GUEST_HANDLE_STRUCT(mmuext_op);
  194. #endif
  195. /* These are passed as 'flags' to update_va_mapping. They can be ORed. */
  196. /* When specifying UVMF_MULTI, also OR in a pointer to a CPU bitmap. */
  197. /* UVMF_LOCAL is merely UVMF_MULTI with a NULL bitmap pointer. */
  198. #define UVMF_NONE (0UL<<0) /* No flushing at all. */
  199. #define UVMF_TLB_FLUSH (1UL<<0) /* Flush entire TLB(s). */
  200. #define UVMF_INVLPG (2UL<<0) /* Flush only one entry. */
  201. #define UVMF_FLUSHTYPE_MASK (3UL<<0)
  202. #define UVMF_MULTI (0UL<<2) /* Flush subset of TLBs. */
  203. #define UVMF_LOCAL (0UL<<2) /* Flush local TLB. */
  204. #define UVMF_ALL (1UL<<2) /* Flush all TLBs. */
  205. /*
  206. * Commands to HYPERVISOR_console_io().
  207. */
  208. #define CONSOLEIO_write 0
  209. #define CONSOLEIO_read 1
  210. /*
  211. * Commands to HYPERVISOR_vm_assist().
  212. */
  213. #define VMASST_CMD_enable 0
  214. #define VMASST_CMD_disable 1
  215. #define VMASST_TYPE_4gb_segments 0
  216. #define VMASST_TYPE_4gb_segments_notify 1
  217. #define VMASST_TYPE_writable_pagetables 2
  218. #define VMASST_TYPE_pae_extended_cr3 3
  219. #define MAX_VMASST_TYPE 3
  220. #ifndef __ASSEMBLY__
  221. typedef uint16_t domid_t;
  222. /* Domain ids >= DOMID_FIRST_RESERVED cannot be used for ordinary domains. */
  223. #define DOMID_FIRST_RESERVED (0x7FF0U)
  224. /* DOMID_SELF is used in certain contexts to refer to oneself. */
  225. #define DOMID_SELF (0x7FF0U)
  226. /*
  227. * DOMID_IO is used to restrict page-table updates to mapping I/O memory.
  228. * Although no Foreign Domain need be specified to map I/O pages, DOMID_IO
  229. * is useful to ensure that no mappings to the OS's own heap are accidentally
  230. * installed. (e.g., in Linux this could cause havoc as reference counts
  231. * aren't adjusted on the I/O-mapping code path).
  232. * This only makes sense in MMUEXT_SET_FOREIGNDOM, but in that context can
  233. * be specified by any calling domain.
  234. */
  235. #define DOMID_IO (0x7FF1U)
  236. /*
  237. * DOMID_XEN is used to allow privileged domains to map restricted parts of
  238. * Xen's heap space (e.g., the machine_to_phys table).
  239. * This only makes sense in MMUEXT_SET_FOREIGNDOM, and is only permitted if
  240. * the caller is privileged.
  241. */
  242. #define DOMID_XEN (0x7FF2U)
  243. /*
  244. * Send an array of these to HYPERVISOR_mmu_update().
  245. * NB. The fields are natural pointer/address size for this architecture.
  246. */
  247. struct mmu_update {
  248. uint64_t ptr; /* Machine address of PTE. */
  249. uint64_t val; /* New contents of PTE. */
  250. };
  251. DEFINE_GUEST_HANDLE_STRUCT(mmu_update);
  252. /*
  253. * Send an array of these to HYPERVISOR_multicall().
  254. * NB. The fields are natural register size for this architecture.
  255. */
  256. struct multicall_entry {
  257. unsigned long op;
  258. long result;
  259. unsigned long args[6];
  260. };
  261. DEFINE_GUEST_HANDLE_STRUCT(multicall_entry);
  262. /*
  263. * Event channel endpoints per domain:
  264. * 1024 if a long is 32 bits; 4096 if a long is 64 bits.
  265. */
  266. #define NR_EVENT_CHANNELS (sizeof(unsigned long) * sizeof(unsigned long) * 64)
  267. struct vcpu_time_info {
  268. /*
  269. * Updates to the following values are preceded and followed
  270. * by an increment of 'version'. The guest can therefore
  271. * detect updates by looking for changes to 'version'. If the
  272. * least-significant bit of the version number is set then an
  273. * update is in progress and the guest must wait to read a
  274. * consistent set of values. The correct way to interact with
  275. * the version number is similar to Linux's seqlock: see the
  276. * implementations of read_seqbegin/read_seqretry.
  277. */
  278. uint32_t version;
  279. uint32_t pad0;
  280. uint64_t tsc_timestamp; /* TSC at last update of time vals. */
  281. uint64_t system_time; /* Time, in nanosecs, since boot. */
  282. /*
  283. * Current system time:
  284. * system_time + ((tsc - tsc_timestamp) << tsc_shift) * tsc_to_system_mul
  285. * CPU frequency (Hz):
  286. * ((10^9 << 32) / tsc_to_system_mul) >> tsc_shift
  287. */
  288. uint32_t tsc_to_system_mul;
  289. int8_t tsc_shift;
  290. int8_t pad1[3];
  291. }; /* 32 bytes */
  292. struct vcpu_info {
  293. /*
  294. * 'evtchn_upcall_pending' is written non-zero by Xen to indicate
  295. * a pending notification for a particular VCPU. It is then cleared
  296. * by the guest OS /before/ checking for pending work, thus avoiding
  297. * a set-and-check race. Note that the mask is only accessed by Xen
  298. * on the CPU that is currently hosting the VCPU. This means that the
  299. * pending and mask flags can be updated by the guest without special
  300. * synchronisation (i.e., no need for the x86 LOCK prefix).
  301. * This may seem suboptimal because if the pending flag is set by
  302. * a different CPU then an IPI may be scheduled even when the mask
  303. * is set. However, note:
  304. * 1. The task of 'interrupt holdoff' is covered by the per-event-
  305. * channel mask bits. A 'noisy' event that is continually being
  306. * triggered can be masked at source at this very precise
  307. * granularity.
  308. * 2. The main purpose of the per-VCPU mask is therefore to restrict
  309. * reentrant execution: whether for concurrency control, or to
  310. * prevent unbounded stack usage. Whatever the purpose, we expect
  311. * that the mask will be asserted only for short periods at a time,
  312. * and so the likelihood of a 'spurious' IPI is suitably small.
  313. * The mask is read before making an event upcall to the guest: a
  314. * non-zero mask therefore guarantees that the VCPU will not receive
  315. * an upcall activation. The mask is cleared when the VCPU requests
  316. * to block: this avoids wakeup-waiting races.
  317. */
  318. uint8_t evtchn_upcall_pending;
  319. uint8_t evtchn_upcall_mask;
  320. unsigned long evtchn_pending_sel;
  321. struct arch_vcpu_info arch;
  322. struct pvclock_vcpu_time_info time;
  323. }; /* 64 bytes (x86) */
  324. /*
  325. * Xen/kernel shared data -- pointer provided in start_info.
  326. * NB. We expect that this struct is smaller than a page.
  327. */
  328. struct shared_info {
  329. struct vcpu_info vcpu_info[MAX_VIRT_CPUS];
  330. /*
  331. * A domain can create "event channels" on which it can send and receive
  332. * asynchronous event notifications. There are three classes of event that
  333. * are delivered by this mechanism:
  334. * 1. Bi-directional inter- and intra-domain connections. Domains must
  335. * arrange out-of-band to set up a connection (usually by allocating
  336. * an unbound 'listener' port and avertising that via a storage service
  337. * such as xenstore).
  338. * 2. Physical interrupts. A domain with suitable hardware-access
  339. * privileges can bind an event-channel port to a physical interrupt
  340. * source.
  341. * 3. Virtual interrupts ('events'). A domain can bind an event-channel
  342. * port to a virtual interrupt source, such as the virtual-timer
  343. * device or the emergency console.
  344. *
  345. * Event channels are addressed by a "port index". Each channel is
  346. * associated with two bits of information:
  347. * 1. PENDING -- notifies the domain that there is a pending notification
  348. * to be processed. This bit is cleared by the guest.
  349. * 2. MASK -- if this bit is clear then a 0->1 transition of PENDING
  350. * will cause an asynchronous upcall to be scheduled. This bit is only
  351. * updated by the guest. It is read-only within Xen. If a channel
  352. * becomes pending while the channel is masked then the 'edge' is lost
  353. * (i.e., when the channel is unmasked, the guest must manually handle
  354. * pending notifications as no upcall will be scheduled by Xen).
  355. *
  356. * To expedite scanning of pending notifications, any 0->1 pending
  357. * transition on an unmasked channel causes a corresponding bit in a
  358. * per-vcpu selector word to be set. Each bit in the selector covers a
  359. * 'C long' in the PENDING bitfield array.
  360. */
  361. unsigned long evtchn_pending[sizeof(unsigned long) * 8];
  362. unsigned long evtchn_mask[sizeof(unsigned long) * 8];
  363. /*
  364. * Wallclock time: updated only by control software. Guests should base
  365. * their gettimeofday() syscall on this wallclock-base value.
  366. */
  367. struct pvclock_wall_clock wc;
  368. struct arch_shared_info arch;
  369. };
  370. /*
  371. * Start-of-day memory layout for the initial domain (DOM0):
  372. * 1. The domain is started within contiguous virtual-memory region.
  373. * 2. The contiguous region begins and ends on an aligned 4MB boundary.
  374. * 3. The region start corresponds to the load address of the OS image.
  375. * If the load address is not 4MB aligned then the address is rounded down.
  376. * 4. This the order of bootstrap elements in the initial virtual region:
  377. * a. relocated kernel image
  378. * b. initial ram disk [mod_start, mod_len]
  379. * c. list of allocated page frames [mfn_list, nr_pages]
  380. * d. start_info_t structure [register ESI (x86)]
  381. * e. bootstrap page tables [pt_base, CR3 (x86)]
  382. * f. bootstrap stack [register ESP (x86)]
  383. * 5. Bootstrap elements are packed together, but each is 4kB-aligned.
  384. * 6. The initial ram disk may be omitted.
  385. * 7. The list of page frames forms a contiguous 'pseudo-physical' memory
  386. * layout for the domain. In particular, the bootstrap virtual-memory
  387. * region is a 1:1 mapping to the first section of the pseudo-physical map.
  388. * 8. All bootstrap elements are mapped read-writable for the guest OS. The
  389. * only exception is the bootstrap page table, which is mapped read-only.
  390. * 9. There is guaranteed to be at least 512kB padding after the final
  391. * bootstrap element. If necessary, the bootstrap virtual region is
  392. * extended by an extra 4MB to ensure this.
  393. */
  394. #define MAX_GUEST_CMDLINE 1024
  395. struct start_info {
  396. /* THE FOLLOWING ARE FILLED IN BOTH ON INITIAL BOOT AND ON RESUME. */
  397. char magic[32]; /* "xen-<version>-<platform>". */
  398. unsigned long nr_pages; /* Total pages allocated to this domain. */
  399. unsigned long shared_info; /* MACHINE address of shared info struct. */
  400. uint32_t flags; /* SIF_xxx flags. */
  401. unsigned long store_mfn; /* MACHINE page number of shared page. */
  402. uint32_t store_evtchn; /* Event channel for store communication. */
  403. union {
  404. struct {
  405. unsigned long mfn; /* MACHINE page number of console page. */
  406. uint32_t evtchn; /* Event channel for console page. */
  407. } domU;
  408. struct {
  409. uint32_t info_off; /* Offset of console_info struct. */
  410. uint32_t info_size; /* Size of console_info struct from start.*/
  411. } dom0;
  412. } console;
  413. /* THE FOLLOWING ARE ONLY FILLED IN ON INITIAL BOOT (NOT RESUME). */
  414. unsigned long pt_base; /* VIRTUAL address of page directory. */
  415. unsigned long nr_pt_frames; /* Number of bootstrap p.t. frames. */
  416. unsigned long mfn_list; /* VIRTUAL address of page-frame list. */
  417. unsigned long mod_start; /* VIRTUAL address of pre-loaded module. */
  418. unsigned long mod_len; /* Size (bytes) of pre-loaded module. */
  419. int8_t cmd_line[MAX_GUEST_CMDLINE];
  420. };
  421. struct dom0_vga_console_info {
  422. uint8_t video_type;
  423. #define XEN_VGATYPE_TEXT_MODE_3 0x03
  424. #define XEN_VGATYPE_VESA_LFB 0x23
  425. union {
  426. struct {
  427. /* Font height, in pixels. */
  428. uint16_t font_height;
  429. /* Cursor location (column, row). */
  430. uint16_t cursor_x, cursor_y;
  431. /* Number of rows and columns (dimensions in characters). */
  432. uint16_t rows, columns;
  433. } text_mode_3;
  434. struct {
  435. /* Width and height, in pixels. */
  436. uint16_t width, height;
  437. /* Bytes per scan line. */
  438. uint16_t bytes_per_line;
  439. /* Bits per pixel. */
  440. uint16_t bits_per_pixel;
  441. /* LFB physical address, and size (in units of 64kB). */
  442. uint32_t lfb_base;
  443. uint32_t lfb_size;
  444. /* RGB mask offsets and sizes, as defined by VBE 1.2+ */
  445. uint8_t red_pos, red_size;
  446. uint8_t green_pos, green_size;
  447. uint8_t blue_pos, blue_size;
  448. uint8_t rsvd_pos, rsvd_size;
  449. /* VESA capabilities (offset 0xa, VESA command 0x4f00). */
  450. uint32_t gbl_caps;
  451. /* Mode attributes (offset 0x0, VESA command 0x4f01). */
  452. uint16_t mode_attrs;
  453. } vesa_lfb;
  454. } u;
  455. };
  456. /* These flags are passed in the 'flags' field of start_info_t. */
  457. #define SIF_PRIVILEGED (1<<0) /* Is the domain privileged? */
  458. #define SIF_INITDOMAIN (1<<1) /* Is this the initial control domain? */
  459. #define SIF_PM_MASK (0xFF<<8) /* reserve 1 byte for xen-pm options */
  460. typedef uint64_t cpumap_t;
  461. typedef uint8_t xen_domain_handle_t[16];
  462. /* Turn a plain number into a C unsigned long constant. */
  463. #define __mk_unsigned_long(x) x ## UL
  464. #define mk_unsigned_long(x) __mk_unsigned_long(x)
  465. #define TMEM_SPEC_VERSION 1
  466. struct tmem_op {
  467. uint32_t cmd;
  468. int32_t pool_id;
  469. union {
  470. struct { /* for cmd == TMEM_NEW_POOL */
  471. uint64_t uuid[2];
  472. uint32_t flags;
  473. } new;
  474. struct {
  475. uint64_t oid[3];
  476. uint32_t index;
  477. uint32_t tmem_offset;
  478. uint32_t pfn_offset;
  479. uint32_t len;
  480. GUEST_HANDLE(void) gmfn; /* guest machine page frame */
  481. } gen;
  482. } u;
  483. };
  484. DEFINE_GUEST_HANDLE(u64);
  485. #else /* __ASSEMBLY__ */
  486. /* In assembly code we cannot use C numeric constant suffixes. */
  487. #define mk_unsigned_long(x) x
  488. #endif /* !__ASSEMBLY__ */
  489. #endif /* __XEN_PUBLIC_XEN_H__ */