Added patch headers.
[linux-flexiantxendom0-3.2.10.git] / include / xen / interface / sysctl.h
1 /******************************************************************************
2  * sysctl.h
3  * 
4  * System management operations. For use by node control stack.
5  * 
6  * Permission is hereby granted, free of charge, to any person obtaining a copy
7  * of this software and associated documentation files (the "Software"), to
8  * deal in the Software without restriction, including without limitation the
9  * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10  * sell copies of the Software, and to permit persons to whom the Software is
11  * furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in
14  * all copies or substantial portions of the Software.
15  *
16  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17  * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19  * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20  * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21  * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
22  * DEALINGS IN THE SOFTWARE.
23  *
24  * Copyright (c) 2002-2006, K Fraser
25  */
26
27 #ifndef __XEN_PUBLIC_SYSCTL_H__
28 #define __XEN_PUBLIC_SYSCTL_H__
29
30 #if !defined(__XEN__) && !defined(__XEN_TOOLS__)
31 #error "sysctl operations are intended for use by node control tools only"
32 #endif
33
34 #include "xen.h"
35 #include "domctl.h"
36
37 #define XEN_SYSCTL_INTERFACE_VERSION 0x00000008
38
39 /*
40  * Read console content from Xen buffer ring.
41  */
42 /* XEN_SYSCTL_readconsole */
43 struct xen_sysctl_readconsole {
44     /* IN: Non-zero -> clear after reading. */
45     uint8_t clear;
46     /* IN: Non-zero -> start index specified by @index field. */
47     uint8_t incremental;
48     uint8_t pad0, pad1;
49     /*
50      * IN:  Start index for consuming from ring buffer (if @incremental);
51      * OUT: End index after consuming from ring buffer.
52      */
53     uint32_t index; 
54     /* IN: Virtual address to write console data. */
55     XEN_GUEST_HANDLE_64(char) buffer;
56     /* IN: Size of buffer; OUT: Bytes written to buffer. */
57     uint32_t count;
58 };
59 typedef struct xen_sysctl_readconsole xen_sysctl_readconsole_t;
60 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_readconsole_t);
61
62 /* Get trace buffers machine base address */
63 /* XEN_SYSCTL_tbuf_op */
64 struct xen_sysctl_tbuf_op {
65     /* IN variables */
66 #define XEN_SYSCTL_TBUFOP_get_info     0
67 #define XEN_SYSCTL_TBUFOP_set_cpu_mask 1
68 #define XEN_SYSCTL_TBUFOP_set_evt_mask 2
69 #define XEN_SYSCTL_TBUFOP_set_size     3
70 #define XEN_SYSCTL_TBUFOP_enable       4
71 #define XEN_SYSCTL_TBUFOP_disable      5
72     uint32_t cmd;
73     /* IN/OUT variables */
74     struct xenctl_cpumap cpu_mask;
75     uint32_t             evt_mask;
76     /* OUT variables */
77     uint64_aligned_t buffer_mfn;
78     uint32_t size;  /* Also an IN variable! */
79 };
80 typedef struct xen_sysctl_tbuf_op xen_sysctl_tbuf_op_t;
81 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_tbuf_op_t);
82
83 /*
84  * Get physical information about the host machine
85  */
86 /* XEN_SYSCTL_physinfo */
87  /* (x86) The platform supports HVM guests. */
88 #define _XEN_SYSCTL_PHYSCAP_hvm          0
89 #define XEN_SYSCTL_PHYSCAP_hvm           (1u<<_XEN_SYSCTL_PHYSCAP_hvm)
90  /* (x86) The platform supports HVM-guest direct access to I/O devices. */
91 #define _XEN_SYSCTL_PHYSCAP_hvm_directio 1
92 #define XEN_SYSCTL_PHYSCAP_hvm_directio  (1u<<_XEN_SYSCTL_PHYSCAP_hvm_directio)
93 struct xen_sysctl_physinfo {
94     uint32_t threads_per_core;
95     uint32_t cores_per_socket;
96     uint32_t nr_cpus, max_cpu_id;
97     uint32_t nr_nodes, max_node_id;
98     uint32_t cpu_khz;
99     uint64_aligned_t total_pages;
100     uint64_aligned_t free_pages;
101     uint64_aligned_t scrub_pages;
102     uint32_t hw_cap[8];
103
104     /* XEN_SYSCTL_PHYSCAP_??? */
105     uint32_t capabilities;
106 };
107 typedef struct xen_sysctl_physinfo xen_sysctl_physinfo_t;
108 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_physinfo_t);
109
110 /*
111  * Get the ID of the current scheduler.
112  */
113 /* XEN_SYSCTL_sched_id */
114 struct xen_sysctl_sched_id {
115     /* OUT variable */
116     uint32_t sched_id;
117 };
118 typedef struct xen_sysctl_sched_id xen_sysctl_sched_id_t;
119 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_sched_id_t);
120
121 /* Interface for controlling Xen software performance counters. */
122 /* XEN_SYSCTL_perfc_op */
123 /* Sub-operations: */
124 #define XEN_SYSCTL_PERFCOP_reset 1   /* Reset all counters to zero. */
125 #define XEN_SYSCTL_PERFCOP_query 2   /* Get perfctr information. */
126 struct xen_sysctl_perfc_desc {
127     char         name[80];             /* name of perf counter */
128     uint32_t     nr_vals;              /* number of values for this counter */
129 };
130 typedef struct xen_sysctl_perfc_desc xen_sysctl_perfc_desc_t;
131 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t);
132 typedef uint32_t xen_sysctl_perfc_val_t;
133 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t);
134
135 struct xen_sysctl_perfc_op {
136     /* IN variables. */
137     uint32_t       cmd;                /*  XEN_SYSCTL_PERFCOP_??? */
138     /* OUT variables. */
139     uint32_t       nr_counters;       /*  number of counters description  */
140     uint32_t       nr_vals;           /*  number of values  */
141     /* counter information (or NULL) */
142     XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc;
143     /* counter values (or NULL) */
144     XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val;
145 };
146 typedef struct xen_sysctl_perfc_op xen_sysctl_perfc_op_t;
147 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_op_t);
148
149 /* XEN_SYSCTL_getdomaininfolist */
150 struct xen_sysctl_getdomaininfolist {
151     /* IN variables. */
152     domid_t               first_domain;
153     uint32_t              max_domains;
154     XEN_GUEST_HANDLE_64(xen_domctl_getdomaininfo_t) buffer;
155     /* OUT variables. */
156     uint32_t              num_domains;
157 };
158 typedef struct xen_sysctl_getdomaininfolist xen_sysctl_getdomaininfolist_t;
159 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getdomaininfolist_t);
160
161 /* Inject debug keys into Xen. */
162 /* XEN_SYSCTL_debug_keys */
163 struct xen_sysctl_debug_keys {
164     /* IN variables. */
165     XEN_GUEST_HANDLE_64(char) keys;
166     uint32_t nr_keys;
167 };
168 typedef struct xen_sysctl_debug_keys xen_sysctl_debug_keys_t;
169 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_debug_keys_t);
170
171 /* Get physical CPU information. */
172 /* XEN_SYSCTL_getcpuinfo */
173 struct xen_sysctl_cpuinfo {
174     uint64_aligned_t idletime;
175 };
176 typedef struct xen_sysctl_cpuinfo xen_sysctl_cpuinfo_t;
177 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpuinfo_t); 
178 struct xen_sysctl_getcpuinfo {
179     /* IN variables. */
180     uint32_t max_cpus;
181     XEN_GUEST_HANDLE_64(xen_sysctl_cpuinfo_t) info;
182     /* OUT variables. */
183     uint32_t nr_cpus;
184 }; 
185 typedef struct xen_sysctl_getcpuinfo xen_sysctl_getcpuinfo_t;
186 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getcpuinfo_t); 
187
188 /* XEN_SYSCTL_availheap */
189 struct xen_sysctl_availheap {
190     /* IN variables. */
191     uint32_t min_bitwidth;  /* Smallest address width (zero if don't care). */
192     uint32_t max_bitwidth;  /* Largest address width (zero if don't care). */
193     int32_t  node;          /* NUMA node of interest (-1 for all nodes). */
194     /* OUT variables. */
195     uint64_aligned_t avail_bytes;/* Bytes available in the specified region. */
196 };
197 typedef struct xen_sysctl_availheap xen_sysctl_availheap_t;
198 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_availheap_t);
199
200 /* XEN_SYSCTL_get_pmstat */
201 struct pm_px_val {
202     uint64_aligned_t freq;        /* Px core frequency */
203     uint64_aligned_t residency;   /* Px residency time */
204     uint64_aligned_t count;       /* Px transition count */
205 };
206 typedef struct pm_px_val pm_px_val_t;
207 DEFINE_XEN_GUEST_HANDLE(pm_px_val_t);
208
209 struct pm_px_stat {
210     uint8_t total;        /* total Px states */
211     uint8_t usable;       /* usable Px states */
212     uint8_t last;         /* last Px state */
213     uint8_t cur;          /* current Px state */
214     XEN_GUEST_HANDLE_64(uint64) trans_pt;   /* Px transition table */
215     XEN_GUEST_HANDLE_64(pm_px_val_t) pt;
216 };
217 typedef struct pm_px_stat pm_px_stat_t;
218 DEFINE_XEN_GUEST_HANDLE(pm_px_stat_t);
219
220 struct pm_cx_stat {
221     uint32_t nr;    /* entry nr in triggers & residencies, including C0 */
222     uint32_t last;  /* last Cx state */
223     uint64_aligned_t idle_time;                 /* idle time from boot */
224     XEN_GUEST_HANDLE_64(uint64) triggers;    /* Cx trigger counts */
225     XEN_GUEST_HANDLE_64(uint64) residencies; /* Cx residencies */
226 };
227
228 struct xen_sysctl_get_pmstat {
229 #define PMSTAT_CATEGORY_MASK 0xf0
230 #define PMSTAT_PX            0x10
231 #define PMSTAT_CX            0x20
232 #define PMSTAT_get_max_px    (PMSTAT_PX | 0x1)
233 #define PMSTAT_get_pxstat    (PMSTAT_PX | 0x2)
234 #define PMSTAT_reset_pxstat  (PMSTAT_PX | 0x3)
235 #define PMSTAT_get_max_cx    (PMSTAT_CX | 0x1)
236 #define PMSTAT_get_cxstat    (PMSTAT_CX | 0x2)
237 #define PMSTAT_reset_cxstat  (PMSTAT_CX | 0x3)
238     uint32_t type;
239     uint32_t cpuid;
240     union {
241         struct pm_px_stat getpx;
242         struct pm_cx_stat getcx;
243         /* other struct for tx, etc */
244     } u;
245 };
246 typedef struct xen_sysctl_get_pmstat xen_sysctl_get_pmstat_t;
247 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_get_pmstat_t);
248
249 /*
250  * Status codes. Must be greater than 0 to avoid confusing
251  * sysctl callers that see 0 as a plain successful return.
252  */
253 #define XEN_CPU_HOTPLUG_STATUS_OFFLINE 1
254 #define XEN_CPU_HOTPLUG_STATUS_ONLINE  2
255 #define XEN_CPU_HOTPLUG_STATUS_NEW     3
256
257 /* XEN_SYSCTL_cpu_hotplug */
258 struct xen_sysctl_cpu_hotplug {
259     /* IN variables */
260     uint32_t cpu;   /* Physical cpu. */
261 #define XEN_SYSCTL_CPU_HOTPLUG_ONLINE  0
262 #define XEN_SYSCTL_CPU_HOTPLUG_OFFLINE 1
263 #define XEN_SYSCTL_CPU_HOTPLUG_STATUS 2
264     uint32_t op;    /* hotplug opcode */
265 };
266 typedef struct xen_sysctl_cpu_hotplug xen_sysctl_cpu_hotplug_t;
267 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpu_hotplug_t);
268
269 /*
270  * Get/set xen power management, include 
271  * 1. cpufreq governors and related parameters
272  */
273 /* XEN_SYSCTL_pm_op */
274 struct xen_userspace {
275     uint32_t scaling_setspeed;
276 };
277 typedef struct xen_userspace xen_userspace_t;
278
279 struct xen_ondemand {
280     uint32_t sampling_rate_max;
281     uint32_t sampling_rate_min;
282
283     uint32_t sampling_rate;
284     uint32_t up_threshold;
285 };
286 typedef struct xen_ondemand xen_ondemand_t;
287
288 /* 
289  * cpufreq para name of this structure named 
290  * same as sysfs file name of native linux
291  */
292 #define CPUFREQ_NAME_LEN 16
293 struct xen_get_cpufreq_para {
294     /* IN/OUT variable */
295     uint32_t cpu_num;
296     uint32_t freq_num;
297     uint32_t gov_num;
298
299     /* for all governors */
300     /* OUT variable */
301     XEN_GUEST_HANDLE_64(uint32) affected_cpus;
302     XEN_GUEST_HANDLE_64(uint32) scaling_available_frequencies;
303     XEN_GUEST_HANDLE_64(char)   scaling_available_governors;
304     char scaling_driver[CPUFREQ_NAME_LEN];
305
306     uint32_t cpuinfo_cur_freq;
307     uint32_t cpuinfo_max_freq;
308     uint32_t cpuinfo_min_freq;
309     uint32_t scaling_cur_freq;
310
311     char scaling_governor[CPUFREQ_NAME_LEN];
312     uint32_t scaling_max_freq;
313     uint32_t scaling_min_freq;
314
315     /* for specific governor */
316     union {
317         struct  xen_userspace userspace;
318         struct  xen_ondemand ondemand;
319     } u;
320
321     int32_t turbo_enabled;
322 };
323
324 struct xen_set_cpufreq_gov {
325     char scaling_governor[CPUFREQ_NAME_LEN];
326 };
327
328 struct xen_set_cpufreq_para {
329     #define SCALING_MAX_FREQ           1
330     #define SCALING_MIN_FREQ           2
331     #define SCALING_SETSPEED           3
332     #define SAMPLING_RATE              4
333     #define UP_THRESHOLD               5
334
335     uint32_t ctrl_type;
336     uint32_t ctrl_value;
337 };
338
339 struct xen_sysctl_pm_op {
340     #define PM_PARA_CATEGORY_MASK      0xf0
341     #define CPUFREQ_PARA               0x10
342
343     /* cpufreq command type */
344     #define GET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x01)
345     #define SET_CPUFREQ_GOV            (CPUFREQ_PARA | 0x02)
346     #define SET_CPUFREQ_PARA           (CPUFREQ_PARA | 0x03)
347     #define GET_CPUFREQ_AVGFREQ        (CPUFREQ_PARA | 0x04)
348
349     /* set/reset scheduler power saving option */
350     #define XEN_SYSCTL_pm_op_set_sched_opt_smt    0x21
351
352     /* cpuidle max_cstate access command */
353     #define XEN_SYSCTL_pm_op_get_max_cstate       0x22
354     #define XEN_SYSCTL_pm_op_set_max_cstate       0x23
355
356     /* set scheduler migration cost value */
357     #define XEN_SYSCTL_pm_op_set_vcpu_migration_delay   0x24
358     #define XEN_SYSCTL_pm_op_get_vcpu_migration_delay   0x25
359
360     /* enable/disable turbo mode when in dbs governor */
361     #define XEN_SYSCTL_pm_op_enable_turbo               0x26
362     #define XEN_SYSCTL_pm_op_disable_turbo              0x27
363
364     uint32_t cmd;
365     uint32_t cpuid;
366     union {
367         struct xen_get_cpufreq_para get_para;
368         struct xen_set_cpufreq_gov  set_gov;
369         struct xen_set_cpufreq_para set_para;
370         uint64_aligned_t get_avgfreq;
371         uint32_t                    set_sched_opt_smt;
372         uint32_t                    get_max_cstate;
373         uint32_t                    set_max_cstate;
374         uint32_t                    get_vcpu_migration_delay;
375         uint32_t                    set_vcpu_migration_delay;
376     } u;
377 };
378
379 /* XEN_SYSCTL_page_offline_op */
380 struct xen_sysctl_page_offline_op {
381     /* IN: range of page to be offlined */
382 #define sysctl_page_offline     1
383 #define sysctl_page_online      2
384 #define sysctl_query_page_offline  3
385     uint32_t cmd;
386     uint32_t start;
387     uint32_t end;
388     /* OUT: result of page offline request */
389     /*
390      * bit 0~15: result flags
391      * bit 16~31: owner
392      */
393     XEN_GUEST_HANDLE(uint32) status;
394 };
395
396 #define PG_OFFLINE_STATUS_MASK    (0xFFUL)
397
398 /* The result is invalid, i.e. HV does not handle it */
399 #define PG_OFFLINE_INVALID   (0x1UL << 0)
400
401 #define PG_OFFLINE_OFFLINED  (0x1UL << 1)
402 #define PG_OFFLINE_PENDING   (0x1UL << 2)
403 #define PG_OFFLINE_FAILED    (0x1UL << 3)
404
405 #define PG_ONLINE_FAILED     PG_OFFLINE_FAILED
406 #define PG_ONLINE_ONLINED    PG_OFFLINE_OFFLINED
407
408 #define PG_OFFLINE_STATUS_OFFLINED              (0x1UL << 1)
409 #define PG_OFFLINE_STATUS_ONLINE                (0x1UL << 2)
410 #define PG_OFFLINE_STATUS_OFFLINE_PENDING       (0x1UL << 3)
411 #define PG_OFFLINE_STATUS_BROKEN                (0x1UL << 4)
412
413 #define PG_OFFLINE_MISC_MASK    (0xFFUL << 4)
414
415 /* only valid when PG_OFFLINE_FAILED */
416 #define PG_OFFLINE_XENPAGE   (0x1UL << 8)
417 #define PG_OFFLINE_DOM0PAGE  (0x1UL << 9)
418 #define PG_OFFLINE_ANONYMOUS (0x1UL << 10)
419 #define PG_OFFLINE_NOT_CONV_RAM   (0x1UL << 11)
420 #define PG_OFFLINE_OWNED     (0x1UL << 12)
421
422 #define PG_OFFLINE_BROKEN    (0x1UL << 13)
423 #define PG_ONLINE_BROKEN     PG_OFFLINE_BROKEN
424
425 #define PG_OFFLINE_OWNER_SHIFT 16
426
427 /* XEN_SYSCTL_lockprof_op */
428 /* Sub-operations: */
429 #define XEN_SYSCTL_LOCKPROF_reset 1   /* Reset all profile data to zero. */
430 #define XEN_SYSCTL_LOCKPROF_query 2   /* Get lock profile information. */
431 /* Record-type: */
432 #define LOCKPROF_TYPE_GLOBAL      0   /* global lock, idx meaningless */
433 #define LOCKPROF_TYPE_PERDOM      1   /* per-domain lock, idx is domid */
434 #define LOCKPROF_TYPE_N           2   /* number of types */
435 struct xen_sysctl_lockprof_data {
436     char     name[40];     /* lock name (may include up to 2 %d specifiers) */
437     int32_t  type;         /* LOCKPROF_TYPE_??? */
438     int32_t  idx;          /* index (e.g. domain id) */
439     uint64_aligned_t lock_cnt;     /* # of locking succeeded */
440     uint64_aligned_t block_cnt;    /* # of wait for lock */
441     uint64_aligned_t lock_time;    /* nsecs lock held */
442     uint64_aligned_t block_time;   /* nsecs waited for lock */
443 };
444 typedef struct xen_sysctl_lockprof_data xen_sysctl_lockprof_data_t;
445 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_lockprof_data_t);
446 struct xen_sysctl_lockprof_op {
447     /* IN variables. */
448     uint32_t       cmd;               /* XEN_SYSCTL_LOCKPROF_??? */
449     uint32_t       max_elem;          /* size of output buffer */
450     /* OUT variables (query only). */
451     uint32_t       nr_elem;           /* number of elements available */
452     uint64_aligned_t time;            /* nsecs of profile measurement */
453     /* profile information (or NULL) */
454     XEN_GUEST_HANDLE_64(xen_sysctl_lockprof_data_t) data;
455 };
456 typedef struct xen_sysctl_lockprof_op xen_sysctl_lockprof_op_t;
457 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_lockprof_op_t);
458
459 /* XEN_SYSCTL_topologyinfo */
460 #define INVALID_TOPOLOGY_ID  (~0U)
461 struct xen_sysctl_topologyinfo {
462     /*
463      * IN: maximum addressable entry in the caller-provided arrays.
464      * OUT: largest cpu identifier in the system.
465      * If OUT is greater than IN then the arrays are truncated!
466      */
467     uint32_t max_cpu_index;
468
469     /*
470      * If not NULL, this array is filled with core/socket/node identifier for 
471      * each cpu.
472      * If a cpu has no core/socket/node information (e.g., cpu not present) 
473      * then the sentinel value ~0u is written.
474      * The size of this array is specified by the caller in @max_cpu_index.
475      * If the actual @max_cpu_index is smaller than the array then the trailing
476      * elements of the array will not be written by the sysctl.
477      */
478     XEN_GUEST_HANDLE_64(uint32) cpu_to_core;
479     XEN_GUEST_HANDLE_64(uint32) cpu_to_socket;
480     XEN_GUEST_HANDLE_64(uint32) cpu_to_node;
481 };
482 typedef struct xen_sysctl_topologyinfo xen_sysctl_topologyinfo_t;
483 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_topologyinfo_t);
484
485 /* XEN_SYSCTL_numainfo */
486 struct xen_sysctl_numainfo {
487     /*
488      * IN: maximum addressable entry in the caller-provided arrays.
489      * OUT: largest node identifier in the system.
490      * If OUT is greater than IN then the arrays are truncated!
491      */
492     uint32_t max_node_index;
493
494     /* NB. Entries are 0 if node is not present. */
495     XEN_GUEST_HANDLE_64(uint64) node_to_memsize;
496     XEN_GUEST_HANDLE_64(uint64) node_to_memfree;
497
498     /*
499      * Array, of size (max_node_index+1)^2, listing memory access distances
500      * between nodes. If an entry has no node distance information (e.g., node 
501      * not present) then the value ~0u is written.
502      * 
503      * Note that the array rows must be indexed by multiplying by the minimum 
504      * of the caller-provided max_node_index and the returned value of
505      * max_node_index. That is, if the largest node index in the system is
506      * smaller than the caller can handle, a smaller 2-d array is constructed
507      * within the space provided by the caller. When this occurs, trailing
508      * space provided by the caller is not modified. If the largest node index
509      * in the system is larger than the caller can handle, then a 2-d array of
510      * the maximum size handleable by the caller is constructed.
511      */
512     XEN_GUEST_HANDLE_64(uint32) node_to_node_distance;
513 };
514 typedef struct xen_sysctl_numainfo xen_sysctl_numainfo_t;
515 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_numainfo_t);
516
517 /* XEN_SYSCTL_cpupool_op */
518 #define XEN_SYSCTL_CPUPOOL_OP_CREATE                1  /* C */
519 #define XEN_SYSCTL_CPUPOOL_OP_DESTROY               2  /* D */
520 #define XEN_SYSCTL_CPUPOOL_OP_INFO                  3  /* I */
521 #define XEN_SYSCTL_CPUPOOL_OP_ADDCPU                4  /* A */
522 #define XEN_SYSCTL_CPUPOOL_OP_RMCPU                 5  /* R */
523 #define XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN            6  /* M */
524 #define XEN_SYSCTL_CPUPOOL_OP_FREEINFO              7  /* F */
525 #define XEN_SYSCTL_CPUPOOL_PAR_ANY     0xFFFFFFFF
526 struct xen_sysctl_cpupool_op {
527     uint32_t op;          /* IN */
528     uint32_t cpupool_id;  /* IN: CDIARM OUT: CI */
529     uint32_t sched_id;    /* IN: C      OUT: I  */
530     uint32_t domid;       /* IN: M              */
531     uint32_t cpu;         /* IN: AR             */
532     uint32_t n_dom;       /*            OUT: I  */
533     struct xenctl_cpumap cpumap; /*     OUT: IF */
534 };
535 typedef struct xen_sysctl_cpupool_op xen_sysctl_cpupool_op_t;
536 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpupool_op_t);
537
538 /* XEN_SYSCTL_scheduler_op */
539 /* Set or get info? */
540 #define XEN_SYSCTL_SCHEDOP_putinfo 0
541 #define XEN_SYSCTL_SCHEDOP_getinfo 1
542 struct xen_sysctl_scheduler_op {
543     uint32_t sched_id;  /* XEN_SCHEDULER_* (domctl.h) */
544     uint32_t cmd;       /* XEN_SYSCTL_SCHEDOP_* */
545     union {
546     } u;
547 };
548 typedef struct xen_sysctl_scheduler_op xen_sysctl_scheduler_op_t;
549 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_scheduler_op_t);
550
551 struct xen_sysctl {
552     uint32_t cmd;
553 #define XEN_SYSCTL_readconsole                    1
554 #define XEN_SYSCTL_tbuf_op                        2
555 #define XEN_SYSCTL_physinfo                       3
556 #define XEN_SYSCTL_sched_id                       4
557 #define XEN_SYSCTL_perfc_op                       5
558 #define XEN_SYSCTL_getdomaininfolist              6
559 #define XEN_SYSCTL_debug_keys                     7
560 #define XEN_SYSCTL_getcpuinfo                     8
561 #define XEN_SYSCTL_availheap                      9
562 #define XEN_SYSCTL_get_pmstat                    10
563 #define XEN_SYSCTL_cpu_hotplug                   11
564 #define XEN_SYSCTL_pm_op                         12
565 #define XEN_SYSCTL_page_offline_op               14
566 #define XEN_SYSCTL_lockprof_op                   15
567 #define XEN_SYSCTL_topologyinfo                  16 
568 #define XEN_SYSCTL_numainfo                      17
569 #define XEN_SYSCTL_cpupool_op                    18
570 #define XEN_SYSCTL_scheduler_op                  19
571     uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
572     union {
573         struct xen_sysctl_readconsole       readconsole;
574         struct xen_sysctl_tbuf_op           tbuf_op;
575         struct xen_sysctl_physinfo          physinfo;
576         struct xen_sysctl_topologyinfo      topologyinfo;
577         struct xen_sysctl_numainfo          numainfo;
578         struct xen_sysctl_sched_id          sched_id;
579         struct xen_sysctl_perfc_op          perfc_op;
580         struct xen_sysctl_getdomaininfolist getdomaininfolist;
581         struct xen_sysctl_debug_keys        debug_keys;
582         struct xen_sysctl_getcpuinfo        getcpuinfo;
583         struct xen_sysctl_availheap         availheap;
584         struct xen_sysctl_get_pmstat        get_pmstat;
585         struct xen_sysctl_cpu_hotplug       cpu_hotplug;
586         struct xen_sysctl_pm_op             pm_op;
587         struct xen_sysctl_page_offline_op   page_offline;
588         struct xen_sysctl_lockprof_op       lockprof_op;
589         struct xen_sysctl_cpupool_op        cpupool_op;
590         struct xen_sysctl_scheduler_op      scheduler_op;
591         uint8_t                             pad[128];
592     } u;
593 };
594 typedef struct xen_sysctl xen_sysctl_t;
595 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_t);
596
597 #endif /* __XEN_PUBLIC_SYSCTL_H__ */
598
599 /*
600  * Local variables:
601  * mode: C
602  * c-set-style: "BSD"
603  * c-basic-offset: 4
604  * tab-width: 4
605  * indent-tabs-mode: nil
606  * End:
607  */