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 0x00000009
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_cpumap 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;
106 /* XEN_SYSCTL_PHYSCAP_??? */
107 uint32_t capabilities;
109 typedef struct xen_sysctl_physinfo xen_sysctl_physinfo_t;
110 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_physinfo_t);
113 * Get the ID of the current scheduler.
115 /* XEN_SYSCTL_sched_id */
116 struct xen_sysctl_sched_id {
120 typedef struct xen_sysctl_sched_id xen_sysctl_sched_id_t;
121 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_sched_id_t);
123 /* Interface for controlling Xen software performance counters. */
124 /* XEN_SYSCTL_perfc_op */
125 /* Sub-operations: */
126 #define XEN_SYSCTL_PERFCOP_reset 1 /* Reset all counters to zero. */
127 #define XEN_SYSCTL_PERFCOP_query 2 /* Get perfctr information. */
128 struct xen_sysctl_perfc_desc {
129 char name[80]; /* name of perf counter */
130 uint32_t nr_vals; /* number of values for this counter */
132 typedef struct xen_sysctl_perfc_desc xen_sysctl_perfc_desc_t;
133 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_desc_t);
134 typedef uint32_t xen_sysctl_perfc_val_t;
135 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_val_t);
137 struct xen_sysctl_perfc_op {
139 uint32_t cmd; /* XEN_SYSCTL_PERFCOP_??? */
141 uint32_t nr_counters; /* number of counters description */
142 uint32_t nr_vals; /* number of values */
143 /* counter information (or NULL) */
144 XEN_GUEST_HANDLE_64(xen_sysctl_perfc_desc_t) desc;
145 /* counter values (or NULL) */
146 XEN_GUEST_HANDLE_64(xen_sysctl_perfc_val_t) val;
148 typedef struct xen_sysctl_perfc_op xen_sysctl_perfc_op_t;
149 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_perfc_op_t);
151 /* XEN_SYSCTL_getdomaininfolist */
152 struct xen_sysctl_getdomaininfolist {
154 domid_t first_domain;
155 uint32_t max_domains;
156 XEN_GUEST_HANDLE_64(xen_domctl_getdomaininfo_t) buffer;
158 uint32_t num_domains;
160 typedef struct xen_sysctl_getdomaininfolist xen_sysctl_getdomaininfolist_t;
161 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getdomaininfolist_t);
163 /* Inject debug keys into Xen. */
164 /* XEN_SYSCTL_debug_keys */
165 struct xen_sysctl_debug_keys {
167 XEN_GUEST_HANDLE_64(char) keys;
170 typedef struct xen_sysctl_debug_keys xen_sysctl_debug_keys_t;
171 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_debug_keys_t);
173 /* Get physical CPU information. */
174 /* XEN_SYSCTL_getcpuinfo */
175 struct xen_sysctl_cpuinfo {
176 uint64_aligned_t idletime;
178 typedef struct xen_sysctl_cpuinfo xen_sysctl_cpuinfo_t;
179 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpuinfo_t);
180 struct xen_sysctl_getcpuinfo {
183 XEN_GUEST_HANDLE_64(xen_sysctl_cpuinfo_t) info;
187 typedef struct xen_sysctl_getcpuinfo xen_sysctl_getcpuinfo_t;
188 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_getcpuinfo_t);
190 /* XEN_SYSCTL_availheap */
191 struct xen_sysctl_availheap {
193 uint32_t min_bitwidth; /* Smallest address width (zero if don't care). */
194 uint32_t max_bitwidth; /* Largest address width (zero if don't care). */
195 int32_t node; /* NUMA node of interest (-1 for all nodes). */
197 uint64_aligned_t avail_bytes;/* Bytes available in the specified region. */
199 typedef struct xen_sysctl_availheap xen_sysctl_availheap_t;
200 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_availheap_t);
202 /* XEN_SYSCTL_get_pmstat */
204 uint64_aligned_t freq; /* Px core frequency */
205 uint64_aligned_t residency; /* Px residency time */
206 uint64_aligned_t count; /* Px transition count */
208 typedef struct pm_px_val pm_px_val_t;
209 DEFINE_XEN_GUEST_HANDLE(pm_px_val_t);
212 uint8_t total; /* total Px states */
213 uint8_t usable; /* usable Px states */
214 uint8_t last; /* last Px state */
215 uint8_t cur; /* current Px state */
216 XEN_GUEST_HANDLE_64(uint64) trans_pt; /* Px transition table */
217 XEN_GUEST_HANDLE_64(pm_px_val_t) pt;
219 typedef struct pm_px_stat pm_px_stat_t;
220 DEFINE_XEN_GUEST_HANDLE(pm_px_stat_t);
223 uint32_t nr; /* entry nr in triggers & residencies, including C0 */
224 uint32_t last; /* last Cx state */
225 uint64_aligned_t idle_time; /* idle time from boot */
226 XEN_GUEST_HANDLE_64(uint64) triggers; /* Cx trigger counts */
227 XEN_GUEST_HANDLE_64(uint64) residencies; /* Cx residencies */
228 uint64_aligned_t pc2;
229 uint64_aligned_t pc3;
230 uint64_aligned_t pc6;
231 uint64_aligned_t pc7;
232 uint64_aligned_t cc3;
233 uint64_aligned_t cc6;
234 uint64_aligned_t cc7;
237 struct xen_sysctl_get_pmstat {
238 #define PMSTAT_CATEGORY_MASK 0xf0
239 #define PMSTAT_PX 0x10
240 #define PMSTAT_CX 0x20
241 #define PMSTAT_get_max_px (PMSTAT_PX | 0x1)
242 #define PMSTAT_get_pxstat (PMSTAT_PX | 0x2)
243 #define PMSTAT_reset_pxstat (PMSTAT_PX | 0x3)
244 #define PMSTAT_get_max_cx (PMSTAT_CX | 0x1)
245 #define PMSTAT_get_cxstat (PMSTAT_CX | 0x2)
246 #define PMSTAT_reset_cxstat (PMSTAT_CX | 0x3)
250 struct pm_px_stat getpx;
251 struct pm_cx_stat getcx;
252 /* other struct for tx, etc */
255 typedef struct xen_sysctl_get_pmstat xen_sysctl_get_pmstat_t;
256 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_get_pmstat_t);
258 /* XEN_SYSCTL_cpu_hotplug */
259 struct xen_sysctl_cpu_hotplug {
261 uint32_t cpu; /* Physical cpu. */
262 #define XEN_SYSCTL_CPU_HOTPLUG_ONLINE 0
263 #define XEN_SYSCTL_CPU_HOTPLUG_OFFLINE 1
264 uint32_t op; /* hotplug opcode */
266 typedef struct xen_sysctl_cpu_hotplug xen_sysctl_cpu_hotplug_t;
267 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpu_hotplug_t);
270 * Get/set xen power management, include
271 * 1. cpufreq governors and related parameters
273 /* XEN_SYSCTL_pm_op */
274 struct xen_userspace {
275 uint32_t scaling_setspeed;
277 typedef struct xen_userspace xen_userspace_t;
279 struct xen_ondemand {
280 uint32_t sampling_rate_max;
281 uint32_t sampling_rate_min;
283 uint32_t sampling_rate;
284 uint32_t up_threshold;
286 typedef struct xen_ondemand xen_ondemand_t;
289 * cpufreq para name of this structure named
290 * same as sysfs file name of native linux
292 #define CPUFREQ_NAME_LEN 16
293 struct xen_get_cpufreq_para {
294 /* IN/OUT variable */
299 /* for all governors */
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];
306 uint32_t cpuinfo_cur_freq;
307 uint32_t cpuinfo_max_freq;
308 uint32_t cpuinfo_min_freq;
309 uint32_t scaling_cur_freq;
311 char scaling_governor[CPUFREQ_NAME_LEN];
312 uint32_t scaling_max_freq;
313 uint32_t scaling_min_freq;
315 /* for specific governor */
317 struct xen_userspace userspace;
318 struct xen_ondemand ondemand;
321 int32_t turbo_enabled;
324 struct xen_set_cpufreq_gov {
325 char scaling_governor[CPUFREQ_NAME_LEN];
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
339 struct xen_sysctl_pm_op {
340 #define PM_PARA_CATEGORY_MASK 0xf0
341 #define CPUFREQ_PARA 0x10
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)
349 /* set/reset scheduler power saving option */
350 #define XEN_SYSCTL_pm_op_set_sched_opt_smt 0x21
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
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
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
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;
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
388 /* OUT: result of page offline request */
390 * bit 0~15: result flags
393 XEN_GUEST_HANDLE(uint32) status;
396 #define PG_OFFLINE_STATUS_MASK (0xFFUL)
398 /* The result is invalid, i.e. HV does not handle it */
399 #define PG_OFFLINE_INVALID (0x1UL << 0)
401 #define PG_OFFLINE_OFFLINED (0x1UL << 1)
402 #define PG_OFFLINE_PENDING (0x1UL << 2)
403 #define PG_OFFLINE_FAILED (0x1UL << 3)
404 #define PG_OFFLINE_AGAIN (0x1UL << 4)
406 #define PG_ONLINE_FAILED PG_OFFLINE_FAILED
407 #define PG_ONLINE_ONLINED PG_OFFLINE_OFFLINED
409 #define PG_OFFLINE_STATUS_OFFLINED (0x1UL << 1)
410 #define PG_OFFLINE_STATUS_ONLINE (0x1UL << 2)
411 #define PG_OFFLINE_STATUS_OFFLINE_PENDING (0x1UL << 3)
412 #define PG_OFFLINE_STATUS_BROKEN (0x1UL << 4)
414 #define PG_OFFLINE_MISC_MASK (0xFFUL << 4)
416 /* valid when PG_OFFLINE_FAILED or PG_OFFLINE_PENDING */
417 #define PG_OFFLINE_XENPAGE (0x1UL << 8)
418 #define PG_OFFLINE_DOM0PAGE (0x1UL << 9)
419 #define PG_OFFLINE_ANONYMOUS (0x1UL << 10)
420 #define PG_OFFLINE_NOT_CONV_RAM (0x1UL << 11)
421 #define PG_OFFLINE_OWNED (0x1UL << 12)
423 #define PG_OFFLINE_BROKEN (0x1UL << 13)
424 #define PG_ONLINE_BROKEN PG_OFFLINE_BROKEN
426 #define PG_OFFLINE_OWNER_SHIFT 16
428 /* XEN_SYSCTL_lockprof_op */
429 /* Sub-operations: */
430 #define XEN_SYSCTL_LOCKPROF_reset 1 /* Reset all profile data to zero. */
431 #define XEN_SYSCTL_LOCKPROF_query 2 /* Get lock profile information. */
433 #define LOCKPROF_TYPE_GLOBAL 0 /* global lock, idx meaningless */
434 #define LOCKPROF_TYPE_PERDOM 1 /* per-domain lock, idx is domid */
435 #define LOCKPROF_TYPE_N 2 /* number of types */
436 struct xen_sysctl_lockprof_data {
437 char name[40]; /* lock name (may include up to 2 %d specifiers) */
438 int32_t type; /* LOCKPROF_TYPE_??? */
439 int32_t idx; /* index (e.g. domain id) */
440 uint64_aligned_t lock_cnt; /* # of locking succeeded */
441 uint64_aligned_t block_cnt; /* # of wait for lock */
442 uint64_aligned_t lock_time; /* nsecs lock held */
443 uint64_aligned_t block_time; /* nsecs waited for lock */
445 typedef struct xen_sysctl_lockprof_data xen_sysctl_lockprof_data_t;
446 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_lockprof_data_t);
447 struct xen_sysctl_lockprof_op {
449 uint32_t cmd; /* XEN_SYSCTL_LOCKPROF_??? */
450 uint32_t max_elem; /* size of output buffer */
451 /* OUT variables (query only). */
452 uint32_t nr_elem; /* number of elements available */
453 uint64_aligned_t time; /* nsecs of profile measurement */
454 /* profile information (or NULL) */
455 XEN_GUEST_HANDLE_64(xen_sysctl_lockprof_data_t) data;
457 typedef struct xen_sysctl_lockprof_op xen_sysctl_lockprof_op_t;
458 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_lockprof_op_t);
460 /* XEN_SYSCTL_topologyinfo */
461 #define INVALID_TOPOLOGY_ID (~0U)
462 struct xen_sysctl_topologyinfo {
464 * IN: maximum addressable entry in the caller-provided arrays.
465 * OUT: largest cpu identifier in the system.
466 * If OUT is greater than IN then the arrays are truncated!
467 * If OUT is leass than IN then the array tails are not written by sysctl.
469 uint32_t max_cpu_index;
472 * If not NULL, these arrays are filled with core/socket/node identifier
474 * If a cpu has no core/socket/node information (e.g., cpu not present)
475 * then the sentinel value ~0u is written to each array.
476 * The number of array elements written by the sysctl is:
477 * min(@max_cpu_index_IN,@max_cpu_index_OUT)+1
479 XEN_GUEST_HANDLE_64(uint32) cpu_to_core;
480 XEN_GUEST_HANDLE_64(uint32) cpu_to_socket;
481 XEN_GUEST_HANDLE_64(uint32) cpu_to_node;
483 typedef struct xen_sysctl_topologyinfo xen_sysctl_topologyinfo_t;
484 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_topologyinfo_t);
486 /* XEN_SYSCTL_numainfo */
487 #define INVALID_NUMAINFO_ID (~0U)
488 struct xen_sysctl_numainfo {
490 * IN: maximum addressable entry in the caller-provided arrays.
491 * OUT: largest node identifier in the system.
492 * If OUT is greater than IN then the arrays are truncated!
494 uint32_t max_node_index;
496 /* NB. Entries are 0 if node is not present. */
497 XEN_GUEST_HANDLE_64(uint64) node_to_memsize;
498 XEN_GUEST_HANDLE_64(uint64) node_to_memfree;
501 * Array, of size (max_node_index+1)^2, listing memory access distances
502 * between nodes. If an entry has no node distance information (e.g., node
503 * not present) then the value ~0u is written.
505 * Note that the array rows must be indexed by multiplying by the minimum
506 * of the caller-provided max_node_index and the returned value of
507 * max_node_index. That is, if the largest node index in the system is
508 * smaller than the caller can handle, a smaller 2-d array is constructed
509 * within the space provided by the caller. When this occurs, trailing
510 * space provided by the caller is not modified. If the largest node index
511 * in the system is larger than the caller can handle, then a 2-d array of
512 * the maximum size handleable by the caller is constructed.
514 XEN_GUEST_HANDLE_64(uint32) node_to_node_distance;
516 typedef struct xen_sysctl_numainfo xen_sysctl_numainfo_t;
517 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_numainfo_t);
519 /* XEN_SYSCTL_cpupool_op */
520 #define XEN_SYSCTL_CPUPOOL_OP_CREATE 1 /* C */
521 #define XEN_SYSCTL_CPUPOOL_OP_DESTROY 2 /* D */
522 #define XEN_SYSCTL_CPUPOOL_OP_INFO 3 /* I */
523 #define XEN_SYSCTL_CPUPOOL_OP_ADDCPU 4 /* A */
524 #define XEN_SYSCTL_CPUPOOL_OP_RMCPU 5 /* R */
525 #define XEN_SYSCTL_CPUPOOL_OP_MOVEDOMAIN 6 /* M */
526 #define XEN_SYSCTL_CPUPOOL_OP_FREEINFO 7 /* F */
527 #define XEN_SYSCTL_CPUPOOL_PAR_ANY 0xFFFFFFFF
528 struct xen_sysctl_cpupool_op {
529 uint32_t op; /* IN */
530 uint32_t cpupool_id; /* IN: CDIARM OUT: CI */
531 uint32_t sched_id; /* IN: C OUT: I */
532 uint32_t domid; /* IN: M */
533 uint32_t cpu; /* IN: AR */
534 uint32_t n_dom; /* OUT: I */
535 struct xenctl_cpumap cpumap; /* OUT: IF */
537 typedef struct xen_sysctl_cpupool_op xen_sysctl_cpupool_op_t;
538 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_cpupool_op_t);
540 #define ARINC653_MAX_DOMAINS_PER_SCHEDULE 64
542 * This structure is used to pass a new ARINC653 schedule from a
543 * privileged domain (ie dom0) to Xen.
545 struct xen_sysctl_arinc653_schedule {
546 /* major_frame holds the time for the new schedule's major frame
548 uint64_aligned_t major_frame;
549 /* num_sched_entries holds how many of the entries in the
550 * sched_entries[] array are valid. */
551 uint8_t num_sched_entries;
552 /* The sched_entries array holds the actual schedule entries. */
554 /* dom_handle must match a domain's UUID */
555 xen_domain_handle_t dom_handle;
556 /* If a domain has multiple VCPUs, vcpu_id specifies which one
557 * this schedule entry applies to. It should be set to 0 if
558 * there is only one VCPU for the domain. */
559 unsigned int vcpu_id;
560 /* runtime specifies the amount of time that should be allocated
561 * to this VCPU per major frame. It is specified in nanoseconds */
562 uint64_aligned_t runtime;
563 } sched_entries[ARINC653_MAX_DOMAINS_PER_SCHEDULE];
565 typedef struct xen_sysctl_arinc653_schedule xen_sysctl_arinc653_schedule_t;
566 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_arinc653_schedule_t);
568 struct xen_sysctl_credit_schedule {
569 /* Length of timeslice in milliseconds */
570 #define XEN_SYSCTL_CSCHED_TSLICE_MAX 1000
571 #define XEN_SYSCTL_CSCHED_TSLICE_MIN 1
573 /* Rate limit (minimum timeslice) in microseconds */
574 #define XEN_SYSCTL_SCHED_RATELIMIT_MAX 500000
575 #define XEN_SYSCTL_SCHED_RATELIMIT_MIN 100
576 unsigned ratelimit_us;
578 typedef struct xen_sysctl_credit_schedule xen_sysctl_credit_schedule_t;
579 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_credit_schedule_t);
581 /* XEN_SYSCTL_scheduler_op */
582 /* Set or get info? */
583 #define XEN_SYSCTL_SCHEDOP_putinfo 0
584 #define XEN_SYSCTL_SCHEDOP_getinfo 1
585 struct xen_sysctl_scheduler_op {
586 uint32_t cpupool_id; /* Cpupool whose scheduler is to be targetted. */
587 uint32_t sched_id; /* XEN_SCHEDULER_* (domctl.h) */
588 uint32_t cmd; /* XEN_SYSCTL_SCHEDOP_* */
590 struct xen_sysctl_sched_arinc653 {
591 XEN_GUEST_HANDLE_64(xen_sysctl_arinc653_schedule_t) schedule;
593 struct xen_sysctl_credit_schedule sched_credit;
596 typedef struct xen_sysctl_scheduler_op xen_sysctl_scheduler_op_t;
597 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_scheduler_op_t);
601 #define XEN_SYSCTL_readconsole 1
602 #define XEN_SYSCTL_tbuf_op 2
603 #define XEN_SYSCTL_physinfo 3
604 #define XEN_SYSCTL_sched_id 4
605 #define XEN_SYSCTL_perfc_op 5
606 #define XEN_SYSCTL_getdomaininfolist 6
607 #define XEN_SYSCTL_debug_keys 7
608 #define XEN_SYSCTL_getcpuinfo 8
609 #define XEN_SYSCTL_availheap 9
610 #define XEN_SYSCTL_get_pmstat 10
611 #define XEN_SYSCTL_cpu_hotplug 11
612 #define XEN_SYSCTL_pm_op 12
613 #define XEN_SYSCTL_page_offline_op 14
614 #define XEN_SYSCTL_lockprof_op 15
615 #define XEN_SYSCTL_topologyinfo 16
616 #define XEN_SYSCTL_numainfo 17
617 #define XEN_SYSCTL_cpupool_op 18
618 #define XEN_SYSCTL_scheduler_op 19
619 uint32_t interface_version; /* XEN_SYSCTL_INTERFACE_VERSION */
621 struct xen_sysctl_readconsole readconsole;
622 struct xen_sysctl_tbuf_op tbuf_op;
623 struct xen_sysctl_physinfo physinfo;
624 struct xen_sysctl_topologyinfo topologyinfo;
625 struct xen_sysctl_numainfo numainfo;
626 struct xen_sysctl_sched_id sched_id;
627 struct xen_sysctl_perfc_op perfc_op;
628 struct xen_sysctl_getdomaininfolist getdomaininfolist;
629 struct xen_sysctl_debug_keys debug_keys;
630 struct xen_sysctl_getcpuinfo getcpuinfo;
631 struct xen_sysctl_availheap availheap;
632 struct xen_sysctl_get_pmstat get_pmstat;
633 struct xen_sysctl_cpu_hotplug cpu_hotplug;
634 struct xen_sysctl_pm_op pm_op;
635 struct xen_sysctl_page_offline_op page_offline;
636 struct xen_sysctl_lockprof_op lockprof_op;
637 struct xen_sysctl_cpupool_op cpupool_op;
638 struct xen_sysctl_scheduler_op scheduler_op;
642 typedef struct xen_sysctl xen_sysctl_t;
643 DEFINE_XEN_GUEST_HANDLE(xen_sysctl_t);
645 #endif /* __XEN_PUBLIC_SYSCTL_H__ */
653 * indent-tabs-mode: nil