]>
Commit | Line | Data |
---|---|---|
6f14cc18 | 1 | /* Copyright (C) 2010 - 2015 UNISYS CORPORATION |
12e364b9 KC |
2 | * All rights reserved. |
3 | * | |
6f14cc18 BR |
4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | |
6 | * version 2, as published by the Free Software Foundation. | |
12e364b9 KC |
7 | * |
8 | * This program is distributed in the hope that it will be useful, but | |
9 | * WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 | * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or | |
11 | * NON INFRINGEMENT. See the GNU General Public License for more | |
12 | * details. | |
13 | */ | |
14 | ||
15 | #ifndef __CONTROLVMCHANNEL_H__ | |
16 | #define __CONTROLVMCHANNEL_H__ | |
17 | ||
90addb02 | 18 | #include <linux/uuid.h> |
12e364b9 | 19 | #include "channel.h" |
af96e9c0 | 20 | |
12e364b9 | 21 | /* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */ |
5fbaa4b3 | 22 | #define SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID \ |
90addb02 | 23 | UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \ |
7e5a1a76 | 24 | 0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d) |
12e364b9 | 25 | |
12e364b9 KC |
26 | #define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE \ |
27 | ULTRA_CHANNEL_PROTOCOL_SIGNATURE | |
7e5a1a76 | 28 | #define CONTROLVM_MESSAGE_MAX 64 |
12e364b9 KC |
29 | |
30 | /* Must increment this whenever you insert or delete fields within | |
7e5a1a76 EA |
31 | * this channel struct. Also increment whenever you change the meaning |
32 | * of fields within this channel struct so as to break pre-existing | |
33 | * software. Note that you can usually add fields to the END of the | |
34 | * channel struct withOUT needing to increment this. | |
35 | */ | |
12e364b9 KC |
36 | #define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID 1 |
37 | ||
600832fd BR |
38 | #define SPAR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \ |
39 | spar_check_channel_client(ch, \ | |
df94247a | 40 | SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID, \ |
d19642f6 BR |
41 | "controlvm", \ |
42 | sizeof(struct spar_controlvm_channel_protocol), \ | |
43 | ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \ | |
44 | ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE) | |
12e364b9 | 45 | |
12e364b9 KC |
46 | #define MAX_SERIAL_NUM 32 |
47 | ||
7e5a1a76 | 48 | /* Defines for various channel queues */ |
12e364b9 KC |
49 | #define CONTROLVM_QUEUE_REQUEST 0 |
50 | #define CONTROLVM_QUEUE_RESPONSE 1 | |
7e5a1a76 | 51 | #define CONTROLVM_QUEUE_EVENT 2 |
12e364b9 KC |
52 | #define CONTROLVM_QUEUE_ACK 3 |
53 | ||
7e5a1a76 | 54 | /* Max num of messages stored during IOVM creation to be reused after crash */ |
12e364b9 KC |
55 | #define CONTROLVM_CRASHMSG_MAX 2 |
56 | ||
389f5592 DK |
57 | struct spar_segment_state { |
58 | u16 enabled:1; /* Bit 0: May enter other states */ | |
59 | u16 active:1; /* Bit 1: Assigned to active partition */ | |
60 | u16 alive:1; /* Bit 2: Configure message sent to | |
61 | * service/server */ | |
62 | u16 revoked:1; /* Bit 3: similar to partition state | |
63 | * ShuttingDown */ | |
64 | u16 allocated:1; /* Bit 4: memory (device/port number) | |
65 | * has been selected by Command */ | |
66 | u16 known:1; /* Bit 5: has been introduced to the | |
67 | * service/guest partition */ | |
68 | u16 ready:1; /* Bit 6: service/Guest partition has | |
69 | * responded to introduction */ | |
70 | u16 operating:1; /* Bit 7: resource is configured and | |
71 | * operating */ | |
72 | /* Note: don't use high bit unless we need to switch to ushort | |
73 | * which is non-compliant */ | |
74 | }; | |
75 | ||
76 | static const struct spar_segment_state segment_state_running = { | |
77 | 1, 1, 1, 0, 1, 1, 1, 1 | |
78 | }; | |
79 | ||
80 | static const struct spar_segment_state segment_state_paused = { | |
81 | 1, 1, 1, 0, 1, 1, 1, 0 | |
82 | }; | |
83 | ||
84 | static const struct spar_segment_state segment_state_standby = { | |
85 | 1, 1, 0, 0, 1, 1, 1, 0 | |
86 | }; | |
87 | ||
7e5a1a76 | 88 | /* Ids for commands that may appear in either queue of a ControlVm channel. |
12e364b9 KC |
89 | * |
90 | * Commands that are initiated by the command partition (CP), by an IO or | |
91 | * console service partition (SP), or by a guest partition (GP)are: | |
92 | * - issued on the RequestQueue queue (q #0) in the ControlVm channel | |
93 | * - responded to on the ResponseQueue queue (q #1) in the ControlVm channel | |
94 | * | |
95 | * Events that are initiated by an IO or console service partition (SP) or | |
96 | * by a guest partition (GP) are: | |
97 | * - issued on the EventQueue queue (q #2) in the ControlVm channel | |
98 | * - responded to on the EventAckQueue queue (q #3) in the ControlVm channel | |
99 | */ | |
53bebb13 | 100 | enum controlvm_id { |
12e364b9 | 101 | CONTROLVM_INVALID = 0, |
7e5a1a76 EA |
102 | /* SWITCH commands required Parameter: SwitchNumber */ |
103 | /* BUS commands required Parameter: BusNumber */ | |
104 | CONTROLVM_BUS_CREATE = 0x101, /* CP --> SP, GP */ | |
105 | CONTROLVM_BUS_DESTROY = 0x102, /* CP --> SP, GP */ | |
106 | CONTROLVM_BUS_CONFIGURE = 0x104, /* CP --> SP */ | |
107 | CONTROLVM_BUS_CHANGESTATE = 0x105, /* CP --> SP, GP */ | |
108 | CONTROLVM_BUS_CHANGESTATE_EVENT = 0x106, /* SP, GP --> CP */ | |
109 | /* DEVICE commands required Parameter: BusNumber, DeviceNumber */ | |
110 | ||
111 | CONTROLVM_DEVICE_CREATE = 0x201, /* CP --> SP, GP */ | |
112 | CONTROLVM_DEVICE_DESTROY = 0x202, /* CP --> SP, GP */ | |
113 | CONTROLVM_DEVICE_CONFIGURE = 0x203, /* CP --> SP */ | |
114 | CONTROLVM_DEVICE_CHANGESTATE = 0x204, /* CP --> SP, GP */ | |
115 | CONTROLVM_DEVICE_CHANGESTATE_EVENT = 0x205, /* SP, GP --> CP */ | |
116 | CONTROLVM_DEVICE_RECONFIGURE = 0x206, /* CP --> Boot */ | |
12e364b9 | 117 | /* CHIPSET commands */ |
7e5a1a76 EA |
118 | CONTROLVM_CHIPSET_INIT = 0x301, /* CP --> SP, GP */ |
119 | CONTROLVM_CHIPSET_STOP = 0x302, /* CP --> SP, GP */ | |
7e5a1a76 EA |
120 | CONTROLVM_CHIPSET_READY = 0x304, /* CP --> SP */ |
121 | CONTROLVM_CHIPSET_SELFTEST = 0x305, /* CP --> SP */ | |
12e364b9 | 122 | |
d8ad8b0c | 123 | }; |
12e364b9 | 124 | |
4eddbf13 | 125 | struct irq_info { |
22a0350b | 126 | u64 reserved1; |
12e364b9 | 127 | |
7e5a1a76 | 128 | /* specifies interrupt handle. It is used to retrieve the |
12e364b9 KC |
129 | * corresponding interrupt pin from Monitor; and the |
130 | * interrupt pin is used to connect to the corresponding | |
7e5a1a76 EA |
131 | * interrupt. Used by IOPart-GP only. |
132 | */ | |
af3286bd | 133 | u64 recv_irq_handle; |
12e364b9 | 134 | |
7e5a1a76 | 135 | /* specifies interrupt vector. It, interrupt pin, and shared are |
12e364b9 | 136 | * used to connect to the corresponding interrupt. Used by |
7e5a1a76 EA |
137 | * IOPart-GP only. |
138 | */ | |
af3286bd | 139 | u32 recv_irq_vector; |
12e364b9 | 140 | |
7e5a1a76 EA |
141 | /* specifies if the recvInterrupt is shared. It, interrupt pin |
142 | * and vector are used to connect to 0 = not shared; 1 = shared. | |
143 | * the corresponding interrupt. Used by IOPart-GP only. | |
144 | */ | |
af3286bd | 145 | u8 recv_irq_shared; |
c242233e | 146 | u8 reserved[3]; /* Natural alignment purposes */ |
12e364b9 KC |
147 | }; |
148 | ||
c12ad837 | 149 | struct pci_id { |
6822f736 BR |
150 | u16 domain; |
151 | u8 bus; | |
152 | u8 slot; | |
153 | u8 func; | |
154 | u8 reserved[3]; /* Natural alignment purposes */ | |
12e364b9 KC |
155 | }; |
156 | ||
755e2ecc | 157 | struct efi_spar_indication { |
7e5a1a76 EA |
158 | u64 boot_to_fw_ui:1; /* Bit 0: Stop in uefi ui */ |
159 | u64 clear_nvram:1; /* Bit 1: Clear NVRAM */ | |
160 | u64 clear_cmos:1; /* Bit 2: Clear CMOS */ | |
161 | u64 boot_to_tool:1; /* Bit 3: Run install tool */ | |
12e364b9 | 162 | /* remaining bits are available */ |
755e2ecc | 163 | }; |
12e364b9 | 164 | |
b9b141e8 | 165 | enum ultra_chipset_feature { |
12e364b9 KC |
166 | ULTRA_CHIPSET_FEATURE_REPLY = 0x00000001, |
167 | ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG = 0x00000002, | |
b9b141e8 | 168 | }; |
12e364b9 | 169 | |
7e5a1a76 | 170 | /* This is the common structure that is at the beginning of every |
12e364b9 KC |
171 | * ControlVm message (both commands and responses) in any ControlVm |
172 | * queue. Commands are easily distinguished from responses by | |
173 | * looking at the flags.response field. | |
174 | */ | |
98d7b594 BR |
175 | struct controlvm_message_header { |
176 | u32 id; /* See CONTROLVM_ID. */ | |
12e364b9 KC |
177 | /* For requests, indicates the message type. */ |
178 | /* For responses, indicates the type of message we are responding to. */ | |
179 | ||
98d7b594 | 180 | u32 message_size; /* Includes size of this struct + size |
12e364b9 | 181 | * of message */ |
98d7b594 | 182 | u32 segment_index; /* Index of segment containing Vm |
12e364b9 | 183 | * message/information */ |
98d7b594 | 184 | u32 completion_status; /* Error status code or result of |
12e364b9 KC |
185 | * message completion */ |
186 | struct { | |
7e5a1a76 | 187 | u32 failed:1; /* =1 in a response to * signify |
12e364b9 | 188 | * failure */ |
7e5a1a76 EA |
189 | u32 response_expected:1; /* =1 in all messages that expect a |
190 | * response (Control ignores this | |
191 | * bit) */ | |
192 | u32 server:1; /* =1 in all bus & device-related | |
12e364b9 KC |
193 | * messages where the message |
194 | * receiver is to act as the bus or | |
195 | * device server */ | |
7e5a1a76 | 196 | u32 test_message:1; /* =1 for testing use only |
12e364b9 KC |
197 | * (Control and Command ignore this |
198 | * bit) */ | |
7e5a1a76 EA |
199 | u32 partial_completion:1; /* =1 if there are forthcoming |
200 | * responses/acks associated | |
201 | * with this message */ | |
202 | u32 preserve:1; /* =1 this is to let us know to | |
203 | * preserve channel contents | |
204 | * (for running guests)*/ | |
205 | u32 writer_in_diag:1; /* =1 the DiagWriter is active in the | |
206 | * Diagnostic Partition*/ | |
98d7b594 BR |
207 | } flags; |
208 | u32 reserved; /* Natural alignment */ | |
209 | u64 message_handle; /* Identifies the particular message instance, | |
12e364b9 KC |
210 | * and is used to match particular */ |
211 | /* request instances with the corresponding response instance. */ | |
98d7b594 | 212 | u64 payload_vm_offset; /* Offset of payload area from start of this |
12e364b9 | 213 | * instance of ControlVm segment */ |
98d7b594 | 214 | u32 payload_max_bytes; /* Maximum bytes allocated in payload |
12e364b9 | 215 | * area of ControlVm segment */ |
98d7b594 | 216 | u32 payload_bytes; /* Actual number of bytes of payload |
12e364b9 KC |
217 | * area to copy between IO/Command; */ |
218 | /* if non-zero, there is a payload to copy. */ | |
98d7b594 | 219 | }; |
12e364b9 | 220 | |
f91b9262 | 221 | struct controlvm_packet_device_create { |
7e5a1a76 EA |
222 | u32 bus_no; /* bus # (0..n-1) from the msg receiver's end */ |
223 | u32 dev_no; /* bus-relative (0..n-1) device number */ | |
f91b9262 BR |
224 | u64 channel_addr; /* Guest physical address of the channel, which |
225 | * can be dereferenced by the receiver of this | |
226 | * ControlVm command */ | |
227 | u64 channel_bytes; /* specifies size of the channel in bytes */ | |
228 | uuid_le data_type_uuid; /* specifies format of data in channel */ | |
229 | uuid_le dev_inst_uuid; /* instance guid for the device */ | |
230 | struct irq_info intr; /* specifies interrupt information */ | |
231 | }; /* for CONTROLVM_DEVICE_CREATE */ | |
12e364b9 | 232 | |
e6ad00bb | 233 | struct controlvm_packet_device_configure { |
7e5a1a76 | 234 | u32 bus_no; /* bus # (0..n-1) from the msg |
12e364b9 | 235 | * receiver's perspective */ |
7e5a1a76 EA |
236 | /* Control uses header SegmentIndex field to access bus number... */ |
237 | u32 dev_no; /* bus-relative (0..n-1) device number */ | |
e6ad00bb | 238 | } ; /* for CONTROLVM_DEVICE_CONFIGURE */ |
12e364b9 | 239 | |
c36acb55 BR |
240 | struct controlvm_message_device_create { |
241 | struct controlvm_message_header header; | |
242 | struct controlvm_packet_device_create packet; | |
243 | }; /* total 128 bytes */ | |
12e364b9 | 244 | |
f676054d BR |
245 | struct controlvm_message_device_configure { |
246 | struct controlvm_message_header header; | |
247 | struct controlvm_packet_device_configure packet; | |
248 | }; /* total 56 bytes */ | |
12e364b9 KC |
249 | |
250 | /* This is the format for a message in any ControlVm queue. */ | |
2ea5117b | 251 | struct controlvm_message_packet { |
12e364b9 | 252 | union { |
12e364b9 | 253 | struct { |
2ea5117b BR |
254 | u32 bus_no; /* bus # (0..n-1) from the msg |
255 | * receiver's perspective */ | |
256 | u32 dev_count; /* indicates the max number of | |
257 | * devices on this bus */ | |
258 | u64 channel_addr; /* Guest physical address of | |
259 | * the channel, which can be | |
260 | * dereferenced by the receiver | |
261 | * of this ControlVm command */ | |
262 | u64 channel_bytes; /* size of the channel */ | |
263 | uuid_le bus_data_type_uuid; /* indicates format of | |
264 | * data in bus channel*/ | |
265 | uuid_le bus_inst_uuid; /* instance uuid for the bus */ | |
266 | } create_bus; /* for CONTROLVM_BUS_CREATE */ | |
12e364b9 | 267 | struct { |
2ea5117b BR |
268 | u32 bus_no; /* bus # (0..n-1) from the msg |
269 | * receiver's perspective */ | |
b3c55b13 | 270 | u32 reserved; /* Natural alignment purposes */ |
2ea5117b | 271 | } destroy_bus; /* for CONTROLVM_BUS_DESTROY */ |
12e364b9 | 272 | struct { |
2ea5117b BR |
273 | u32 bus_no; /* bus # (0..n-1) from the receiver's |
274 | * perspective */ | |
275 | u32 reserved1; /* for alignment purposes */ | |
276 | u64 guest_handle; /* This is used to convert | |
277 | * guest physical address to | |
278 | * physical address */ | |
279 | u64 recv_bus_irq_handle; | |
280 | /* specifies interrupt info. It is used by SP | |
281 | * to register to receive interrupts from the | |
282 | * CP. This interrupt is used for bus level | |
283 | * notifications. The corresponding | |
284 | * sendBusInterruptHandle is kept in CP. */ | |
285 | } configure_bus; /* for CONTROLVM_BUS_CONFIGURE */ | |
12e364b9 | 286 | /* for CONTROLVM_DEVICE_CREATE */ |
f91b9262 | 287 | struct controlvm_packet_device_create create_device; |
12e364b9 | 288 | struct { |
2ea5117b BR |
289 | u32 bus_no; /* bus # (0..n-1) from the msg |
290 | * receiver's perspective */ | |
291 | u32 dev_no; /* bus-relative (0..n-1) device # */ | |
292 | } destroy_device; /* for CONTROLVM_DEVICE_DESTROY */ | |
12e364b9 | 293 | /* for CONTROLVM_DEVICE_CONFIGURE */ |
e6ad00bb | 294 | struct controlvm_packet_device_configure configure_device; |
12e364b9 | 295 | struct { |
2ea5117b BR |
296 | u32 bus_no; /* bus # (0..n-1) from the msg |
297 | * receiver's perspective */ | |
298 | u32 dev_no; /* bus-relative (0..n-1) device # */ | |
299 | } reconfigure_device; /* for CONTROLVM_DEVICE_RECONFIGURE */ | |
12e364b9 | 300 | struct { |
2ea5117b | 301 | u32 bus_no; |
3f833b54 | 302 | struct spar_segment_state state; |
c242233e | 303 | u8 reserved[2]; /* Natural alignment purposes */ |
2ea5117b | 304 | } bus_change_state; /* for CONTROLVM_BUS_CHANGESTATE */ |
12e364b9 | 305 | struct { |
2ea5117b BR |
306 | u32 bus_no; |
307 | u32 dev_no; | |
3f833b54 | 308 | struct spar_segment_state state; |
12e364b9 | 309 | struct { |
2ea5117b | 310 | u32 phys_device:1; /* =1 if message is for |
12e364b9 | 311 | * a physical device */ |
12e364b9 | 312 | } flags; |
c242233e | 313 | u8 reserved[2]; /* Natural alignment purposes */ |
2ea5117b | 314 | } device_change_state; /* for CONTROLVM_DEVICE_CHANGESTATE */ |
12e364b9 | 315 | struct { |
2ea5117b BR |
316 | u32 bus_no; |
317 | u32 dev_no; | |
3f833b54 | 318 | struct spar_segment_state state; |
c242233e | 319 | u8 reserved[6]; /* Natural alignment purposes */ |
2ea5117b BR |
320 | } device_change_state_event; |
321 | /* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */ | |
12e364b9 | 322 | struct { |
2ea5117b BR |
323 | u32 bus_count; /* indicates the max number of busses */ |
324 | u32 switch_count; /* indicates the max number of | |
325 | * switches if a service partition */ | |
b9b141e8 | 326 | enum ultra_chipset_feature features; |
2ea5117b BR |
327 | u32 platform_number; /* Platform Number */ |
328 | } init_chipset; /* for CONTROLVM_CHIPSET_INIT */ | |
12e364b9 | 329 | struct { |
2ea5117b BR |
330 | u32 options; /* reserved */ |
331 | u32 test; /* bit 0 set to run embedded selftest */ | |
332 | } chipset_selftest; /* for CONTROLVM_CHIPSET_SELFTEST */ | |
333 | u64 addr; /* a physical address of something, that can be | |
334 | * dereferenced by the receiver of this | |
335 | * ControlVm command (depends on command id) */ | |
336 | u64 handle; /* a handle of something (depends on command | |
337 | * id) */ | |
12e364b9 | 338 | }; |
2ea5117b | 339 | }; |
12e364b9 KC |
340 | |
341 | /* All messages in any ControlVm queue have this layout. */ | |
3ab47701 | 342 | struct controlvm_message { |
98d7b594 | 343 | struct controlvm_message_header hdr; |
2ea5117b | 344 | struct controlvm_message_packet cmd; |
3ab47701 | 345 | }; |
12e364b9 | 346 | |
d19642f6 | 347 | struct spar_controlvm_channel_protocol { |
7e5a1a76 EA |
348 | struct channel_header header; |
349 | u64 gp_controlvm; /* guest phys addr of this channel */ | |
350 | u64 gp_partition_tables;/* guest phys addr of partition tables */ | |
351 | u64 gp_diag_guest; /* guest phys addr of diagnostic channel */ | |
352 | u64 gp_boot_romdisk;/* guest phys addr of (read* only) Boot ROM disk */ | |
353 | u64 gp_boot_ramdisk;/* guest phys addr of writable Boot RAM disk */ | |
354 | u64 gp_acpi_table; /* guest phys addr of acpi table */ | |
355 | u64 gp_control_channel;/* guest phys addr of control channel */ | |
356 | u64 gp_diag_romdisk;/* guest phys addr of diagnostic ROM disk */ | |
357 | u64 gp_nvram; /* guest phys addr of NVRAM channel */ | |
358 | u64 request_payload_offset; /* Offset to request payload area */ | |
359 | u64 event_payload_offset; /* Offset to event payload area */ | |
360 | u32 request_payload_bytes; /* Bytes available in request payload | |
12e364b9 | 361 | * area */ |
7e5a1a76 EA |
362 | u32 event_payload_bytes;/* Bytes available in event payload area */ |
363 | u32 control_channel_bytes; | |
364 | u32 nvram_channel_bytes; /* Bytes in PartitionNvram segment */ | |
365 | u32 message_bytes; /* sizeof(CONTROLVM_MESSAGE) */ | |
366 | u32 message_count; /* CONTROLVM_MESSAGE_MAX */ | |
367 | u64 gp_smbios_table; /* guest phys addr of SMBIOS tables */ | |
368 | u64 gp_physical_smbios_table; /* guest phys addr of SMBIOS table */ | |
369 | /* ULTRA_MAX_GUESTS_PER_SERVICE */ | |
680385e3 | 370 | char gp_reserved[2688]; |
7e5a1a76 EA |
371 | |
372 | /* guest physical address of EFI firmware image base */ | |
373 | u64 virtual_guest_firmware_image_base; | |
374 | ||
375 | /* guest physical address of EFI firmware entry point */ | |
376 | u64 virtual_guest_firmware_entry_point; | |
377 | ||
378 | /* guest EFI firmware image size */ | |
379 | u64 virtual_guest_firmware_image_size; | |
380 | ||
381 | /* GPA = 1MB where EFI firmware image is copied to */ | |
382 | u64 virtual_guest_firmware_boot_base; | |
383 | u64 virtual_guest_image_base; | |
384 | u64 virtual_guest_image_size; | |
385 | u64 prototype_control_channel_offset; | |
386 | u64 virtual_guest_partition_handle; | |
387 | ||
388 | u16 restore_action; /* Restore Action field to restore the guest | |
12e364b9 | 389 | * partition */ |
d19642f6 | 390 | u16 dump_action; /* For Windows guests it shows if the visordisk |
12e364b9 | 391 | * is running in dump mode */ |
d19642f6 BR |
392 | u16 nvram_fail_count; |
393 | u16 saved_crash_message_count; /* = CONTROLVM_CRASHMSG_MAX */ | |
394 | u32 saved_crash_message_offset; /* Offset to request payload area needed | |
12e364b9 | 395 | * for crash dump */ |
d19642f6 | 396 | u32 installation_error; /* Type of error encountered during |
12e364b9 | 397 | * installation */ |
d19642f6 BR |
398 | u32 installation_text_id; /* Id of string to display */ |
399 | u16 installation_remaining_steps;/* Number of remaining installation | |
400 | * steps (for progress bars) */ | |
401 | u8 tool_action; /* ULTRA_TOOL_ACTIONS Installation Action | |
12e364b9 | 402 | * field */ |
d19642f6 BR |
403 | u8 reserved; /* alignment */ |
404 | struct efi_spar_indication efi_spar_ind; | |
405 | struct efi_spar_indication efi_spar_ind_supported; | |
406 | u32 sp_reserved; | |
407 | u8 reserved2[28]; /* Force signals to begin on 128-byte cache | |
12e364b9 | 408 | * line */ |
d19642f6 BR |
409 | struct signal_queue_header request_queue;/* Service or guest partition |
410 | * uses this queue to send | |
411 | * requests to Control */ | |
412 | struct signal_queue_header response_queue;/* Control uses this queue to | |
413 | * respond to service or guest | |
414 | * partition requests */ | |
415 | struct signal_queue_header event_queue; /* Control uses this queue to | |
12e364b9 KC |
416 | * send events to service or |
417 | * guest partition */ | |
d19642f6 BR |
418 | struct signal_queue_header event_ack_queue;/* Service or guest partition |
419 | * uses this queue to ack | |
420 | * Control events */ | |
12e364b9 KC |
421 | |
422 | /* Request fixed-size message pool - does not include payload */ | |
d19642f6 | 423 | struct controlvm_message request_msg[CONTROLVM_MESSAGE_MAX]; |
12e364b9 KC |
424 | |
425 | /* Response fixed-size message pool - does not include payload */ | |
d19642f6 | 426 | struct controlvm_message response_msg[CONTROLVM_MESSAGE_MAX]; |
12e364b9 KC |
427 | |
428 | /* Event fixed-size message pool - does not include payload */ | |
d19642f6 | 429 | struct controlvm_message event_msg[CONTROLVM_MESSAGE_MAX]; |
12e364b9 KC |
430 | |
431 | /* Ack fixed-size message pool - does not include payload */ | |
d19642f6 | 432 | struct controlvm_message event_ack_msg[CONTROLVM_MESSAGE_MAX]; |
12e364b9 KC |
433 | |
434 | /* Message stored during IOVM creation to be reused after crash */ | |
d19642f6 BR |
435 | struct controlvm_message saved_crash_msg[CONTROLVM_CRASHMSG_MAX]; |
436 | }; | |
12e364b9 | 437 | |
7e5a1a76 | 438 | /* Offsets for VM channel attributes */ |
12e364b9 | 439 | #define VM_CH_REQ_QUEUE_OFFSET \ |
d19642f6 | 440 | offsetof(struct spar_controlvm_channel_protocol, request_queue) |
12e364b9 | 441 | #define VM_CH_RESP_QUEUE_OFFSET \ |
d19642f6 | 442 | offsetof(struct spar_controlvm_channel_protocol, response_queue) |
12e364b9 | 443 | #define VM_CH_EVENT_QUEUE_OFFSET \ |
d19642f6 | 444 | offsetof(struct spar_controlvm_channel_protocol, event_queue) |
12e364b9 | 445 | #define VM_CH_ACK_QUEUE_OFFSET \ |
d19642f6 | 446 | offsetof(struct spar_controlvm_channel_protocol, event_ack_queue) |
12e364b9 | 447 | #define VM_CH_REQ_MSG_OFFSET \ |
d19642f6 | 448 | offsetof(struct spar_controlvm_channel_protocol, request_msg) |
12e364b9 | 449 | #define VM_CH_RESP_MSG_OFFSET \ |
d19642f6 | 450 | offsetof(struct spar_controlvm_channel_protocol, response_msg) |
12e364b9 | 451 | #define VM_CH_EVENT_MSG_OFFSET \ |
d19642f6 | 452 | offsetof(struct spar_controlvm_channel_protocol, event_msg) |
12e364b9 | 453 | #define VM_CH_ACK_MSG_OFFSET \ |
d19642f6 | 454 | offsetof(struct spar_controlvm_channel_protocol, event_ack_msg) |
12e364b9 | 455 | #define VM_CH_CRASH_MSG_OFFSET \ |
d19642f6 | 456 | offsetof(struct spar_controlvm_channel_protocol, saved_crash_msg) |
12e364b9 KC |
457 | |
458 | /* The following header will be located at the beginning of PayloadVmOffset for | |
62420893 BR |
459 | * various ControlVm commands. The receiver of a ControlVm command with a |
460 | * PayloadVmOffset will dereference this address and then use connection_offset, | |
461 | * initiator_offset, and target_offset to get the location of UTF-8 formatted | |
462 | * strings that can be parsed to obtain command-specific information. The value | |
463 | * of total_length should equal PayloadBytes. The format of the strings at | |
464 | * PayloadVmOffset will take different forms depending on the message. | |
12e364b9 | 465 | */ |
62420893 BR |
466 | struct spar_controlvm_parameters_header { |
467 | u32 total_length; | |
468 | u32 header_length; | |
469 | u32 connection_offset; | |
470 | u32 connection_length; | |
471 | u32 initiator_offset; | |
472 | u32 initiator_length; | |
473 | u32 target_offset; | |
474 | u32 target_length; | |
475 | u32 client_offset; | |
476 | u32 client_length; | |
477 | u32 name_offset; | |
478 | u32 name_length; | |
479 | uuid_le id; | |
480 | u32 revision; | |
481 | u32 reserved; /* Natural alignment */ | |
482 | }; | |
12e364b9 KC |
483 | |
484 | #endif /* __CONTROLVMCHANNEL_H__ */ |