staging: visorchipset driver to provide registration and other services
[deliverable/linux.git] / drivers / staging / unisys / common-spar / include / channels / controlvmchannel.h
1 /* Copyright © 2010 - 2013 UNISYS CORPORATION
2 * All rights reserved.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation; either version 2 of the License, or (at
7 * your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful, but
10 * WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
12 * NON INFRINGEMENT. See the GNU General Public License for more
13 * details.
14 */
15
16 #ifndef __CONTROLVMCHANNEL_H__
17 #define __CONTROLVMCHANNEL_H__
18
19 #include "commontypes.h"
20 #include "channel.h"
21 #include "controlframework.h"
22 enum { INVALID_GUEST_FIRMWARE, SAMPLE_GUEST_FIRMWARE,
23 TIANO32_GUEST_FIRMWARE, TIANO64_GUEST_FIRMWARE
24 };
25
26 /* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */
27 #define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_GUID \
28 {0x2b3c2d10, 0x7ef5, 0x4ad8, \
29 {0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d} }
30
31 static const GUID UltraControlvmChannelProtocolGuid =
32 ULTRA_CONTROLVM_CHANNEL_PROTOCOL_GUID;
33
34 #define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE \
35 ULTRA_CHANNEL_PROTOCOL_SIGNATURE
36 #define CONTROLVM_MESSAGE_MAX 64
37
38 /* Must increment this whenever you insert or delete fields within
39 * this channel struct. Also increment whenever you change the meaning
40 * of fields within this channel struct so as to break pre-existing
41 * software. Note that you can usually add fields to the END of the
42 * channel struct withOUT needing to increment this. */
43 #define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID 1
44
45 #define ULTRA_CONTROLVM_CHANNEL_OK_CLIENT(pChannel, logCtx) \
46 (ULTRA_check_channel_client(pChannel, \
47 UltraControlvmChannelProtocolGuid, \
48 "controlvm", \
49 sizeof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL), \
50 ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \
51 ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE, \
52 __FILE__, __LINE__, logCtx))
53 #define ULTRA_CONTROLVM_CHANNEL_OK_SERVER(actualBytes, logCtx) \
54 (ULTRA_check_channel_server(UltraControlvmChannelProtocolGuid, \
55 "controlvm", \
56 sizeof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL), \
57 actualBytes, __FILE__, __LINE__, logCtx))
58
59 #define MY_DEVICE_INDEX 0
60 #define MAX_MACDATA_LEN 8 /* number of bytes for MAC address in config packet */
61 #define MAX_SERIAL_NUM 32
62
63 #define DISK_ZERO_PUN_NUMBER 1 /* Target ID on the SCSI bus for LUN 0 */
64 #define DISK_ZERO_LUN_NUMBER 3 /* Logical Unit Number */
65
66 /* Defines for various channel queues... */
67 #define CONTROLVM_QUEUE_REQUEST 0
68 #define CONTROLVM_QUEUE_RESPONSE 1
69 #define CONTROLVM_QUEUE_EVENT 2
70 #define CONTROLVM_QUEUE_ACK 3
71
72 /* Max number of messages stored during IOVM creation to be reused
73 * after crash */
74 #define CONTROLVM_CRASHMSG_MAX 2
75
76 /** Ids for commands that may appear in either queue of a ControlVm channel.
77 *
78 * Commands that are initiated by the command partition (CP), by an IO or
79 * console service partition (SP), or by a guest partition (GP)are:
80 * - issued on the RequestQueue queue (q #0) in the ControlVm channel
81 * - responded to on the ResponseQueue queue (q #1) in the ControlVm channel
82 *
83 * Events that are initiated by an IO or console service partition (SP) or
84 * by a guest partition (GP) are:
85 * - issued on the EventQueue queue (q #2) in the ControlVm channel
86 * - responded to on the EventAckQueue queue (q #3) in the ControlVm channel
87 */
88 typedef enum {
89 CONTROLVM_INVALID = 0,
90 /* SWITCH commands required Parameter: SwitchNumber */
91 /* BUS commands required Parameter: BusNumber */
92 CONTROLVM_BUS_CREATE = 0x101, /* CP --> SP, GP */
93 CONTROLVM_BUS_DESTROY = 0x102, /* CP --> SP, GP */
94 CONTROLVM_BUS_CONFIGURE = 0x104, /* CP --> SP */
95 CONTROLVM_BUS_CHANGESTATE = 0x105, /* CP --> SP, GP */
96 CONTROLVM_BUS_CHANGESTATE_EVENT = 0x106, /* SP, GP --> CP */
97 /* DEVICE commands required Parameter: BusNumber, DeviceNumber */
98
99 CONTROLVM_DEVICE_CREATE = 0x201, /* CP --> SP, GP */
100 CONTROLVM_DEVICE_DESTROY = 0x202, /* CP --> SP, GP */
101 CONTROLVM_DEVICE_CONFIGURE = 0x203, /* CP --> SP */
102 CONTROLVM_DEVICE_CHANGESTATE = 0x204, /* CP --> SP, GP */
103 CONTROLVM_DEVICE_CHANGESTATE_EVENT = 0x205, /* SP, GP --> CP */
104 CONTROLVM_DEVICE_RECONFIGURE = 0x206, /* CP --> Boot */
105 /* DISK commands required Parameter: BusNumber, DeviceNumber */
106 CONTROLVM_DISK_CREATE = 0x221, /* CP --> SP */
107 CONTROLVM_DISK_DESTROY = 0x222, /* CP --> SP */
108 CONTROLVM_DISK_CONFIGURE = 0x223, /* CP --> SP */
109 CONTROLVM_DISK_CHANGESTATE = 0x224, /* CP --> SP */
110 /* CHIPSET commands */
111 CONTROLVM_CHIPSET_INIT = 0x301, /* CP --> SP, GP */
112 CONTROLVM_CHIPSET_STOP = 0x302, /* CP --> SP, GP */
113 CONTROLVM_CHIPSET_SHUTDOWN = 0x303, /* CP --> SP */
114 CONTROLVM_CHIPSET_READY = 0x304, /* CP --> SP */
115 CONTROLVM_CHIPSET_SELFTEST = 0x305, /* CP --> SP */
116
117 } CONTROLVM_ID;
118
119 struct InterruptInfo {
120 /**< specifies interrupt info. It is used to send interrupts
121 * for this channel. The peer at the end of this channel
122 * who has registered an interrupt (using recv fields
123 * above) will receive the interrupt. Passed as a parameter
124 * to Issue_VMCALL_IO_QUEUE_TRANSITION, which generates the
125 * interrupt. Currently this is used by IOPart-SP to wake
126 * up GP when Data Channel transitions from empty to
127 * non-empty.*/
128 U64 sendInterruptHandle;
129
130 /**< specifies interrupt handle. It is used to retrieve the
131 * corresponding interrupt pin from Monitor; and the
132 * interrupt pin is used to connect to the corresponding
133 * intrrupt. Used by IOPart-GP only. */
134 U64 recvInterruptHandle;
135
136 /**< specifies interrupt vector. It, interrupt pin, and shared are
137 * used to connect to the corresponding interrupt. Used by
138 * IOPart-GP only. */
139 U32 recvInterruptVector;
140
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 U8 recvInterruptShared;
145 U8 reserved[3]; /* Natural alignment purposes */
146 };
147
148 struct PciId {
149 U16 Domain;
150 U8 Bus;
151 U8 Slot;
152 U8 Func;
153 U8 Reserved[3]; /* Natural alignment purposes */
154 };
155
156 struct PciConfigHdr {
157 U16 VendorId;
158 U16 SubSysVendor;
159 U16 DeviceId;
160 U16 SubSysDevice;
161 U32 ClassCode;
162 U32 Reserved; /* Natural alignment purposes */
163 };
164
165 struct ScsiId {
166 U32 Bus;
167 U32 Target;
168 U32 Lun;
169 U32 Host; /* Command should ignore this for *
170 * DiskArrival/RemovalEvents */
171 };
172
173 struct WWID {
174 U32 wwid1;
175 U32 wwid2;
176 };
177
178 struct virtDiskInfo {
179 U32 switchNo; /* defined by SWITCH_CREATE */
180 U32 externalPortNo; /* 0 for SAS RAID provided (external)
181 * virtual disks, 1 for virtual disk
182 * images, 2 for gold disk images */
183 U16 VirtualDiskIndex; /* Index of disk descriptor in the
184 * VirtualDisk segment associated with
185 * externalPortNo */
186 U16 Reserved1;
187 U32 Reserved2;
188 };
189
190 typedef enum {
191 CONTROLVM_ACTION_NONE = 0,
192 CONTROLVM_ACTION_SET_RESTORE = 0x05E7,
193 CONTROLVM_ACTION_CLEAR_RESTORE = 0x0C18,
194 CONTROLVM_ACTION_RESTORING = 0x08E5,
195 CONTROLVM_ACTION_RESTORE_BUSY = 0x0999,
196 CONTROLVM_ACTION_CLEAR_NVRAM = 0xB01
197 } CONTROLVM_ACTION;
198
199 typedef enum _ULTRA_TOOL_ACTIONS {
200 /* enumeration that defines intended action */
201 ULTRA_TOOL_ACTION_NONE = 0, /* normal boot of boot disk */
202 ULTRA_TOOL_ACTION_INSTALL = 1, /* install source disk(s) to boot
203 * disk */
204 ULTRA_TOOL_ACTION_CAPTURE = 2, /* capture boot disk to target disk(s)
205 * as 'gold image' */
206 ULTRA_TOOL_ACTION_REPAIR = 3, /* use source disk(s) to repair
207 * installation on boot disk */
208 ULTRA_TOOL_ACTION_CLEAN = 4, /* 'scrub' virtual disk before
209 * releasing back to storage pool */
210 ULTRA_TOOL_ACTION_UPGRADE = 5, /* upgrade to use content of images
211 * referenced from newer blueprint */
212 ULTRA_TOOL_ACTION_DIAG = 6, /* use tool to invoke diagnostic script
213 * provided by blueprint */
214 ULTRA_TOOL_ACTION_FAILED = 7, /* used when tool fails installation
215 and cannot continue */
216 ULTRA_TOOL_ACTION_COUNT = 8
217 } ULTRA_TOOL_ACTIONS;
218
219 typedef struct _ULTRA_EFI_SPAR_INDICATION {
220 U64 BootToFirmwareUI:1; /* Bit 0: Stop in uefi ui */
221 U64 ClearNvram:1; /* Bit 1: Clear NVRAM */
222 U64 ClearCmos:1; /* Bit 2: Clear CMOS */
223 U64 BootToTool:1; /* Bit 3: Run install tool */
224 /* remaining bits are available */
225 } ULTRA_EFI_SPAR_INDICATION;
226
227 typedef enum {
228 ULTRA_CHIPSET_FEATURE_REPLY = 0x00000001,
229 ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG = 0x00000002,
230 ULTRA_CHIPSET_FEATURE_PCIVBUS = 0x00000004
231 } ULTRA_CHIPSET_FEATURE;
232
233 /** This is the common structure that is at the beginning of every
234 * ControlVm message (both commands and responses) in any ControlVm
235 * queue. Commands are easily distinguished from responses by
236 * looking at the flags.response field.
237 */
238 typedef struct _CONTROLVM_MESSAGE_HEADER {
239 U32 Id; /* See CONTROLVM_ID. */
240 /* For requests, indicates the message type. */
241 /* For responses, indicates the type of message we are responding to. */
242
243 U32 MessageSize; /* Includes size of this struct + size
244 * of message */
245 U32 SegmentIndex; /* Index of segment containing Vm
246 * message/information */
247 U32 CompletionStatus; /* Error status code or result of
248 * message completion */
249 struct {
250 U32 failed:1; /**< =1 in a response to * signify
251 * failure */
252 U32 responseExpected:1; /**< =1 in all messages that expect a
253 * response (Control ignores this
254 * bit) */
255 U32 server:1; /**< =1 in all bus & device-related
256 * messages where the message
257 * receiver is to act as the bus or
258 * device server */
259 U32 testMessage:1; /**< =1 for testing use only
260 * (Control and Command ignore this
261 * bit) */
262 U32 partialCompletion:1; /**< =1 if there are forthcoming
263 * responses/acks associated
264 * with this message */
265 U32 preserve:1; /**< =1 this is to let us know to
266 * preserve channel contents
267 * (for running guests)*/
268 U32 writerInDiag:1; /**< =1 the DiagWriter is active in the
269 * Diagnostic Partition*/
270
271 /* remaining bits in this 32-bit word are available */
272 } Flags;
273 U32 Reserved; /* Natural alignment */
274 U64 MessageHandle; /* Identifies the particular message instance,
275 * and is used to match particular */
276 /* request instances with the corresponding response instance. */
277 U64 PayloadVmOffset; /* Offset of payload area from start of this
278 * instance of ControlVm segment */
279 U32 PayloadMaxBytes; /* Maximum bytes allocated in payload
280 * area of ControlVm segment */
281 U32 PayloadBytes; /* Actual number of bytes of payload
282 * area to copy between IO/Command; */
283 /* if non-zero, there is a payload to copy. */
284 } CONTROLVM_MESSAGE_HEADER;
285
286 typedef struct _CONTROLVM_PACKET_DEVICE_CREATE {
287 U32 busNo; /**< bus # (0..n-1) from the msg receiver's
288 * perspective */
289
290 /* Control uses header SegmentIndex field to access bus number... */
291 U32 devNo; /**< bus-relative (0..n-1) device number */
292 U64 channelAddr; /**< Guest physical address of the channel, which
293 * can be dereferenced by the receiver
294 * of this ControlVm command */
295 U64 channelBytes; /**< specifies size of the channel in bytes */
296 GUID dataTypeGuid;/**< specifies format of data in channel */
297 GUID devInstGuid; /**< instance guid for the device */
298 struct InterruptInfo intr; /**< specifies interrupt information */
299 } CONTROLVM_PACKET_DEVICE_CREATE; /* for CONTROLVM_DEVICE_CREATE */
300
301 typedef struct _CONTROLVM_PACKET_DEVICE_CONFIGURE {
302 U32 busNo; /**< bus # (0..n-1) from the msg
303 * receiver's perspective */
304
305 /* Control uses header SegmentIndex field to access bus number... */
306 U32 devNo; /**< bus-relative (0..n-1) device number */
307 } CONTROLVM_PACKET_DEVICE_CONFIGURE; /* for CONTROLVM_DEVICE_CONFIGURE */
308
309 typedef struct _CONTROLVM_MESSAGE_DEVICE_CREATE {
310 CONTROLVM_MESSAGE_HEADER Header;
311 CONTROLVM_PACKET_DEVICE_CREATE Packet;
312 } CONTROLVM_MESSAGE_DEVICE_CREATE; /* total 128 bytes */
313
314 typedef struct _CONTROLVM_MESSAGE_DEVICE_CONFIGURE {
315 CONTROLVM_MESSAGE_HEADER Header;
316 CONTROLVM_PACKET_DEVICE_CONFIGURE Packet;
317 } CONTROLVM_MESSAGE_DEVICE_CONFIGURE; /* total 56 bytes */
318
319 /* This is the format for a message in any ControlVm queue. */
320 typedef struct _CONTROLVM_MESSAGE_PACKET {
321 union {
322
323 /* BEGIN Request messages */
324 struct {
325 U32 busNo; /*< bus # (0..n-1) from the msg
326 * receiver's perspective */
327
328 /* Control uses header SegmentIndex field to access bus number... */
329 U32 deviceCount; /*< indicates the max number of
330 * devices on this bus */
331 U64 channelAddr; /*< Guest physical address of the
332 * channel, which can be
333 * dereferenced by the receiver
334 * of this ControlVm command */
335 U64 channelBytes; /*< size of the channel in bytes */
336 GUID busDataTypeGuid;/*< indicates format of data in bus
337 * channel */
338 GUID busInstGuid; /*< instance guid for the bus */
339 } createBus; /* for CONTROLVM_BUS_CREATE */
340 struct {
341 U32 busNo; /*< bus # (0..n-1) from the msg
342 * receiver's perspective */
343
344 /* Control uses header SegmentIndex field to access bus number... */
345 U32 reserved; /* Natural alignment purposes */
346 } destroyBus; /* for CONTROLVM_BUS_DESTROY */
347 struct {
348 U32 busNo; /*< bus # (0..n-1) from the
349 * msg receiver's
350 * perspective */
351
352 /* Control uses header SegmentIndex field to access bus number... */
353 U32 reserved1; /* for alignment purposes */
354 U64 guestHandle; /* This is used to convert
355 * guest physical address to real
356 * physical address for DMA, for ex. */
357 U64 recvBusInterruptHandle;/*< specifies interrupt
358 * info. It is used by SP to register
359 * to receive interrupts from the CP.
360 * This interrupt is used for bus
361 * level notifications. The
362 * corresponding
363 * sendBusInterruptHandle is kept in
364 * CP. */
365 } configureBus; /* for CONTROLVM_BUS_CONFIGURE */
366
367 /* for CONTROLVM_DEVICE_CREATE */
368 CONTROLVM_PACKET_DEVICE_CREATE createDevice;
369 struct {
370 U32 busNo; /*< bus # (0..n-1) from the msg
371 * receiver's perspective */
372
373 /* Control uses header SegmentIndex field to access bus number... */
374 U32 devNo; /*< bus-relative (0..n-1) device
375 * number */
376 } destroyDevice; /* for CONTROLVM_DEVICE_DESTROY */
377
378 /* for CONTROLVM_DEVICE_CONFIGURE */
379 CONTROLVM_PACKET_DEVICE_CONFIGURE configureDevice;
380 struct {
381 U32 busNo; /*< bus # (0..n-1) from the msg
382 * receiver's perspective */
383
384 /* Control uses header SegmentIndex field to access bus number... */
385 U32 devNo; /*< bus-relative (0..n-1) device
386 * number */
387 } reconfigureDevice; /* for CONTROLVM_DEVICE_RECONFIGURE */
388 struct {
389 U32 busNo;
390 ULTRA_SEGMENT_STATE state;
391 U8 reserved[2]; /* Natural alignment purposes */
392 } busChangeState; /* for CONTROLVM_BUS_CHANGESTATE */
393 struct {
394 U32 busNo;
395 U32 devNo;
396 ULTRA_SEGMENT_STATE state;
397 struct {
398 U32 physicalDevice:1; /* =1 if message is for
399 * a physical device */
400 /* remaining bits in this 32-bit word are available */
401 } flags;
402 U8 reserved[2]; /* Natural alignment purposes */
403 } deviceChangeState; /* for CONTROLVM_DEVICE_CHANGESTATE */
404 struct {
405 U32 busNo;
406 U32 devNo;
407 ULTRA_SEGMENT_STATE state;
408 U8 reserved[6]; /* Natural alignment purposes */
409 } deviceChangeStateEvent; /* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
410 struct {
411 U32 busCount; /*< indicates the max number of busses */
412 U32 switchCount; /*< indicates the max number of
413 * switches (applicable for service
414 * partition only) */
415 ULTRA_CHIPSET_FEATURE features;
416 U32 platformNumber; /* Platform Number */
417 } initChipset; /* for CONTROLVM_CHIPSET_INIT */
418 struct {
419 U32 Options; /*< reserved */
420 U32 Test; /*< bit 0 set to run embedded selftest */
421 } chipsetSelftest; /* for CONTROLVM_CHIPSET_SELFTEST */
422
423 /* END Request messages */
424
425 /* BEGIN Response messages */
426
427 /* END Response messages */
428
429 /* BEGIN Event messages */
430
431 /* END Event messages */
432
433 /* BEGIN Ack messages */
434
435 /* END Ack messages */
436 U64 addr; /*< a physical address of something, that
437 * can be dereferenced by the receiver of
438 * this ControlVm command (depends on
439 * command id) */
440 U64 handle; /*< a handle of something (depends on
441 * command id) */
442 };
443 } CONTROLVM_MESSAGE_PACKET;
444
445 /* All messages in any ControlVm queue have this layout. */
446 typedef struct _CONTROLVM_MESSAGE {
447 CONTROLVM_MESSAGE_HEADER hdr;
448 CONTROLVM_MESSAGE_PACKET cmd;
449 } CONTROLVM_MESSAGE;
450
451 typedef struct _DEVICE_MAP {
452 GUEST_PHYSICAL_ADDRESS DeviceChannelAddress;
453 U64 DeviceChannelSize;
454 U32 CA_Index;
455 U32 Reserved; /* natural alignment */
456 U64 Reserved2; /* Align structure on 32-byte boundary */
457 } DEVICE_MAP;
458
459 typedef struct _GUEST_DEVICES {
460 DEVICE_MAP VideoChannel;
461 DEVICE_MAP KeyboardChannel;
462 DEVICE_MAP NetworkChannel;
463 DEVICE_MAP StorageChannel;
464 DEVICE_MAP ConsoleChannel;
465 U32 PartitionIndex;
466 U32 Pad;
467 } GUEST_DEVICES;
468
469 typedef struct _ULTRA_CONTROLVM_CHANNEL_PROTOCOL {
470 CHANNEL_HEADER Header;
471 GUEST_PHYSICAL_ADDRESS gpControlVm; /* guest physical address of
472 * this channel */
473 GUEST_PHYSICAL_ADDRESS gpPartitionTables; /* guest physical address of
474 * partition tables */
475 GUEST_PHYSICAL_ADDRESS gpDiagGuest; /* guest physical address of
476 * diagnostic channel */
477 GUEST_PHYSICAL_ADDRESS gpBootRomDisk; /* guest phys addr of (read
478 * only) Boot ROM disk */
479 GUEST_PHYSICAL_ADDRESS gpBootRamDisk; /* guest phys addr of writable
480 * Boot RAM disk */
481 GUEST_PHYSICAL_ADDRESS gpAcpiTable; /* guest phys addr of acpi
482 * table */
483 GUEST_PHYSICAL_ADDRESS gpControlChannel; /* guest phys addr of control
484 * channel */
485 GUEST_PHYSICAL_ADDRESS gpDiagRomDisk; /* guest phys addr of diagnostic
486 * ROM disk */
487 GUEST_PHYSICAL_ADDRESS gpNvram; /* guest phys addr of NVRAM
488 * channel */
489 U64 RequestPayloadOffset; /* Offset to request payload area */
490 U64 EventPayloadOffset; /* Offset to event payload area */
491 U32 RequestPayloadBytes; /* Bytes available in request payload
492 * area */
493 U32 EventPayloadBytes; /* Bytes available in event payload area */
494 U32 ControlChannelBytes;
495 U32 NvramChannelBytes; /* Bytes in PartitionNvram segment */
496 U32 MessageBytes; /* sizeof(CONTROLVM_MESSAGE) */
497 U32 MessageCount; /* CONTROLVM_MESSAGE_MAX */
498 GUEST_PHYSICAL_ADDRESS gpSmbiosTable; /* guest phys addr of SMBIOS
499 * tables */
500 GUEST_PHYSICAL_ADDRESS gpPhysicalSmbiosTable; /* guest phys addr of
501 * SMBIOS table */
502 /* ULTRA_MAX_GUESTS_PER_SERVICE */
503 GUEST_DEVICES gpObsoleteGuestDevices[16];
504
505 /* guest physical address of EFI firmware image base */
506 GUEST_PHYSICAL_ADDRESS VirtualGuestFirmwareImageBase;
507
508 /* guest physical address of EFI firmware entry point */
509 GUEST_PHYSICAL_ADDRESS VirtualGuestFirmwareEntryPoint;
510
511 /* guest EFI firmware image size */
512 U64 VirtualGuestFirmwareImageSize;
513
514 /* GPA = 1MB where EFI firmware image is copied to */
515 GUEST_PHYSICAL_ADDRESS VirtualGuestFirmwareBootBase;
516 GUEST_PHYSICAL_ADDRESS VirtualGuestImageBase;
517 GUEST_PHYSICAL_ADDRESS VirtualGuestImageSize;
518 U64 PrototypeControlChannelOffset;
519 GUEST_PHYSICAL_ADDRESS VirtualGuestPartitionHandle;
520
521 U16 RestoreAction; /* Restore Action field to restore the guest
522 * partition */
523 U16 DumpAction; /* For Windows guests it shows if the visordisk
524 * is running in dump mode */
525 U16 NvramFailCount;
526 U16 SavedCrashMsgCount; /* = CONTROLVM_CRASHMSG_MAX */
527 U32 SavedCrashMsgOffset; /* Offset to request payload area needed
528 * for crash dump */
529 U32 InstallationError; /* Type of error encountered during
530 * installation */
531 U32 InstallationTextId; /* Id of string to display */
532 U16 InstallationRemainingSteps; /* Number of remaining installation
533 * steps (for progress bars) */
534 U8 ToolAction; /* ULTRA_TOOL_ACTIONS Installation Action
535 * field */
536 U8 Reserved; /* alignment */
537 ULTRA_EFI_SPAR_INDICATION EfiSparIndication;
538 ULTRA_EFI_SPAR_INDICATION EfiSparIndicationSupported;
539 U32 SPReserved;
540 U8 Reserved2[28]; /* Force signals to begin on 128-byte cache
541 * line */
542 SIGNAL_QUEUE_HEADER RequestQueue; /* Service or guest partition
543 * uses this queue to send
544 * requests to Control */
545 SIGNAL_QUEUE_HEADER ResponseQueue; /* Control uses this queue to
546 * respond to service or guest
547 * partition requests */
548 SIGNAL_QUEUE_HEADER EventQueue; /* Control uses this queue to
549 * send events to service or
550 * guest partition */
551 SIGNAL_QUEUE_HEADER EventAckQueue; /* Service or guest partition
552 * uses this queue to ack
553 * Control events */
554
555 /* Request fixed-size message pool - does not include payload */
556 CONTROLVM_MESSAGE RequestMsg[CONTROLVM_MESSAGE_MAX];
557
558 /* Response fixed-size message pool - does not include payload */
559 CONTROLVM_MESSAGE ResponseMsg[CONTROLVM_MESSAGE_MAX];
560
561 /* Event fixed-size message pool - does not include payload */
562 CONTROLVM_MESSAGE EventMsg[CONTROLVM_MESSAGE_MAX];
563
564 /* Ack fixed-size message pool - does not include payload */
565 CONTROLVM_MESSAGE EventAckMsg[CONTROLVM_MESSAGE_MAX];
566
567 /* Message stored during IOVM creation to be reused after crash */
568 CONTROLVM_MESSAGE SavedCrashMsg[CONTROLVM_CRASHMSG_MAX];
569 } ULTRA_CONTROLVM_CHANNEL_PROTOCOL;
570
571 /* Offsets for VM channel attributes... */
572 #define VM_CH_REQ_QUEUE_OFFSET \
573 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, RequestQueue)
574 #define VM_CH_RESP_QUEUE_OFFSET \
575 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, ResponseQueue)
576 #define VM_CH_EVENT_QUEUE_OFFSET \
577 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventQueue)
578 #define VM_CH_ACK_QUEUE_OFFSET \
579 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventAckQueue)
580 #define VM_CH_REQ_MSG_OFFSET \
581 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, RequestMsg)
582 #define VM_CH_RESP_MSG_OFFSET \
583 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, ResponseMsg)
584 #define VM_CH_EVENT_MSG_OFFSET \
585 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventMsg)
586 #define VM_CH_ACK_MSG_OFFSET \
587 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventAckMsg)
588 #define VM_CH_CRASH_MSG_OFFSET \
589 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, SavedCrashMsg)
590
591 /* The following header will be located at the beginning of PayloadVmOffset for
592 * various ControlVm commands. The receiver of a ControlVm command with a
593 * PayloadVmOffset will dereference this address and then use ConnectionOffset,
594 * InitiatorOffset, and TargetOffset to get the location of UTF-8 formatted
595 * strings that can be parsed to obtain command-specific information. The value
596 * of TotalLength should equal PayloadBytes. The format of the strings at
597 * PayloadVmOffset will take different forms depending on the message. See the
598 * following Wiki page for more information:
599 * https://ustr-linux-1.na.uis.unisys.com/spar/index.php/ControlVm_Parameters_Area
600 */
601 typedef struct _ULTRA_CONTROLVM_PARAMETERS_HEADER {
602 U32 TotalLength;
603 U32 HeaderLength;
604 U32 ConnectionOffset;
605 U32 ConnectionLength;
606 U32 InitiatorOffset;
607 U32 InitiatorLength;
608 U32 TargetOffset;
609 U32 TargetLength;
610 U32 ClientOffset;
611 U32 ClientLength;
612 U32 NameOffset;
613 U32 NameLength;
614 GUID Id;
615 U32 Revision;
616 U32 Reserved; /* Natural alignment */
617 } ULTRA_CONTROLVM_PARAMETERS_HEADER;
618
619 #endif /* __CONTROLVMCHANNEL_H__ */
This page took 0.046379 seconds and 5 git commands to generate.