aboutsummaryrefslogtreecommitdiffstats
path: root/include/xen
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2016-08-29 02:48:42 -0400
committerIngo Molnar <mingo@kernel.org>2016-09-05 07:52:37 -0400
commit3260ab5616b4cd049c79c342617525456a2391b2 (patch)
treefd82574f01f97e239e888eefc932754af0e49898 /include/xen
parentc6935931c1894ff857616ff8549b61236a19148f (diff)
xen: Sync xen header
Import the actual version of include/xen/interface/sched.h from Xen. Signed-off-by: Juergen Gross <jgross@suse.com> Signed-off-by: Peter Zijlstra (Intel) <peterz@infradead.org> Acked-by: David Vrabel <david.vrabel@citrix.com> Cc: Douglas_Warzecha@dell.com Cc: Linus Torvalds <torvalds@linux-foundation.org> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Thomas Gleixner <tglx@linutronix.de> Cc: akataria@vmware.com Cc: boris.ostrovsky@oracle.com Cc: chrisw@sous-sol.org Cc: hpa@zytor.com Cc: jdelvare@suse.com Cc: jeremy@goop.org Cc: linux@roeck-us.net Cc: pali.rohar@gmail.com Cc: rusty@rustcorp.com.au Cc: virtualization@lists.linux-foundation.org Cc: xen-devel@lists.xenproject.org Link: http://lkml.kernel.org/r/1472453327-19050-2-git-send-email-jgross@suse.com Signed-off-by: Ingo Molnar <mingo@kernel.org>
Diffstat (limited to 'include/xen')
-rw-r--r--include/xen/interface/sched.h100
1 files changed, 82 insertions, 18 deletions
diff --git a/include/xen/interface/sched.h b/include/xen/interface/sched.h
index f18490985fc8..a4c4d735d781 100644
--- a/include/xen/interface/sched.h
+++ b/include/xen/interface/sched.h
@@ -3,6 +3,24 @@
3 * 3 *
4 * Scheduler state interactions 4 * Scheduler state interactions
5 * 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 *
6 * Copyright (c) 2005, Keir Fraser <keir@xensource.com> 24 * Copyright (c) 2005, Keir Fraser <keir@xensource.com>
7 */ 25 */
8 26
@@ -12,18 +30,30 @@
12#include <xen/interface/event_channel.h> 30#include <xen/interface/event_channel.h>
13 31
14/* 32/*
33 * Guest Scheduler Operations
34 *
35 * The SCHEDOP interface provides mechanisms for a guest to interact
36 * with the scheduler, including yield, blocking and shutting itself
37 * down.
38 */
39
40/*
15 * The prototype for this hypercall is: 41 * The prototype for this hypercall is:
16 * long sched_op_new(int cmd, void *arg) 42 * long HYPERVISOR_sched_op(enum sched_op cmd, void *arg, ...)
43 *
17 * @cmd == SCHEDOP_??? (scheduler operation). 44 * @cmd == SCHEDOP_??? (scheduler operation).
18 * @arg == Operation-specific extra argument(s), as described below. 45 * @arg == Operation-specific extra argument(s), as described below.
46 * ... == Additional Operation-specific extra arguments, described below.
19 * 47 *
20 * **NOTE**: 48 * Versions of Xen prior to 3.0.2 provided only the following legacy version
21 * Versions of Xen prior to 3.0.2 provide only the following legacy version
22 * of this hypercall, supporting only the commands yield, block and shutdown: 49 * of this hypercall, supporting only the commands yield, block and shutdown:
23 * long sched_op(int cmd, unsigned long arg) 50 * long sched_op(int cmd, unsigned long arg)
24 * @cmd == SCHEDOP_??? (scheduler operation). 51 * @cmd == SCHEDOP_??? (scheduler operation).
25 * @arg == 0 (SCHEDOP_yield and SCHEDOP_block) 52 * @arg == 0 (SCHEDOP_yield and SCHEDOP_block)
26 * == SHUTDOWN_* code (SCHEDOP_shutdown) 53 * == SHUTDOWN_* code (SCHEDOP_shutdown)
54 *
55 * This legacy version is available to new guests as:
56 * long HYPERVISOR_sched_op_compat(enum sched_op cmd, unsigned long arg)
27 */ 57 */
28 58
29/* 59/*
@@ -44,12 +74,17 @@
44/* 74/*
45 * Halt execution of this domain (all VCPUs) and notify the system controller. 75 * Halt execution of this domain (all VCPUs) and notify the system controller.
46 * @arg == pointer to sched_shutdown structure. 76 * @arg == pointer to sched_shutdown structure.
77 *
78 * If the sched_shutdown_t reason is SHUTDOWN_suspend then
79 * x86 PV guests must also set RDX (EDX for 32-bit guests) to the MFN
80 * of the guest's start info page. RDX/EDX is the third hypercall
81 * argument.
82 *
83 * In addition, which reason is SHUTDOWN_suspend this hypercall
84 * returns 1 if suspend was cancelled or the domain was merely
85 * checkpointed, and 0 if it is resuming in a new domain.
47 */ 86 */
48#define SCHEDOP_shutdown 2 87#define SCHEDOP_shutdown 2
49struct sched_shutdown {
50 unsigned int reason; /* SHUTDOWN_* */
51};
52DEFINE_GUEST_HANDLE_STRUCT(sched_shutdown);
53 88
54/* 89/*
55 * Poll a set of event-channel ports. Return when one or more are pending. An 90 * Poll a set of event-channel ports. Return when one or more are pending. An
@@ -57,12 +92,6 @@ DEFINE_GUEST_HANDLE_STRUCT(sched_shutdown);
57 * @arg == pointer to sched_poll structure. 92 * @arg == pointer to sched_poll structure.
58 */ 93 */
59#define SCHEDOP_poll 3 94#define SCHEDOP_poll 3
60struct sched_poll {
61 GUEST_HANDLE(evtchn_port_t) ports;
62 unsigned int nr_ports;
63 uint64_t timeout;
64};
65DEFINE_GUEST_HANDLE_STRUCT(sched_poll);
66 95
67/* 96/*
68 * Declare a shutdown for another domain. The main use of this function is 97 * Declare a shutdown for another domain. The main use of this function is
@@ -71,15 +100,11 @@ DEFINE_GUEST_HANDLE_STRUCT(sched_poll);
71 * @arg == pointer to sched_remote_shutdown structure. 100 * @arg == pointer to sched_remote_shutdown structure.
72 */ 101 */
73#define SCHEDOP_remote_shutdown 4 102#define SCHEDOP_remote_shutdown 4
74struct sched_remote_shutdown {
75 domid_t domain_id; /* Remote domain ID */
76 unsigned int reason; /* SHUTDOWN_xxx reason */
77};
78 103
79/* 104/*
80 * Latch a shutdown code, so that when the domain later shuts down it 105 * Latch a shutdown code, so that when the domain later shuts down it
81 * reports this code to the control tools. 106 * reports this code to the control tools.
82 * @arg == as for SCHEDOP_shutdown. 107 * @arg == sched_shutdown, as for SCHEDOP_shutdown.
83 */ 108 */
84#define SCHEDOP_shutdown_code 5 109#define SCHEDOP_shutdown_code 5
85 110
@@ -92,10 +117,47 @@ struct sched_remote_shutdown {
92 * With id != 0 and timeout != 0, poke watchdog timer and set new timeout. 117 * With id != 0 and timeout != 0, poke watchdog timer and set new timeout.
93 */ 118 */
94#define SCHEDOP_watchdog 6 119#define SCHEDOP_watchdog 6
120
121/*
122 * Override the current vcpu affinity by pinning it to one physical cpu or
123 * undo this override restoring the previous affinity.
124 * @arg == pointer to sched_pin_override structure.
125 *
126 * A negative pcpu value will undo a previous pin override and restore the
127 * previous cpu affinity.
128 * This call is allowed for the hardware domain only and requires the cpu
129 * to be part of the domain's cpupool.
130 */
131#define SCHEDOP_pin_override 7
132
133struct sched_shutdown {
134 unsigned int reason; /* SHUTDOWN_* => shutdown reason */
135};
136DEFINE_GUEST_HANDLE_STRUCT(sched_shutdown);
137
138struct sched_poll {
139 GUEST_HANDLE(evtchn_port_t) ports;
140 unsigned int nr_ports;
141 uint64_t timeout;
142};
143DEFINE_GUEST_HANDLE_STRUCT(sched_poll);
144
145struct sched_remote_shutdown {
146 domid_t domain_id; /* Remote domain ID */
147 unsigned int reason; /* SHUTDOWN_* => shutdown reason */
148};
149DEFINE_GUEST_HANDLE_STRUCT(sched_remote_shutdown);
150
95struct sched_watchdog { 151struct sched_watchdog {
96 uint32_t id; /* watchdog ID */ 152 uint32_t id; /* watchdog ID */
97 uint32_t timeout; /* timeout */ 153 uint32_t timeout; /* timeout */
98}; 154};
155DEFINE_GUEST_HANDLE_STRUCT(sched_watchdog);
156
157struct sched_pin_override {
158 int32_t pcpu;
159};
160DEFINE_GUEST_HANDLE_STRUCT(sched_pin_override);
99 161
100/* 162/*
101 * Reason codes for SCHEDOP_shutdown. These may be interpreted by control 163 * Reason codes for SCHEDOP_shutdown. These may be interpreted by control
@@ -107,6 +169,7 @@ struct sched_watchdog {
107#define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */ 169#define SHUTDOWN_suspend 2 /* Clean up, save suspend info, kill. */
108#define SHUTDOWN_crash 3 /* Tell controller we've crashed. */ 170#define SHUTDOWN_crash 3 /* Tell controller we've crashed. */
109#define SHUTDOWN_watchdog 4 /* Restart because watchdog time expired. */ 171#define SHUTDOWN_watchdog 4 /* Restart because watchdog time expired. */
172
110/* 173/*
111 * Domain asked to perform 'soft reset' for it. The expected behavior is to 174 * Domain asked to perform 'soft reset' for it. The expected behavior is to
112 * reset internal Xen state for the domain returning it to the point where it 175 * reset internal Xen state for the domain returning it to the point where it
@@ -115,5 +178,6 @@ struct sched_watchdog {
115 * interfaces again. 178 * interfaces again.
116 */ 179 */
117#define SHUTDOWN_soft_reset 5 180#define SHUTDOWN_soft_reset 5
181#define SHUTDOWN_MAX 5 /* Maximum valid shutdown reason. */
118 182
119#endif /* __XEN_PUBLIC_SCHED_H__ */ 183#endif /* __XEN_PUBLIC_SCHED_H__ */