1 /* Copyright (C) 2010 - 2013 UNISYS CORPORATION
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.
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
16 #ifndef __CONTROLVMCHANNEL_H__
17 #define __CONTROLVMCHANNEL_H__
19 #include <linux/uuid.h>
20 #include "commontypes.h"
22 #include "controlframework.h"
23 enum { INVALID_GUEST_FIRMWARE
, SAMPLE_GUEST_FIRMWARE
,
24 TIANO32_GUEST_FIRMWARE
, TIANO64_GUEST_FIRMWARE
27 /* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */
28 #define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_GUID \
29 UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \
30 0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
32 static const uuid_le UltraControlvmChannelProtocolGuid
=
33 ULTRA_CONTROLVM_CHANNEL_PROTOCOL_GUID
;
35 #define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE \
36 ULTRA_CHANNEL_PROTOCOL_SIGNATURE
37 #define CONTROLVM_MESSAGE_MAX 64
39 /* Must increment this whenever you insert or delete fields within
40 * this channel struct. Also increment whenever you change the meaning
41 * of fields within this channel struct so as to break pre-existing
42 * software. Note that you can usually add fields to the END of the
43 * channel struct withOUT needing to increment this. */
44 #define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID 1
46 #define ULTRA_CONTROLVM_CHANNEL_OK_CLIENT(pChannel, logCtx) \
47 (ULTRA_check_channel_client(pChannel, \
48 UltraControlvmChannelProtocolGuid, \
50 sizeof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL), \
51 ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \
52 ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE, \
53 __FILE__, __LINE__, logCtx))
54 #define ULTRA_CONTROLVM_CHANNEL_OK_SERVER(actualBytes, logCtx) \
55 (ULTRA_check_channel_server(UltraControlvmChannelProtocolGuid, \
57 sizeof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL), \
58 actualBytes, __FILE__, __LINE__, logCtx))
60 #define MY_DEVICE_INDEX 0
61 #define MAX_MACDATA_LEN 8 /* number of bytes for MAC address in config packet */
62 #define MAX_SERIAL_NUM 32
64 #define DISK_ZERO_PUN_NUMBER 1 /* Target ID on the SCSI bus for LUN 0 */
65 #define DISK_ZERO_LUN_NUMBER 3 /* Logical Unit Number */
67 /* Defines for various channel queues... */
68 #define CONTROLVM_QUEUE_REQUEST 0
69 #define CONTROLVM_QUEUE_RESPONSE 1
70 #define CONTROLVM_QUEUE_EVENT 2
71 #define CONTROLVM_QUEUE_ACK 3
73 /* Max number of messages stored during IOVM creation to be reused
75 #define CONTROLVM_CRASHMSG_MAX 2
77 /** Ids for commands that may appear in either queue of a ControlVm channel.
79 * Commands that are initiated by the command partition (CP), by an IO or
80 * console service partition (SP), or by a guest partition (GP)are:
81 * - issued on the RequestQueue queue (q #0) in the ControlVm channel
82 * - responded to on the ResponseQueue queue (q #1) in the ControlVm channel
84 * Events that are initiated by an IO or console service partition (SP) or
85 * by a guest partition (GP) are:
86 * - issued on the EventQueue queue (q #2) in the ControlVm channel
87 * - responded to on the EventAckQueue queue (q #3) in the ControlVm channel
90 CONTROLVM_INVALID
= 0,
91 /* SWITCH commands required Parameter: SwitchNumber */
92 /* BUS commands required Parameter: BusNumber */
93 CONTROLVM_BUS_CREATE
= 0x101, /* CP --> SP, GP */
94 CONTROLVM_BUS_DESTROY
= 0x102, /* CP --> SP, GP */
95 CONTROLVM_BUS_CONFIGURE
= 0x104, /* CP --> SP */
96 CONTROLVM_BUS_CHANGESTATE
= 0x105, /* CP --> SP, GP */
97 CONTROLVM_BUS_CHANGESTATE_EVENT
= 0x106, /* SP, GP --> CP */
98 /* DEVICE commands required Parameter: BusNumber, DeviceNumber */
100 CONTROLVM_DEVICE_CREATE
= 0x201, /* CP --> SP, GP */
101 CONTROLVM_DEVICE_DESTROY
= 0x202, /* CP --> SP, GP */
102 CONTROLVM_DEVICE_CONFIGURE
= 0x203, /* CP --> SP */
103 CONTROLVM_DEVICE_CHANGESTATE
= 0x204, /* CP --> SP, GP */
104 CONTROLVM_DEVICE_CHANGESTATE_EVENT
= 0x205, /* SP, GP --> CP */
105 CONTROLVM_DEVICE_RECONFIGURE
= 0x206, /* CP --> Boot */
106 /* DISK commands required Parameter: BusNumber, DeviceNumber */
107 CONTROLVM_DISK_CREATE
= 0x221, /* CP --> SP */
108 CONTROLVM_DISK_DESTROY
= 0x222, /* CP --> SP */
109 CONTROLVM_DISK_CONFIGURE
= 0x223, /* CP --> SP */
110 CONTROLVM_DISK_CHANGESTATE
= 0x224, /* CP --> SP */
111 /* CHIPSET commands */
112 CONTROLVM_CHIPSET_INIT
= 0x301, /* CP --> SP, GP */
113 CONTROLVM_CHIPSET_STOP
= 0x302, /* CP --> SP, GP */
114 CONTROLVM_CHIPSET_SHUTDOWN
= 0x303, /* CP --> SP */
115 CONTROLVM_CHIPSET_READY
= 0x304, /* CP --> SP */
116 CONTROLVM_CHIPSET_SELFTEST
= 0x305, /* CP --> SP */
120 struct InterruptInfo
{
121 /**< specifies interrupt info. It is used to send interrupts
122 * for this channel. The peer at the end of this channel
123 * who has registered an interrupt (using recv fields
124 * above) will receive the interrupt. Passed as a parameter
125 * to Issue_VMCALL_IO_QUEUE_TRANSITION, which generates the
126 * interrupt. Currently this is used by IOPart-SP to wake
127 * up GP when Data Channel transitions from empty to
129 U64 sendInterruptHandle
;
131 /**< specifies interrupt handle. It is used to retrieve the
132 * corresponding interrupt pin from Monitor; and the
133 * interrupt pin is used to connect to the corresponding
134 * intrrupt. Used by IOPart-GP only. */
135 U64 recvInterruptHandle
;
137 /**< specifies interrupt vector. It, interrupt pin, and shared are
138 * used to connect to the corresponding interrupt. Used by
140 U32 recvInterruptVector
;
142 /**< specifies if the recvInterrupt is shared. It, interrupt pin
143 * and vector are used to connect to 0 = not shared; 1 = shared.
144 * the corresponding interrupt. Used by IOPart-GP only. */
145 u8 recvInterruptShared
;
146 u8 reserved
[3]; /* Natural alignment purposes */
154 u8 Reserved
[3]; /* Natural alignment purposes */
157 struct PciConfigHdr
{
163 U32 Reserved
; /* Natural alignment purposes */
170 U32 Host
; /* Command should ignore this for *
171 * DiskArrival/RemovalEvents */
179 struct virtDiskInfo
{
180 U32 switchNo
; /* defined by SWITCH_CREATE */
181 U32 externalPortNo
; /* 0 for SAS RAID provided (external)
182 * virtual disks, 1 for virtual disk
183 * images, 2 for gold disk images */
184 U16 VirtualDiskIndex
; /* Index of disk descriptor in the
185 * VirtualDisk segment associated with
192 CONTROLVM_ACTION_NONE
= 0,
193 CONTROLVM_ACTION_SET_RESTORE
= 0x05E7,
194 CONTROLVM_ACTION_CLEAR_RESTORE
= 0x0C18,
195 CONTROLVM_ACTION_RESTORING
= 0x08E5,
196 CONTROLVM_ACTION_RESTORE_BUSY
= 0x0999,
197 CONTROLVM_ACTION_CLEAR_NVRAM
= 0xB01
200 typedef enum _ULTRA_TOOL_ACTIONS
{
201 /* enumeration that defines intended action */
202 ULTRA_TOOL_ACTION_NONE
= 0, /* normal boot of boot disk */
203 ULTRA_TOOL_ACTION_INSTALL
= 1, /* install source disk(s) to boot
205 ULTRA_TOOL_ACTION_CAPTURE
= 2, /* capture boot disk to target disk(s)
207 ULTRA_TOOL_ACTION_REPAIR
= 3, /* use source disk(s) to repair
208 * installation on boot disk */
209 ULTRA_TOOL_ACTION_CLEAN
= 4, /* 'scrub' virtual disk before
210 * releasing back to storage pool */
211 ULTRA_TOOL_ACTION_UPGRADE
= 5, /* upgrade to use content of images
212 * referenced from newer blueprint */
213 ULTRA_TOOL_ACTION_DIAG
= 6, /* use tool to invoke diagnostic script
214 * provided by blueprint */
215 ULTRA_TOOL_ACTION_FAILED
= 7, /* used when tool fails installation
216 and cannot continue */
217 ULTRA_TOOL_ACTION_COUNT
= 8
218 } ULTRA_TOOL_ACTIONS
;
220 typedef struct _ULTRA_EFI_SPAR_INDICATION
{
221 U64 BootToFirmwareUI
:1; /* Bit 0: Stop in uefi ui */
222 U64 ClearNvram
:1; /* Bit 1: Clear NVRAM */
223 U64 ClearCmos
:1; /* Bit 2: Clear CMOS */
224 U64 BootToTool
:1; /* Bit 3: Run install tool */
225 /* remaining bits are available */
226 } ULTRA_EFI_SPAR_INDICATION
;
229 ULTRA_CHIPSET_FEATURE_REPLY
= 0x00000001,
230 ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG
= 0x00000002,
231 ULTRA_CHIPSET_FEATURE_PCIVBUS
= 0x00000004
232 } ULTRA_CHIPSET_FEATURE
;
234 /** This is the common structure that is at the beginning of every
235 * ControlVm message (both commands and responses) in any ControlVm
236 * queue. Commands are easily distinguished from responses by
237 * looking at the flags.response field.
239 typedef struct _CONTROLVM_MESSAGE_HEADER
{
240 U32 Id
; /* See CONTROLVM_ID. */
241 /* For requests, indicates the message type. */
242 /* For responses, indicates the type of message we are responding to. */
244 U32 MessageSize
; /* Includes size of this struct + size
246 U32 SegmentIndex
; /* Index of segment containing Vm
247 * message/information */
248 U32 CompletionStatus
; /* Error status code or result of
249 * message completion */
251 U32 failed
:1; /**< =1 in a response to * signify
253 U32 responseExpected
:1; /**< =1 in all messages that expect a
254 * response (Control ignores this
256 U32 server
:1; /**< =1 in all bus & device-related
257 * messages where the message
258 * receiver is to act as the bus or
260 U32 testMessage
:1; /**< =1 for testing use only
261 * (Control and Command ignore this
263 U32 partialCompletion
:1; /**< =1 if there are forthcoming
264 * responses/acks associated
265 * with this message */
266 U32 preserve
:1; /**< =1 this is to let us know to
267 * preserve channel contents
268 * (for running guests)*/
269 U32 writerInDiag
:1; /**< =1 the DiagWriter is active in the
270 * Diagnostic Partition*/
272 /* remaining bits in this 32-bit word are available */
274 U32 Reserved
; /* Natural alignment */
275 U64 MessageHandle
; /* Identifies the particular message instance,
276 * and is used to match particular */
277 /* request instances with the corresponding response instance. */
278 U64 PayloadVmOffset
; /* Offset of payload area from start of this
279 * instance of ControlVm segment */
280 U32 PayloadMaxBytes
; /* Maximum bytes allocated in payload
281 * area of ControlVm segment */
282 U32 PayloadBytes
; /* Actual number of bytes of payload
283 * area to copy between IO/Command; */
284 /* if non-zero, there is a payload to copy. */
285 } CONTROLVM_MESSAGE_HEADER
;
287 typedef struct _CONTROLVM_PACKET_DEVICE_CREATE
{
288 U32 busNo
; /**< bus # (0..n-1) from the msg receiver's
291 /* Control uses header SegmentIndex field to access bus number... */
292 U32 devNo
; /**< bus-relative (0..n-1) device number */
293 U64 channelAddr
; /**< Guest physical address of the channel, which
294 * can be dereferenced by the receiver
295 * of this ControlVm command */
296 U64 channelBytes
; /**< specifies size of the channel in bytes */
297 uuid_le dataTypeGuid
;/**< specifies format of data in channel */
298 uuid_le devInstGuid
; /**< instance guid for the device */
299 struct InterruptInfo intr
; /**< specifies interrupt information */
300 } CONTROLVM_PACKET_DEVICE_CREATE
; /* for CONTROLVM_DEVICE_CREATE */
302 typedef struct _CONTROLVM_PACKET_DEVICE_CONFIGURE
{
303 U32 busNo
; /**< bus # (0..n-1) from the msg
304 * receiver's perspective */
306 /* Control uses header SegmentIndex field to access bus number... */
307 U32 devNo
; /**< bus-relative (0..n-1) device number */
308 } CONTROLVM_PACKET_DEVICE_CONFIGURE
; /* for CONTROLVM_DEVICE_CONFIGURE */
310 typedef struct _CONTROLVM_MESSAGE_DEVICE_CREATE
{
311 CONTROLVM_MESSAGE_HEADER Header
;
312 CONTROLVM_PACKET_DEVICE_CREATE Packet
;
313 } CONTROLVM_MESSAGE_DEVICE_CREATE
; /* total 128 bytes */
315 typedef struct _CONTROLVM_MESSAGE_DEVICE_CONFIGURE
{
316 CONTROLVM_MESSAGE_HEADER Header
;
317 CONTROLVM_PACKET_DEVICE_CONFIGURE Packet
;
318 } CONTROLVM_MESSAGE_DEVICE_CONFIGURE
; /* total 56 bytes */
320 /* This is the format for a message in any ControlVm queue. */
321 typedef struct _CONTROLVM_MESSAGE_PACKET
{
324 /* BEGIN Request messages */
326 U32 busNo
; /*< bus # (0..n-1) from the msg
327 * receiver's perspective */
329 /* Control uses header SegmentIndex field to access bus number... */
330 U32 deviceCount
; /*< indicates the max number of
331 * devices on this bus */
332 U64 channelAddr
; /*< Guest physical address of the
333 * channel, which can be
334 * dereferenced by the receiver
335 * of this ControlVm command */
336 U64 channelBytes
; /*< size of the channel in bytes */
337 uuid_le busDataTypeGuid
;/*< indicates format of data in
339 uuid_le busInstGuid
; /*< instance guid for the bus */
340 } createBus
; /* for CONTROLVM_BUS_CREATE */
342 U32 busNo
; /*< bus # (0..n-1) from the msg
343 * receiver's perspective */
345 /* Control uses header SegmentIndex field to access bus number... */
346 U32 reserved
; /* Natural alignment purposes */
347 } destroyBus
; /* for CONTROLVM_BUS_DESTROY */
349 U32 busNo
; /*< bus # (0..n-1) from the
353 /* Control uses header SegmentIndex field to access bus number... */
354 U32 reserved1
; /* for alignment purposes */
355 U64 guestHandle
; /* This is used to convert
356 * guest physical address to real
357 * physical address for DMA, for ex. */
358 U64 recvBusInterruptHandle
;/*< specifies interrupt
359 * info. It is used by SP to register
360 * to receive interrupts from the CP.
361 * This interrupt is used for bus
362 * level notifications. The
364 * sendBusInterruptHandle is kept in
366 } configureBus
; /* for CONTROLVM_BUS_CONFIGURE */
368 /* for CONTROLVM_DEVICE_CREATE */
369 CONTROLVM_PACKET_DEVICE_CREATE createDevice
;
371 U32 busNo
; /*< bus # (0..n-1) from the msg
372 * receiver's perspective */
374 /* Control uses header SegmentIndex field to access bus number... */
375 U32 devNo
; /*< bus-relative (0..n-1) device
377 } destroyDevice
; /* for CONTROLVM_DEVICE_DESTROY */
379 /* for CONTROLVM_DEVICE_CONFIGURE */
380 CONTROLVM_PACKET_DEVICE_CONFIGURE configureDevice
;
382 U32 busNo
; /*< bus # (0..n-1) from the msg
383 * receiver's perspective */
385 /* Control uses header SegmentIndex field to access bus number... */
386 U32 devNo
; /*< bus-relative (0..n-1) device
388 } reconfigureDevice
; /* for CONTROLVM_DEVICE_RECONFIGURE */
391 ULTRA_SEGMENT_STATE state
;
392 u8 reserved
[2]; /* Natural alignment purposes */
393 } busChangeState
; /* for CONTROLVM_BUS_CHANGESTATE */
397 ULTRA_SEGMENT_STATE state
;
399 U32 physicalDevice
:1; /* =1 if message is for
400 * a physical device */
401 /* remaining bits in this 32-bit word are available */
403 u8 reserved
[2]; /* Natural alignment purposes */
404 } deviceChangeState
; /* for CONTROLVM_DEVICE_CHANGESTATE */
408 ULTRA_SEGMENT_STATE state
;
409 u8 reserved
[6]; /* Natural alignment purposes */
410 } deviceChangeStateEvent
; /* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
412 U32 busCount
; /*< indicates the max number of busses */
413 U32 switchCount
; /*< indicates the max number of
414 * switches (applicable for service
416 ULTRA_CHIPSET_FEATURE features
;
417 U32 platformNumber
; /* Platform Number */
418 } initChipset
; /* for CONTROLVM_CHIPSET_INIT */
420 U32 Options
; /*< reserved */
421 U32 Test
; /*< bit 0 set to run embedded selftest */
422 } chipsetSelftest
; /* for CONTROLVM_CHIPSET_SELFTEST */
424 /* END Request messages */
426 /* BEGIN Response messages */
428 /* END Response messages */
430 /* BEGIN Event messages */
432 /* END Event messages */
434 /* BEGIN Ack messages */
436 /* END Ack messages */
437 U64 addr
; /*< a physical address of something, that
438 * can be dereferenced by the receiver of
439 * this ControlVm command (depends on
441 U64 handle
; /*< a handle of something (depends on
444 } CONTROLVM_MESSAGE_PACKET
;
446 /* All messages in any ControlVm queue have this layout. */
447 typedef struct _CONTROLVM_MESSAGE
{
448 CONTROLVM_MESSAGE_HEADER hdr
;
449 CONTROLVM_MESSAGE_PACKET cmd
;
452 typedef struct _DEVICE_MAP
{
453 GUEST_PHYSICAL_ADDRESS DeviceChannelAddress
;
454 U64 DeviceChannelSize
;
456 U32 Reserved
; /* natural alignment */
457 U64 Reserved2
; /* Align structure on 32-byte boundary */
460 typedef struct _GUEST_DEVICES
{
461 DEVICE_MAP VideoChannel
;
462 DEVICE_MAP KeyboardChannel
;
463 DEVICE_MAP NetworkChannel
;
464 DEVICE_MAP StorageChannel
;
465 DEVICE_MAP ConsoleChannel
;
470 typedef struct _ULTRA_CONTROLVM_CHANNEL_PROTOCOL
{
471 CHANNEL_HEADER Header
;
472 GUEST_PHYSICAL_ADDRESS gpControlVm
; /* guest physical address of
474 GUEST_PHYSICAL_ADDRESS gpPartitionTables
; /* guest physical address of
475 * partition tables */
476 GUEST_PHYSICAL_ADDRESS gpDiagGuest
; /* guest physical address of
477 * diagnostic channel */
478 GUEST_PHYSICAL_ADDRESS gpBootRomDisk
; /* guest phys addr of (read
479 * only) Boot ROM disk */
480 GUEST_PHYSICAL_ADDRESS gpBootRamDisk
; /* guest phys addr of writable
482 GUEST_PHYSICAL_ADDRESS gpAcpiTable
; /* guest phys addr of acpi
484 GUEST_PHYSICAL_ADDRESS gpControlChannel
; /* guest phys addr of control
486 GUEST_PHYSICAL_ADDRESS gpDiagRomDisk
; /* guest phys addr of diagnostic
488 GUEST_PHYSICAL_ADDRESS gpNvram
; /* guest phys addr of NVRAM
490 U64 RequestPayloadOffset
; /* Offset to request payload area */
491 U64 EventPayloadOffset
; /* Offset to event payload area */
492 U32 RequestPayloadBytes
; /* Bytes available in request payload
494 U32 EventPayloadBytes
; /* Bytes available in event payload area */
495 U32 ControlChannelBytes
;
496 U32 NvramChannelBytes
; /* Bytes in PartitionNvram segment */
497 U32 MessageBytes
; /* sizeof(CONTROLVM_MESSAGE) */
498 U32 MessageCount
; /* CONTROLVM_MESSAGE_MAX */
499 GUEST_PHYSICAL_ADDRESS gpSmbiosTable
; /* guest phys addr of SMBIOS
501 GUEST_PHYSICAL_ADDRESS gpPhysicalSmbiosTable
; /* guest phys addr of
503 /* ULTRA_MAX_GUESTS_PER_SERVICE */
504 GUEST_DEVICES gpObsoleteGuestDevices
[16];
506 /* guest physical address of EFI firmware image base */
507 GUEST_PHYSICAL_ADDRESS VirtualGuestFirmwareImageBase
;
509 /* guest physical address of EFI firmware entry point */
510 GUEST_PHYSICAL_ADDRESS VirtualGuestFirmwareEntryPoint
;
512 /* guest EFI firmware image size */
513 U64 VirtualGuestFirmwareImageSize
;
515 /* GPA = 1MB where EFI firmware image is copied to */
516 GUEST_PHYSICAL_ADDRESS VirtualGuestFirmwareBootBase
;
517 GUEST_PHYSICAL_ADDRESS VirtualGuestImageBase
;
518 GUEST_PHYSICAL_ADDRESS VirtualGuestImageSize
;
519 U64 PrototypeControlChannelOffset
;
520 GUEST_PHYSICAL_ADDRESS VirtualGuestPartitionHandle
;
522 U16 RestoreAction
; /* Restore Action field to restore the guest
524 U16 DumpAction
; /* For Windows guests it shows if the visordisk
525 * is running in dump mode */
527 U16 SavedCrashMsgCount
; /* = CONTROLVM_CRASHMSG_MAX */
528 U32 SavedCrashMsgOffset
; /* Offset to request payload area needed
530 U32 InstallationError
; /* Type of error encountered during
532 U32 InstallationTextId
; /* Id of string to display */
533 U16 InstallationRemainingSteps
; /* Number of remaining installation
534 * steps (for progress bars) */
535 u8 ToolAction
; /* ULTRA_TOOL_ACTIONS Installation Action
537 u8 Reserved
; /* alignment */
538 ULTRA_EFI_SPAR_INDICATION EfiSparIndication
;
539 ULTRA_EFI_SPAR_INDICATION EfiSparIndicationSupported
;
541 u8 Reserved2
[28]; /* Force signals to begin on 128-byte cache
543 SIGNAL_QUEUE_HEADER RequestQueue
; /* Service or guest partition
544 * uses this queue to send
545 * requests to Control */
546 SIGNAL_QUEUE_HEADER ResponseQueue
; /* Control uses this queue to
547 * respond to service or guest
548 * partition requests */
549 SIGNAL_QUEUE_HEADER EventQueue
; /* Control uses this queue to
550 * send events to service or
552 SIGNAL_QUEUE_HEADER EventAckQueue
; /* Service or guest partition
553 * uses this queue to ack
556 /* Request fixed-size message pool - does not include payload */
557 CONTROLVM_MESSAGE RequestMsg
[CONTROLVM_MESSAGE_MAX
];
559 /* Response fixed-size message pool - does not include payload */
560 CONTROLVM_MESSAGE ResponseMsg
[CONTROLVM_MESSAGE_MAX
];
562 /* Event fixed-size message pool - does not include payload */
563 CONTROLVM_MESSAGE EventMsg
[CONTROLVM_MESSAGE_MAX
];
565 /* Ack fixed-size message pool - does not include payload */
566 CONTROLVM_MESSAGE EventAckMsg
[CONTROLVM_MESSAGE_MAX
];
568 /* Message stored during IOVM creation to be reused after crash */
569 CONTROLVM_MESSAGE SavedCrashMsg
[CONTROLVM_CRASHMSG_MAX
];
570 } ULTRA_CONTROLVM_CHANNEL_PROTOCOL
;
572 /* Offsets for VM channel attributes... */
573 #define VM_CH_REQ_QUEUE_OFFSET \
574 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, RequestQueue)
575 #define VM_CH_RESP_QUEUE_OFFSET \
576 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, ResponseQueue)
577 #define VM_CH_EVENT_QUEUE_OFFSET \
578 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventQueue)
579 #define VM_CH_ACK_QUEUE_OFFSET \
580 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventAckQueue)
581 #define VM_CH_REQ_MSG_OFFSET \
582 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, RequestMsg)
583 #define VM_CH_RESP_MSG_OFFSET \
584 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, ResponseMsg)
585 #define VM_CH_EVENT_MSG_OFFSET \
586 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventMsg)
587 #define VM_CH_ACK_MSG_OFFSET \
588 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventAckMsg)
589 #define VM_CH_CRASH_MSG_OFFSET \
590 offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, SavedCrashMsg)
592 /* The following header will be located at the beginning of PayloadVmOffset for
593 * various ControlVm commands. The receiver of a ControlVm command with a
594 * PayloadVmOffset will dereference this address and then use ConnectionOffset,
595 * InitiatorOffset, and TargetOffset to get the location of UTF-8 formatted
596 * strings that can be parsed to obtain command-specific information. The value
597 * of TotalLength should equal PayloadBytes. The format of the strings at
598 * PayloadVmOffset will take different forms depending on the message. See the
599 * following Wiki page for more information:
600 * https://ustr-linux-1.na.uis.unisys.com/spar/index.php/ControlVm_Parameters_Area
602 typedef struct _ULTRA_CONTROLVM_PARAMETERS_HEADER
{
605 U32 ConnectionOffset
;
606 U32 ConnectionLength
;
617 U32 Reserved
; /* Natural alignment */
618 } ULTRA_CONTROLVM_PARAMETERS_HEADER
;
620 #endif /* __CONTROLVMCHANNEL_H__ */