vki-xen-sysctl.h 7.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204
  1. #ifndef __VKI_XEN_SYSCTL_H
  2. #define __VKI_XEN_SYSCTL_H
  3. /*
  4. * The sysctl interface is versioned via the interface_version
  5. * field. This structures in this header supports sysctl interfaces:
  6. *
  7. * - 0x00000008: Xen 4.1
  8. * - 0x00000009: Xen 4.2
  9. * - 0x0000000a: Xen 4.3 & 4.4
  10. * - 0x0000000b: Xen 4.5
  11. *
  12. * When adding a new subop be sure to include the variants used by all
  13. * of the above, both here and in syswrap-xen.c
  14. *
  15. * Structs which are identical in all supported versions have no
  16. * version suffix. Structs which do differ are defined multiple times
  17. * and use the suffix of the latest version to contain that particular
  18. * variant.
  19. */
  20. #define VKI_XEN_SYSCTL_readconsole 1
  21. #define VKI_XEN_SYSCTL_tbuf_op 2
  22. #define VKI_XEN_SYSCTL_physinfo 3
  23. #define VKI_XEN_SYSCTL_sched_id 4
  24. #define VKI_XEN_SYSCTL_perfc_op 5
  25. #define VKI_XEN_SYSCTL_getdomaininfolist 6
  26. #define VKI_XEN_SYSCTL_debug_keys 7
  27. #define VKI_XEN_SYSCTL_getcpuinfo 8
  28. #define VKI_XEN_SYSCTL_availheap 9
  29. #define VKI_XEN_SYSCTL_get_pmstat 10
  30. #define VKI_XEN_SYSCTL_cpu_hotplug 11
  31. #define VKI_XEN_SYSCTL_pm_op 12
  32. #define VKI_XEN_SYSCTL_page_offline_op 14
  33. #define VKI_XEN_SYSCTL_lockprof_op 15
  34. #define VKI_XEN_SYSCTL_topologyinfo 16
  35. #define VKI_XEN_SYSCTL_numainfo 17
  36. #define VKI_XEN_SYSCTL_cpupool_op 18
  37. #define VKI_XEN_SYSCTL_scheduler_op 19
  38. #define VKI_XEN_SYSCTL_coverage_op 20
  39. struct vki_xen_sysctl_readconsole {
  40. /* IN */
  41. vki_uint8_t clear;
  42. vki_uint8_t incremental;
  43. vki_uint8_t pad0, pad1;
  44. /*
  45. * IN: Start index for consumption if @incremental.
  46. * OUT: End index after consuming from the console.
  47. */
  48. vki_uint32_t index;
  49. VKI_XEN_GUEST_HANDLE_64(char) buffer; /* IN */
  50. /*
  51. * IN: size of buffer.
  52. * OUT: bytes written into buffer.
  53. */
  54. vki_uint32_t count;
  55. };
  56. struct vki_xen_sysctl_getdomaininfolist_00000008 {
  57. /* IN variables. */
  58. vki_xen_domid_t first_domain;
  59. vki_uint32_t max_domains;
  60. VKI_XEN_GUEST_HANDLE_64(vki_xen_domctl_getdomaininfo_00000007_t) buffer;
  61. /* OUT variables. */
  62. vki_uint32_t num_domains;
  63. };
  64. struct vki_xen_sysctl_getdomaininfolist_00000009 {
  65. /* IN variables. */
  66. vki_xen_domid_t first_domain;
  67. vki_uint32_t max_domains;
  68. VKI_XEN_GUEST_HANDLE_64(vki_xen_domctl_getdomaininfo_00000008_t) buffer;
  69. /* OUT variables. */
  70. vki_uint32_t num_domains;
  71. };
  72. struct vki_xen_sysctl_getdomaininfolist_0000000a {
  73. /* IN variables. */
  74. vki_xen_domid_t first_domain;
  75. vki_uint32_t max_domains;
  76. VKI_XEN_GUEST_HANDLE_64(vki_xen_domctl_getdomaininfo_00000009_t) buffer;
  77. /* OUT variables. */
  78. vki_uint32_t num_domains;
  79. };
  80. /* vki_xen_sysctl_getdomaininfolist_0000000b is the same as 0000000a */
  81. #define VKI_XEN_SYSCTL_CPUPOOL_OP_CREATE 1 /* C */
  82. #define VKI_XEN_SYSCTL_CPUPOOL_OP_DESTROY 2 /* D */
  83. #define VKI_XEN_SYSCTL_CPUPOOL_OP_INFO 3 /* I */
  84. #define VKI_XEN_SYSCTL_CPUPOOL_OP_ADDCPU 4 /* A */
  85. #define VKI_XEN_SYSCTL_CPUPOOL_OP_RMCPU 5 /* R */
  86. #define VKI_XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN 6 /* M */
  87. #define VKI_XEN_SYSCTL_CPUPOOL_OP_FREEINFO 7 /* F */
  88. #define VKI_XEN_SYSCTL_CPUPOOL_PAR_ANY 0xFFFFFFFF
  89. struct vki_xen_sysctl_cpupool_op {
  90. vki_uint32_t op; /* IN */
  91. vki_uint32_t cpupool_id; /* IN: CDIARM OUT: CI */
  92. vki_uint32_t sched_id; /* IN: C OUT: I */
  93. vki_uint32_t domid; /* IN: M */
  94. vki_uint32_t cpu; /* IN: AR */
  95. vki_uint32_t n_dom; /* OUT: I */
  96. struct vki_xenctl_bitmap cpumap; /* OUT: IF */
  97. };
  98. struct vki_xen_sysctl_debug_keys {
  99. /* IN variables. */
  100. VKI_XEN_GUEST_HANDLE_64(char) keys;
  101. vki_uint32_t nr_keys;
  102. };
  103. struct vki_xen_sysctl_topologyinfo {
  104. vki_uint32_t max_cpu_index;
  105. VKI_XEN_GUEST_HANDLE_64(vki_uint32) cpu_to_core;
  106. VKI_XEN_GUEST_HANDLE_64(vki_uint32) cpu_to_socket;
  107. VKI_XEN_GUEST_HANDLE_64(vki_uint32) cpu_to_node;
  108. };
  109. struct vki_xen_sysctl_numainfo {
  110. vki_uint32_t max_node_index;
  111. VKI_XEN_GUEST_HANDLE_64(vki_uint64) node_to_memsize;
  112. VKI_XEN_GUEST_HANDLE_64(vki_uint64) node_to_memfree;
  113. VKI_XEN_GUEST_HANDLE_64(vki_uint32) node_to_node_distance;
  114. };
  115. struct vki_xen_sysctl_physinfo_00000008 {
  116. vki_uint32_t threads_per_core;
  117. vki_uint32_t cores_per_socket;
  118. vki_uint32_t nr_cpus; /* # CPUs currently online */
  119. vki_uint32_t max_cpu_id; /* Largest possible CPU ID on this host */
  120. vki_uint32_t nr_nodes; /* # nodes currently online */
  121. vki_uint32_t max_node_id; /* Largest possible node ID on this host */
  122. vki_uint32_t cpu_khz;
  123. vki_xen_uint64_aligned_t total_pages;
  124. vki_xen_uint64_aligned_t free_pages;
  125. vki_xen_uint64_aligned_t scrub_pages;
  126. vki_uint32_t hw_cap[8];
  127. vki_uint32_t capabilities;
  128. };
  129. struct vki_xen_sysctl_physinfo_0000000a {
  130. vki_uint32_t threads_per_core;
  131. vki_uint32_t cores_per_socket;
  132. vki_uint32_t nr_cpus; /* # CPUs currently online */
  133. vki_uint32_t max_cpu_id; /* Largest possible CPU ID on this host */
  134. vki_uint32_t nr_nodes; /* # nodes currently online */
  135. vki_uint32_t max_node_id; /* Largest possible node ID on this host */
  136. vki_uint32_t cpu_khz;
  137. vki_xen_uint64_aligned_t total_pages;
  138. vki_xen_uint64_aligned_t free_pages;
  139. vki_xen_uint64_aligned_t scrub_pages;
  140. vki_xen_uint64_aligned_t outstanding_pages;
  141. vki_uint32_t hw_cap[8];
  142. vki_uint32_t capabilities;
  143. };
  144. /* vki_xen_sysctl_physinfo_0000000b is the same as 0000000a */
  145. struct vki_xen_sysctl_sched_id {
  146. /* OUT variable. */
  147. vki_uint32_t sched_id;
  148. };
  149. struct vki_xen_sysctl {
  150. vki_uint32_t cmd;
  151. vki_uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
  152. union {
  153. struct vki_xen_sysctl_readconsole readconsole;
  154. //struct vki_xen_sysctl_tbuf_op tbuf_op;
  155. struct vki_xen_sysctl_physinfo_00000008 physinfo_00000008;
  156. struct vki_xen_sysctl_physinfo_0000000a physinfo_0000000a;
  157. struct vki_xen_sysctl_topologyinfo topologyinfo;
  158. struct vki_xen_sysctl_numainfo numainfo;
  159. struct vki_xen_sysctl_sched_id sched_id;
  160. //struct vki_xen_sysctl_perfc_op perfc_op;
  161. struct vki_xen_sysctl_getdomaininfolist_00000008 getdomaininfolist_00000008;
  162. struct vki_xen_sysctl_getdomaininfolist_00000009 getdomaininfolist_00000009;
  163. struct vki_xen_sysctl_getdomaininfolist_0000000a getdomaininfolist_0000000a;
  164. struct vki_xen_sysctl_debug_keys debug_keys;
  165. //struct vki_xen_sysctl_getcpuinfo getcpuinfo;
  166. //struct vki_xen_sysctl_availheap availheap;
  167. //struct vki_xen_sysctl_get_pmstat get_pmstat;
  168. //struct vki_xen_sysctl_cpu_hotplug cpu_hotplug;
  169. //struct vki_xen_sysctl_pm_op pm_op;
  170. //struct vki_xen_sysctl_page_offline_op page_offline;
  171. //struct vki_xen_sysctl_lockprof_op lockprof_op;
  172. struct vki_xen_sysctl_cpupool_op cpupool_op;
  173. //struct vki_xen_sysctl_scheduler_op scheduler_op;
  174. //struct vki_xen_sysctl_coverage_op coverage_op;
  175. vki_uint8_t pad[128];
  176. } u;
  177. };
  178. #endif // __VKI_XEN_SYSCTL_H
  179. /*--------------------------------------------------------------------*/
  180. /*--- end ---*/
  181. /*--------------------------------------------------------------------*/