1 /******************************************************************************
4 * System management operations. For use by node control stack.
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:
13 * The above copyright notice and this permission notice shall be included in
14 * all copies or substantial portions of the Software.
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.
24 * Copyright (c) 2002-2006, K Fraser
27 #ifndef __XEN_PUBLIC_SYSCTL_H__
28 #define __XEN_PUBLIC_SYSCTL_H__
30 #if !defined(__XEN__) && !defined(__XEN_TOOLS__)
31 #error "sysctl operations are intended for use by node control tools only"
37 #define XEN_SYSCTL_INTERFACE_VERSION 0x0000000A
40 * Read console content from Xen buffer ring.
42 /* XEN_SYSCTL_readconsole */
43 struct xen_sysctl_readconsole {
44 /* IN: Non-zero -> clear after reading. */
46 /* IN: Non-zero -> start index specified by @index field. */
50 * IN: Start index for consuming from ring buffer (if @incremental);
51 * OUT: End index after consuming from ring buffer.
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. */
59 typedef struct xen_sysctl_readconsole xen_sysctl_readconsole_t;
60 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_readconsole_t);
62 /* Get trace buffers machine base address */
63 /* XEN_SYSCTL_tbuf_op */
64 struct xen_sysctl_tbuf_op {
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
73 /* IN/OUT variables */
74 struct xenctl_bitmap cpu_mask;
77 uint64_aligned_t buffer_mfn;
78 uint32_t size; /* Also an IN variable! */
80 typedef struct xen_sysctl_tbuf_op xen_sysctl_tbuf_op_t;
81 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_tbuf_op_t);
84 * Get physical information about the host machine
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; /* # CPUs currently online */
97 uint32_t max_cpu_id; /* Largest possible CPU ID on this host */
98 uint32_t nr_nodes; /* # nodes currently online */
99 uint32_t max_node_id; /* Largest possible node ID on this host */
101 uint64_aligned_t total_pages;
102 uint64_aligned_t free_pages;
103 uint64_aligned_t scrub_pages;
104 uint64_aligned_t outstanding_pages;
107 /* XEN_SYSCTL_PHYSCAP_??? */
108 uint32_t capabilities;
110 typedef struct xen_sysctl_physinfo xen_sysctl_physinfo_t;
111 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_physinfo_t);
114 * Get the ID of the current scheduler.
116 /* XEN_SYSCTL_sched_id */
117 struct xen_sysctl_sched_id {
121 typedef struct xen_sysctl_sched_id xen_sysctl_sched_id_t;
122 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_sched_id_t);
124 /* Interface for controlling Xen software performance counters. */
125 /* XEN_SYSCTL_perfc_op */
126 /* Sub-operations: */
127 #define XEN_SYSCTL_PERFCOP_reset 1 /* Reset all counters to zero. */
128 #define XEN_SYSCTL_PERFCOP_query 2 /* Get perfctr information. */
129 struct xen_sysctl_perfc_desc {
130 char name[80]; /* name of perf counter */
131 uint32_t nr_vals; /* number of values for this counter */
133 typedef struct xen_sysctl_perfc_desc xen_sysctl_perfc_desc_t;
134 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t);
135 typedef uint32_t xen_sysctl_perfc_val_t;
136 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t);
138 struct xen_sysctl_perfc_op {
140 uint32_t cmd; /* XEN_SYSCTL_PERFCOP_??? */
142 uint32_t nr_counters; /* number of counters description */
143 uint32_t nr_vals; /* number of values */
144 /* counter information (or NULL) */
145 XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc;
146 /* counter values (or NULL) */
147 XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val;
149 typedef struct xen_sysctl_perfc_op xen_sysctl_perfc_op_t;
150 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_op_t);
152 /* XEN_SYSCTL_getdomaininfolist */
153 struct xen_sysctl_getdomaininfolist {
155 domid_t first_domain;
156 uint32_t max_domains;
157 XEN_GUEST_HANDLE_64(xen_domctl_getdomaininfo_t) buffer;
159 uint32_t num_domains;
161 typedef struct xen_sysctl_getdomaininfolist xen_sysctl_getdomaininfolist_t;
162 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getdomaininfolist_t);
164 /* Inject debug keys into Xen. */
165 /* XEN_SYSCTL_debug_keys */
166 struct xen_sysctl_debug_keys {
168 XEN_GUEST_HANDLE_64(char) keys;
171 typedef struct xen_sysctl_debug_keys xen_sysctl_debug_keys_t;
172 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_debug_keys_t);
174 /* Get physical CPU information. */
175 /* XEN_SYSCTL_getcpuinfo */
176 struct xen_sysctl_cpuinfo {
177 uint64_aligned_t idletime;
179 typedef struct xen_sysctl_cpuinfo xen_sysctl_cpuinfo_t;
180 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpuinfo_t);
181 struct xen_sysctl_getcpuinfo {
184 XEN_GUEST_HANDLE_64(xen_sysctl_cpuinfo_t) info;
188 typedef struct xen_sysctl_getcpuinfo xen_sysctl_getcpuinfo_t;
189 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getcpuinfo_t);
191 /* XEN_SYSCTL_availheap */
192 struct xen_sysctl_availheap {
194 uint32_t min_bitwidth; /* Smallest address width (zero if don't care). */
195 uint32_t max_bitwidth; /* Largest address width (zero if don't care). */
196 int32_t node; /* NUMA node of interest (-1 for all nodes). */
198 uint64_aligned_t avail_bytes;/* Bytes available in the specified region. */
200 typedef struct xen_sysctl_availheap xen_sysctl_availheap_t;
201 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_availheap_t);
203 /* XEN_SYSCTL_get_pmstat */
205 uint64_aligned_t freq; /* Px core frequency */
206 uint64_aligned_t residency; /* Px residency time */
207 uint64_aligned_t count; /* Px transition count */
209 typedef struct pm_px_val pm_px_val_t;
210 DEFINE_XEN_GUEST_HANDLE(pm_px_val_t);
213 uint8_t total; /* total Px states */
214 uint8_t usable; /* usable Px states */
215 uint8_t last; /* last Px state */
216 uint8_t cur; /* current Px state */
217 XEN_GUEST_HANDLE_64(uint64) trans_pt; /* Px transition table */
218 XEN_GUEST_HANDLE_64(pm_px_val_t) pt;
220 typedef struct pm_px_stat pm_px_stat_t;
221 DEFINE_XEN_GUEST_HANDLE(pm_px_stat_t);
224 uint32_t nr; /* entry nr in triggers & residencies, including C0 */
225 uint32_t last; /* last Cx state */
226 uint64_aligned_t idle_time; /* idle time from boot */
227 XEN_GUEST_HANDLE_64(uint64) triggers; /* Cx trigger counts */
228 XEN_GUEST_HANDLE_64(uint64) residencies; /* Cx residencies */
229 uint64_aligned_t pc2;
230 uint64_aligned_t pc3;
231 uint64_aligned_t pc6;
232 uint64_aligned_t pc7;
233 uint64_aligned_t cc3;
234 uint64_aligned_t cc6;
235 uint64_aligned_t cc7;
238 struct xen_sysctl_get_pmstat {
239 #define PMSTAT_CATEGORY_MASK 0xf0
240 #define PMSTAT_PX 0x10
241 #define PMSTAT_CX 0x20
242 #define PMSTAT_get_max_px (PMSTAT_PX | 0x1)
243 #define PMSTAT_get_pxstat (PMSTAT_PX | 0x2)
244 #define PMSTAT_reset_pxstat (PMSTAT_PX | 0x3)
245 #define PMSTAT_get_max_cx (PMSTAT_CX | 0x1)
246 #define PMSTAT_get_cxstat (PMSTAT_CX | 0x2)
247 #define PMSTAT_reset_cxstat (PMSTAT_CX | 0x3)
251 struct pm_px_stat getpx;
252 struct pm_cx_stat getcx;
253 /* other struct for tx, etc */
256 typedef struct xen_sysctl_get_pmstat xen_sysctl_get_pmstat_t;
257 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_get_pmstat_t);
259 /* XEN_SYSCTL_cpu_hotplug */
260 struct xen_sysctl_cpu_hotplug {
262 uint32_t cpu; /* Physical cpu. */
263 #define XEN_SYSCTL_CPU_HOTPLUG_ONLINE 0
264 #define XEN_SYSCTL_CPU_HOTPLUG_OFFLINE 1
265 uint32_t op; /* hotplug opcode */
267 typedef struct xen_sysctl_cpu_hotplug xen_sysctl_cpu_hotplug_t;
268 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpu_hotplug_t);
271 * Get/set xen power management, include
272 * 1. cpufreq governors and related parameters
274 /* XEN_SYSCTL_pm_op */
275 struct xen_userspace {
276 uint32_t scaling_setspeed;
278 typedef struct xen_userspace xen_userspace_t;
280 struct xen_ondemand {
281 uint32_t sampling_rate_max;
282 uint32_t sampling_rate_min;
284 uint32_t sampling_rate;
285 uint32_t up_threshold;
287 typedef struct xen_ondemand xen_ondemand_t;
290 * cpufreq para name of this structure named
291 * same as sysfs file name of native linux
293 #define CPUFREQ_NAME_LEN 16
294 struct xen_get_cpufreq_para {
295 /* IN/OUT variable */
300 /* for all governors */
302 XEN_GUEST_HANDLE_64(uint32) affected_cpus;
303 XEN_GUEST_HANDLE_64(uint32) scaling_available_frequencies;
304 XEN_GUEST_HANDLE_64(char) scaling_available_governors;
305 char scaling_driver[CPUFREQ_NAME_LEN];
307 uint32_t cpuinfo_cur_freq;
308 uint32_t cpuinfo_max_freq;
309 uint32_t cpuinfo_min_freq;
310 uint32_t scaling_cur_freq;
312 char scaling_governor[CPUFREQ_NAME_LEN];
313 uint32_t scaling_max_freq;
314 uint32_t scaling_min_freq;
316 /* for specific governor */
318 struct xen_userspace userspace;
319 struct xen_ondemand ondemand;
322 int32_t turbo_enabled;
325 struct xen_set_cpufreq_gov {
326 char scaling_governor[CPUFREQ_NAME_LEN];
329 struct xen_set_cpufreq_para {
330 #define SCALING_MAX_FREQ 1
331 #define SCALING_MIN_FREQ 2
332 #define SCALING_SETSPEED 3
333 #define SAMPLING_RATE 4
334 #define UP_THRESHOLD 5
340 struct xen_sysctl_pm_op {
341 #define PM_PARA_CATEGORY_MASK 0xf0
342 #define CPUFREQ_PARA 0x10
344 /* cpufreq command type */
345 #define GET_CPUFREQ_PARA (CPUFREQ_PARA | 0x01)
346 #define SET_CPUFREQ_GOV (CPUFREQ_PARA | 0x02)
347 #define SET_CPUFREQ_PARA (CPUFREQ_PARA | 0x03)
348 #define GET_CPUFREQ_AVGFREQ (CPUFREQ_PARA | 0x04)
350 /* set/reset scheduler power saving option */
351 #define XEN_SYSCTL_pm_op_set_sched_opt_smt 0x21
353 /* cpuidle max_cstate access command */
354 #define XEN_SYSCTL_pm_op_get_max_cstate 0x22
355 #define XEN_SYSCTL_pm_op_set_max_cstate 0x23
357 /* set scheduler migration cost value */
358 #define XEN_SYSCTL_pm_op_set_vcpu_migration_delay 0x24
359 #define XEN_SYSCTL_pm_op_get_vcpu_migration_delay 0x25
361 /* enable/disable turbo mode when in dbs governor */
362 #define XEN_SYSCTL_pm_op_enable_turbo 0x26
363 #define XEN_SYSCTL_pm_op_disable_turbo 0x27
368 struct xen_get_cpufreq_para get_para;
369 struct xen_set_cpufreq_gov set_gov;
370 struct xen_set_cpufreq_para set_para;
371 uint64_aligned_t get_avgfreq;
372 uint32_t set_sched_opt_smt;
373 uint32_t get_max_cstate;
374 uint32_t set_max_cstate;
375 uint32_t get_vcpu_migration_delay;
376 uint32_t set_vcpu_migration_delay;
380 /* XEN_SYSCTL_page_offline_op */
381 struct xen_sysctl_page_offline_op {
382 /* IN: range of page to be offlined */
383 #define sysctl_page_offline 1
384 #define sysctl_page_online 2
385 #define sysctl_query_page_offline 3
389 /* OUT: result of page offline request */
391 * bit 0~15: result flags
394 XEN_GUEST_HANDLE(uint32) status;
397 #define PG_OFFLINE_STATUS_MASK (0xFFUL)
399 /* The result is invalid, i.e. HV does not handle it */
400 #define PG_OFFLINE_INVALID (0x1UL << 0)
402 #define PG_OFFLINE_OFFLINED (0x1UL << 1)
403 #define PG_OFFLINE_PENDING (0x1UL << 2)
404 #define PG_OFFLINE_FAILED (0x1UL << 3)
405 #define PG_OFFLINE_AGAIN (0x1UL << 4)
407 #define PG_ONLINE_FAILED PG_OFFLINE_FAILED
408 #define PG_ONLINE_ONLINED PG_OFFLINE_OFFLINED
410 #define PG_OFFLINE_STATUS_OFFLINED (0x1UL << 1)
411 #define PG_OFFLINE_STATUS_ONLINE (0x1UL << 2)
412 #define PG_OFFLINE_STATUS_OFFLINE_PENDING (0x1UL << 3)
413 #define PG_OFFLINE_STATUS_BROKEN (0x1UL << 4)
415 #define PG_OFFLINE_MISC_MASK (0xFFUL << 4)
417 /* valid when PG_OFFLINE_FAILED or PG_OFFLINE_PENDING */
418 #define PG_OFFLINE_XENPAGE (0x1UL << 8)
419 #define PG_OFFLINE_DOM0PAGE (0x1UL << 9)
420 #define PG_OFFLINE_ANONYMOUS (0x1UL << 10)
421 #define PG_OFFLINE_NOT_CONV_RAM (0x1UL << 11)
422 #define PG_OFFLINE_OWNED (0x1UL << 12)
424 #define PG_OFFLINE_BROKEN (0x1UL << 13)
425 #define PG_ONLINE_BROKEN PG_OFFLINE_BROKEN
427 #define PG_OFFLINE_OWNER_SHIFT 16
429 /* XEN_SYSCTL_lockprof_op */
430 /* Sub-operations: */
431 #define XEN_SYSCTL_LOCKPROF_reset 1 /* Reset all profile data to zero. */
432 #define XEN_SYSCTL_LOCKPROF_query 2 /* Get lock profile information. */
434 #define LOCKPROF_TYPE_GLOBAL 0 /* global lock, idx meaningless */
435 #define LOCKPROF_TYPE_PERDOM 1 /* per-domain lock, idx is domid */
436 #define LOCKPROF_TYPE_N 2 /* number of types */
437 struct xen_sysctl_lockprof_data {
438 char name[40]; /* lock name (may include up to 2 %d specifiers) */
439 int32_t type; /* LOCKPROF_TYPE_??? */
440 int32_t idx; /* index (e.g. domain id) */
441 uint64_aligned_t lock_cnt; /* # of locking succeeded */
442 uint64_aligned_t block_cnt; /* # of wait for lock */
443 uint64_aligned_t lock_time; /* nsecs lock held */
444 uint64_aligned_t block_time; /* nsecs waited for lock */
446 typedef struct xen_sysctl_lockprof_data xen_sysctl_lockprof_data_t;
447 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_lockprof_data_t);
448 struct xen_sysctl_lockprof_op {
450 uint32_t cmd; /* XEN_SYSCTL_LOCKPROF_??? */
451 uint32_t max_elem; /* size of output buffer */
452 /* OUT variables (query only). */
453 uint32_t nr_elem; /* number of elements available */
454 uint64_aligned_t time; /* nsecs of profile measurement */
455 /* profile information (or NULL) */
456 XEN_GUEST_HANDLE_64(xen_sysctl_lockprof_data_t) data;
458 typedef struct xen_sysctl_lockprof_op xen_sysctl_lockprof_op_t;
459 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_lockprof_op_t);
461 /* XEN_SYSCTL_topologyinfo */
462 #define INVALID_TOPOLOGY_ID (~0U)
463 struct xen_sysctl_topologyinfo {
465 * IN: maximum addressable entry in the caller-provided arrays.
466 * OUT: largest cpu identifier in the system.
467 * If OUT is greater than IN then the arrays are truncated!
468 * If OUT is leass than IN then the array tails are not written by sysctl.
470 uint32_t max_cpu_index;
473 * If not NULL, these arrays are filled with core/socket/node identifier
475 * If a cpu has no core/socket/node information (e.g., cpu not present)
476 * then the sentinel value ~0u is written to each array.
477 * The number of array elements written by the sysctl is:
478 * min(@max_cpu_index_IN,@max_cpu_index_OUT)+1
480 XEN_GUEST_HANDLE_64(uint32) cpu_to_core;
481 XEN_GUEST_HANDLE_64(uint32) cpu_to_socket;
482 XEN_GUEST_HANDLE_64(uint32) cpu_to_node;
484 typedef struct xen_sysctl_topologyinfo xen_sysctl_topologyinfo_t;
485 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_topologyinfo_t);
487 /* XEN_SYSCTL_numainfo */
488 #define INVALID_NUMAINFO_ID (~0U)
489 struct xen_sysctl_numainfo {
491 * IN: maximum addressable entry in the caller-provided arrays.
492 * OUT: largest node identifier in the system.
493 * If OUT is greater than IN then the arrays are truncated!
495 uint32_t max_node_index;
497 /* NB. Entries are 0 if node is not present. */
498 XEN_GUEST_HANDLE_64(uint64) node_to_memsize;
499 XEN_GUEST_HANDLE_64(uint64) node_to_memfree;
502 * Array, of size (max_node_index+1)^2, listing memory access distances
503 * between nodes. If an entry has no node distance information (e.g., node
504 * not present) then the value ~0u is written.
506 * Note that the array rows must be indexed by multiplying by the minimum
507 * of the caller-provided max_node_index and the returned value of
508 * max_node_index. That is, if the largest node index in the system is
509 * smaller than the caller can handle, a smaller 2-d array is constructed
510 * within the space provided by the caller. When this occurs, trailing
511 * space provided by the caller is not modified. If the largest node index
512 * in the system is larger than the caller can handle, then a 2-d array of
513 * the maximum size handleable by the caller is constructed.
515 XEN_GUEST_HANDLE_64(uint32) node_to_node_distance;
517 typedef struct xen_sysctl_numainfo xen_sysctl_numainfo_t;
518 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_numainfo_t);
520 /* XEN_SYSCTL_cpupool_op */
521 #define XEN_SYSCTL_CPUPOOL_OP_CREATE 1 /* C */
522 #define XEN_SYSCTL_CPUPOOL_OP_DESTROY 2 /* D */
523 #define XEN_SYSCTL_CPUPOOL_OP_INFO 3 /* I */
524 #define XEN_SYSCTL_CPUPOOL_OP_ADDCPU 4 /* A */
525 #define XEN_SYSCTL_CPUPOOL_OP_RMCPU 5 /* R */
526 #define XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN 6 /* M */
527 #define XEN_SYSCTL_CPUPOOL_OP_FREEINFO 7 /* F */
528 #define XEN_SYSCTL_CPUPOOL_PAR_ANY 0xFFFFFFFF
529 struct xen_sysctl_cpupool_op {
530 uint32_t op; /* IN */
531 uint32_t cpupool_id; /* IN: CDIARM OUT: CI */
532 uint32_t sched_id; /* IN: C OUT: I */
533 uint32_t domid; /* IN: M */
534 uint32_t cpu; /* IN: AR */
535 uint32_t n_dom; /* OUT: I */
536 struct xenctl_bitmap cpumap; /* OUT: IF */
538 typedef struct xen_sysctl_cpupool_op xen_sysctl_cpupool_op_t;
539 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpupool_op_t);
541 #define ARINC653_MAX_DOMAINS_PER_SCHEDULE 64
543 * This structure is used to pass a new ARINC653 schedule from a
544 * privileged domain (ie dom0) to Xen.
546 struct xen_sysctl_arinc653_schedule {
547 /* major_frame holds the time for the new schedule's major frame
549 uint64_aligned_t major_frame;
550 /* num_sched_entries holds how many of the entries in the
551 * sched_entries[] array are valid. */
552 uint8_t num_sched_entries;
553 /* The sched_entries array holds the actual schedule entries. */
555 /* dom_handle must match a domain's UUID */
556 xen_domain_handle_t dom_handle;
557 /* If a domain has multiple VCPUs, vcpu_id specifies which one
558 * this schedule entry applies to. It should be set to 0 if
559 * there is only one VCPU for the domain. */
560 unsigned int vcpu_id;
561 /* runtime specifies the amount of time that should be allocated
562 * to this VCPU per major frame. It is specified in nanoseconds */
563 uint64_aligned_t runtime;
564 } sched_entries[ARINC653_MAX_DOMAINS_PER_SCHEDULE];
566 typedef struct xen_sysctl_arinc653_schedule xen_sysctl_arinc653_schedule_t;
567 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_arinc653_schedule_t);
569 struct xen_sysctl_credit_schedule {
570 /* Length of timeslice in milliseconds */
571 #define XEN_SYSCTL_CSCHED_TSLICE_MAX 1000
572 #define XEN_SYSCTL_CSCHED_TSLICE_MIN 1
574 /* Rate limit (minimum timeslice) in microseconds */
575 #define XEN_SYSCTL_SCHED_RATELIMIT_MAX 500000
576 #define XEN_SYSCTL_SCHED_RATELIMIT_MIN 100
577 unsigned ratelimit_us;
579 typedef struct xen_sysctl_credit_schedule xen_sysctl_credit_schedule_t;
580 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_credit_schedule_t);
582 /* XEN_SYSCTL_scheduler_op */
583 /* Set or get info? */
584 #define XEN_SYSCTL_SCHEDOP_putinfo 0
585 #define XEN_SYSCTL_SCHEDOP_getinfo 1
586 struct xen_sysctl_scheduler_op {
587 uint32_t cpupool_id; /* Cpupool whose scheduler is to be targetted. */
588 uint32_t sched_id; /* XEN_SCHEDULER_* (domctl.h) */
589 uint32_t cmd; /* XEN_SYSCTL_SCHEDOP_* */
591 struct xen_sysctl_sched_arinc653 {
592 XEN_GUEST_HANDLE_64(xen_sysctl_arinc653_schedule_t) schedule;
594 struct xen_sysctl_credit_schedule sched_credit;
597 typedef struct xen_sysctl_scheduler_op xen_sysctl_scheduler_op_t;
598 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_scheduler_op_t);
600 /* XEN_SYSCTL_coverage_op */
602 * Get total size of information, to help allocate
603 * the buffer. The pointer points to a 32 bit value.
605 #define XEN_SYSCTL_COVERAGE_get_total_size 0
608 * Read coverage information in a single run
609 * You must use a tool to split them.
611 #define XEN_SYSCTL_COVERAGE_read 1
614 * Reset all the coverage counters to 0
617 #define XEN_SYSCTL_COVERAGE_reset 2
620 * Like XEN_SYSCTL_COVERAGE_read but reset also
621 * counters to 0 in a single call.
623 #define XEN_SYSCTL_COVERAGE_read_and_reset 3
625 struct xen_sysctl_coverage_op {
626 uint32_t cmd; /* XEN_SYSCTL_COVERAGE_* */
628 uint32_t total_size; /* OUT */
629 XEN_GUEST_HANDLE_64(uint8) raw_info; /* OUT */
632 typedef struct xen_sysctl_coverage_op xen_sysctl_coverage_op_t;
633 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_coverage_op_t);
638 #define XEN_SYSCTL_readconsole 1
639 #define XEN_SYSCTL_tbuf_op 2
640 #define XEN_SYSCTL_physinfo 3
641 #define XEN_SYSCTL_sched_id 4
642 #define XEN_SYSCTL_perfc_op 5
643 #define XEN_SYSCTL_getdomaininfolist 6
644 #define XEN_SYSCTL_debug_keys 7
645 #define XEN_SYSCTL_getcpuinfo 8
646 #define XEN_SYSCTL_availheap 9
647 #define XEN_SYSCTL_get_pmstat 10
648 #define XEN_SYSCTL_cpu_hotplug 11
649 #define XEN_SYSCTL_pm_op 12
650 #define XEN_SYSCTL_page_offline_op 14
651 #define XEN_SYSCTL_lockprof_op 15
652 #define XEN_SYSCTL_topologyinfo 16
653 #define XEN_SYSCTL_numainfo 17
654 #define XEN_SYSCTL_cpupool_op 18
655 #define XEN_SYSCTL_scheduler_op 19
656 #define XEN_SYSCTL_coverage_op 20
657 uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
659 struct xen_sysctl_readconsole readconsole;
660 struct xen_sysctl_tbuf_op tbuf_op;
661 struct xen_sysctl_physinfo physinfo;
662 struct xen_sysctl_topologyinfo topologyinfo;
663 struct xen_sysctl_numainfo numainfo;
664 struct xen_sysctl_sched_id sched_id;
665 struct xen_sysctl_perfc_op perfc_op;
666 struct xen_sysctl_getdomaininfolist getdomaininfolist;
667 struct xen_sysctl_debug_keys debug_keys;
668 struct xen_sysctl_getcpuinfo getcpuinfo;
669 struct xen_sysctl_availheap availheap;
670 struct xen_sysctl_get_pmstat get_pmstat;
671 struct xen_sysctl_cpu_hotplug cpu_hotplug;
672 struct xen_sysctl_pm_op pm_op;
673 struct xen_sysctl_page_offline_op page_offline;
674 struct xen_sysctl_lockprof_op lockprof_op;
675 struct xen_sysctl_cpupool_op cpupool_op;
676 struct xen_sysctl_scheduler_op scheduler_op;
677 struct xen_sysctl_coverage_op coverage_op;
681 typedef struct xen_sysctl xen_sysctl_t;
682 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_t);
684 #endif /* __XEN_PUBLIC_SYSCTL_H__ */
689 * c-file-style: "BSD"
692 * indent-tabs-mode: nil