2014-04-23 18:58:34 +00:00
|
|
|
/* Copyright (C) 2010 - 2013 UNISYS CORPORATION
|
2014-03-04 13:58:07 +00:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
|
|
|
* This program is free software; you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation; either version 2 of the License, or (at
|
|
|
|
* your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful, but
|
|
|
|
* WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, GOOD TITLE or
|
|
|
|
* NON INFRINGEMENT. See the GNU General Public License for more
|
|
|
|
* details.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef __CONTROLVMCHANNEL_H__
|
|
|
|
#define __CONTROLVMCHANNEL_H__
|
|
|
|
|
2014-05-06 13:58:23 +00:00
|
|
|
#include <linux/uuid.h>
|
2014-03-04 13:58:07 +00:00
|
|
|
#include "channel.h"
|
|
|
|
#include "controlframework.h"
|
2014-08-03 02:03:40 +00:00
|
|
|
|
|
|
|
typedef u64 GUEST_PHYSICAL_ADDRESS;
|
|
|
|
|
2014-03-04 13:58:07 +00:00
|
|
|
enum { INVALID_GUEST_FIRMWARE, SAMPLE_GUEST_FIRMWARE,
|
|
|
|
TIANO32_GUEST_FIRMWARE, TIANO64_GUEST_FIRMWARE
|
|
|
|
};
|
|
|
|
|
|
|
|
/* {2B3C2D10-7EF5-4ad8-B966-3448B7386B3D} */
|
2014-10-23 18:30:14 +00:00
|
|
|
#define SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID \
|
2014-05-06 13:58:23 +00:00
|
|
|
UUID_LE(0x2b3c2d10, 0x7ef5, 0x4ad8, \
|
|
|
|
0xb9, 0x66, 0x34, 0x48, 0xb7, 0x38, 0x6b, 0x3d)
|
2014-03-04 13:58:07 +00:00
|
|
|
|
2014-10-23 18:30:14 +00:00
|
|
|
static const uuid_le spar_controlvm_channel_protocol_uuid =
|
|
|
|
SPAR_CONTROLVM_CHANNEL_PROTOCOL_UUID;
|
2014-03-04 13:58:07 +00:00
|
|
|
|
|
|
|
#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE \
|
|
|
|
ULTRA_CHANNEL_PROTOCOL_SIGNATURE
|
|
|
|
#define CONTROLVM_MESSAGE_MAX 64
|
|
|
|
|
|
|
|
/* Must increment this whenever you insert or delete fields within
|
|
|
|
* this channel struct. Also increment whenever you change the meaning
|
|
|
|
* of fields within this channel struct so as to break pre-existing
|
|
|
|
* software. Note that you can usually add fields to the END of the
|
|
|
|
* channel struct withOUT needing to increment this. */
|
|
|
|
#define ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID 1
|
|
|
|
|
2014-10-23 18:30:16 +00:00
|
|
|
#define SPAR_CONTROLVM_CHANNEL_OK_CLIENT(ch) \
|
|
|
|
spar_check_channel_client(ch, \
|
|
|
|
spar_controlvm_channel_protocol_uuid, \
|
|
|
|
"controlvm", \
|
|
|
|
sizeof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL), \
|
|
|
|
ULTRA_CONTROLVM_CHANNEL_PROTOCOL_VERSIONID, \
|
|
|
|
ULTRA_CONTROLVM_CHANNEL_PROTOCOL_SIGNATURE)
|
2014-03-04 13:58:07 +00:00
|
|
|
|
|
|
|
#define MY_DEVICE_INDEX 0
|
|
|
|
#define MAX_MACDATA_LEN 8 /* number of bytes for MAC address in config packet */
|
|
|
|
#define MAX_SERIAL_NUM 32
|
|
|
|
|
|
|
|
#define DISK_ZERO_PUN_NUMBER 1 /* Target ID on the SCSI bus for LUN 0 */
|
|
|
|
#define DISK_ZERO_LUN_NUMBER 3 /* Logical Unit Number */
|
|
|
|
|
|
|
|
/* Defines for various channel queues... */
|
|
|
|
#define CONTROLVM_QUEUE_REQUEST 0
|
|
|
|
#define CONTROLVM_QUEUE_RESPONSE 1
|
|
|
|
#define CONTROLVM_QUEUE_EVENT 2
|
|
|
|
#define CONTROLVM_QUEUE_ACK 3
|
|
|
|
|
|
|
|
/* Max number of messages stored during IOVM creation to be reused
|
|
|
|
* after crash */
|
|
|
|
#define CONTROLVM_CRASHMSG_MAX 2
|
|
|
|
|
|
|
|
/** Ids for commands that may appear in either queue of a ControlVm channel.
|
|
|
|
*
|
|
|
|
* Commands that are initiated by the command partition (CP), by an IO or
|
|
|
|
* console service partition (SP), or by a guest partition (GP)are:
|
|
|
|
* - issued on the RequestQueue queue (q #0) in the ControlVm channel
|
|
|
|
* - responded to on the ResponseQueue queue (q #1) in the ControlVm channel
|
|
|
|
*
|
|
|
|
* Events that are initiated by an IO or console service partition (SP) or
|
|
|
|
* by a guest partition (GP) are:
|
|
|
|
* - issued on the EventQueue queue (q #2) in the ControlVm channel
|
|
|
|
* - responded to on the EventAckQueue queue (q #3) in the ControlVm channel
|
|
|
|
*/
|
2014-10-23 18:30:17 +00:00
|
|
|
enum controlvm_id {
|
2014-03-04 13:58:07 +00:00
|
|
|
CONTROLVM_INVALID = 0,
|
|
|
|
/* SWITCH commands required Parameter: SwitchNumber */
|
|
|
|
/* BUS commands required Parameter: BusNumber */
|
|
|
|
CONTROLVM_BUS_CREATE = 0x101, /* CP --> SP, GP */
|
|
|
|
CONTROLVM_BUS_DESTROY = 0x102, /* CP --> SP, GP */
|
|
|
|
CONTROLVM_BUS_CONFIGURE = 0x104, /* CP --> SP */
|
|
|
|
CONTROLVM_BUS_CHANGESTATE = 0x105, /* CP --> SP, GP */
|
|
|
|
CONTROLVM_BUS_CHANGESTATE_EVENT = 0x106, /* SP, GP --> CP */
|
|
|
|
/* DEVICE commands required Parameter: BusNumber, DeviceNumber */
|
|
|
|
|
|
|
|
CONTROLVM_DEVICE_CREATE = 0x201, /* CP --> SP, GP */
|
|
|
|
CONTROLVM_DEVICE_DESTROY = 0x202, /* CP --> SP, GP */
|
|
|
|
CONTROLVM_DEVICE_CONFIGURE = 0x203, /* CP --> SP */
|
|
|
|
CONTROLVM_DEVICE_CHANGESTATE = 0x204, /* CP --> SP, GP */
|
|
|
|
CONTROLVM_DEVICE_CHANGESTATE_EVENT = 0x205, /* SP, GP --> CP */
|
|
|
|
CONTROLVM_DEVICE_RECONFIGURE = 0x206, /* CP --> Boot */
|
|
|
|
/* DISK commands required Parameter: BusNumber, DeviceNumber */
|
|
|
|
CONTROLVM_DISK_CREATE = 0x221, /* CP --> SP */
|
|
|
|
CONTROLVM_DISK_DESTROY = 0x222, /* CP --> SP */
|
|
|
|
CONTROLVM_DISK_CONFIGURE = 0x223, /* CP --> SP */
|
|
|
|
CONTROLVM_DISK_CHANGESTATE = 0x224, /* CP --> SP */
|
|
|
|
/* CHIPSET commands */
|
|
|
|
CONTROLVM_CHIPSET_INIT = 0x301, /* CP --> SP, GP */
|
|
|
|
CONTROLVM_CHIPSET_STOP = 0x302, /* CP --> SP, GP */
|
|
|
|
CONTROLVM_CHIPSET_SHUTDOWN = 0x303, /* CP --> SP */
|
|
|
|
CONTROLVM_CHIPSET_READY = 0x304, /* CP --> SP */
|
|
|
|
CONTROLVM_CHIPSET_SELFTEST = 0x305, /* CP --> SP */
|
|
|
|
|
2014-10-08 01:59:55 +00:00
|
|
|
};
|
2014-03-04 13:58:07 +00:00
|
|
|
|
2014-10-03 18:09:10 +00:00
|
|
|
struct irq_info {
|
2014-03-04 13:58:07 +00:00
|
|
|
/**< specifies interrupt info. It is used to send interrupts
|
|
|
|
* for this channel. The peer at the end of this channel
|
|
|
|
* who has registered an interrupt (using recv fields
|
|
|
|
* above) will receive the interrupt. Passed as a parameter
|
|
|
|
* to Issue_VMCALL_IO_QUEUE_TRANSITION, which generates the
|
|
|
|
* interrupt. Currently this is used by IOPart-SP to wake
|
|
|
|
* up GP when Data Channel transitions from empty to
|
|
|
|
* non-empty.*/
|
2014-10-23 18:30:18 +00:00
|
|
|
u64 send_irq_handle;
|
2014-03-04 13:58:07 +00:00
|
|
|
|
|
|
|
/**< specifies interrupt handle. It is used to retrieve the
|
|
|
|
* corresponding interrupt pin from Monitor; and the
|
|
|
|
* interrupt pin is used to connect to the corresponding
|
|
|
|
* intrrupt. Used by IOPart-GP only. */
|
2014-10-23 18:30:18 +00:00
|
|
|
u64 recv_irq_handle;
|
2014-03-04 13:58:07 +00:00
|
|
|
|
|
|
|
/**< specifies interrupt vector. It, interrupt pin, and shared are
|
|
|
|
* used to connect to the corresponding interrupt. Used by
|
|
|
|
* IOPart-GP only. */
|
2014-10-23 18:30:18 +00:00
|
|
|
u32 recv_irq_vector;
|
2014-03-04 13:58:07 +00:00
|
|
|
|
|
|
|
/**< specifies if the recvInterrupt is shared. It, interrupt pin
|
|
|
|
* and vector are used to connect to 0 = not shared; 1 = shared.
|
|
|
|
* the corresponding interrupt. Used by IOPart-GP only. */
|
2014-10-23 18:30:18 +00:00
|
|
|
u8 recv_irq_shared;
|
2014-07-29 19:09:40 +00:00
|
|
|
u8 reserved[3]; /* Natural alignment purposes */
|
2014-03-04 13:58:07 +00:00
|
|
|
};
|
|
|
|
|
2014-10-03 18:09:09 +00:00
|
|
|
struct pci_id {
|
2014-10-23 18:30:19 +00:00
|
|
|
u16 domain;
|
|
|
|
u8 bus;
|
|
|
|
u8 slot;
|
|
|
|
u8 func;
|
|
|
|
u8 reserved[3]; /* Natural alignment purposes */
|
2014-03-04 13:58:07 +00:00
|
|
|
};
|
|
|
|
|
2014-10-23 18:30:21 +00:00
|
|
|
struct efi_spar_indication {
|
2014-10-23 18:30:22 +00:00
|
|
|
u64 boot_to_fw_ui:1; /* Bit 0: Stop in uefi ui */
|
|
|
|
u64 clear_nvram:1; /* Bit 1: Clear NVRAM */
|
|
|
|
u64 clear_cmos:1; /* Bit 2: Clear CMOS */
|
|
|
|
u64 boot_to_tool:1; /* Bit 3: Run install tool */
|
2014-03-04 13:58:07 +00:00
|
|
|
/* remaining bits are available */
|
2014-10-23 18:30:21 +00:00
|
|
|
};
|
2014-03-04 13:58:07 +00:00
|
|
|
|
2014-10-23 18:30:24 +00:00
|
|
|
enum ultra_chipset_feature {
|
2014-03-04 13:58:07 +00:00
|
|
|
ULTRA_CHIPSET_FEATURE_REPLY = 0x00000001,
|
|
|
|
ULTRA_CHIPSET_FEATURE_PARA_HOTPLUG = 0x00000002,
|
|
|
|
ULTRA_CHIPSET_FEATURE_PCIVBUS = 0x00000004
|
2014-10-23 18:30:24 +00:00
|
|
|
};
|
2014-03-04 13:58:07 +00:00
|
|
|
|
|
|
|
/** This is the common structure that is at the beginning of every
|
|
|
|
* ControlVm message (both commands and responses) in any ControlVm
|
|
|
|
* queue. Commands are easily distinguished from responses by
|
|
|
|
* looking at the flags.response field.
|
|
|
|
*/
|
2014-10-23 18:30:26 +00:00
|
|
|
struct controlvm_message_header {
|
|
|
|
u32 id; /* See CONTROLVM_ID. */
|
2014-03-04 13:58:07 +00:00
|
|
|
/* For requests, indicates the message type. */
|
|
|
|
/* For responses, indicates the type of message we are responding to. */
|
|
|
|
|
2014-10-23 18:30:26 +00:00
|
|
|
u32 message_size; /* Includes size of this struct + size
|
2014-03-04 13:58:07 +00:00
|
|
|
* of message */
|
2014-10-23 18:30:26 +00:00
|
|
|
u32 segment_index; /* Index of segment containing Vm
|
2014-03-04 13:58:07 +00:00
|
|
|
* message/information */
|
2014-10-23 18:30:26 +00:00
|
|
|
u32 completion_status; /* Error status code or result of
|
2014-03-04 13:58:07 +00:00
|
|
|
* message completion */
|
|
|
|
struct {
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 failed:1; /**< =1 in a response to * signify
|
2014-03-04 13:58:07 +00:00
|
|
|
* failure */
|
2014-10-23 18:30:26 +00:00
|
|
|
u32 response_expected:1; /**< =1 in all messages that expect a
|
2014-03-04 13:58:07 +00:00
|
|
|
* response (Control ignores this
|
|
|
|
* bit) */
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 server:1; /**< =1 in all bus & device-related
|
2014-03-04 13:58:07 +00:00
|
|
|
* messages where the message
|
|
|
|
* receiver is to act as the bus or
|
|
|
|
* device server */
|
2014-10-23 18:30:26 +00:00
|
|
|
u32 test_message:1; /**< =1 for testing use only
|
2014-03-04 13:58:07 +00:00
|
|
|
* (Control and Command ignore this
|
|
|
|
* bit) */
|
2014-10-23 18:30:26 +00:00
|
|
|
u32 partial_completion:1; /**< =1 if there are forthcoming
|
2014-03-04 13:58:07 +00:00
|
|
|
* responses/acks associated
|
|
|
|
* with this message */
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 preserve:1; /**< =1 this is to let us know to
|
2014-03-04 13:58:07 +00:00
|
|
|
* preserve channel contents
|
|
|
|
* (for running guests)*/
|
2014-10-23 18:30:26 +00:00
|
|
|
u32 writer_in_diag:1; /**< =1 the DiagWriter is active in the
|
2014-03-04 13:58:07 +00:00
|
|
|
* Diagnostic Partition*/
|
2014-10-23 18:30:26 +00:00
|
|
|
} flags;
|
|
|
|
u32 reserved; /* Natural alignment */
|
|
|
|
u64 message_handle; /* Identifies the particular message instance,
|
2014-03-04 13:58:07 +00:00
|
|
|
* and is used to match particular */
|
|
|
|
/* request instances with the corresponding response instance. */
|
2014-10-23 18:30:26 +00:00
|
|
|
u64 payload_vm_offset; /* Offset of payload area from start of this
|
2014-03-04 13:58:07 +00:00
|
|
|
* instance of ControlVm segment */
|
2014-10-23 18:30:26 +00:00
|
|
|
u32 payload_max_bytes; /* Maximum bytes allocated in payload
|
2014-03-04 13:58:07 +00:00
|
|
|
* area of ControlVm segment */
|
2014-10-23 18:30:26 +00:00
|
|
|
u32 payload_bytes; /* Actual number of bytes of payload
|
2014-03-04 13:58:07 +00:00
|
|
|
* area to copy between IO/Command; */
|
|
|
|
/* if non-zero, there is a payload to copy. */
|
2014-10-23 18:30:26 +00:00
|
|
|
};
|
2014-03-04 13:58:07 +00:00
|
|
|
|
2014-10-23 18:30:27 +00:00
|
|
|
struct controlvm_packet_device_create {
|
|
|
|
u32 bus_no; /* bus # (0..n-1) from the msg receiver's end */
|
|
|
|
u32 dev_no; /* bus-relative (0..n-1) device number */
|
|
|
|
u64 channel_addr; /* Guest physical address of the channel, which
|
|
|
|
* can be dereferenced by the receiver of this
|
|
|
|
* ControlVm command */
|
|
|
|
u64 channel_bytes; /* specifies size of the channel in bytes */
|
|
|
|
uuid_le data_type_uuid; /* specifies format of data in channel */
|
|
|
|
uuid_le dev_inst_uuid; /* instance guid for the device */
|
|
|
|
struct irq_info intr; /* specifies interrupt information */
|
|
|
|
}; /* for CONTROLVM_DEVICE_CREATE */
|
2014-03-04 13:58:07 +00:00
|
|
|
|
2014-10-23 18:30:28 +00:00
|
|
|
struct controlvm_packet_device_configure {
|
|
|
|
u32 bus_no; /**< bus # (0..n-1) from the msg
|
2014-03-04 13:58:07 +00:00
|
|
|
* receiver's perspective */
|
|
|
|
|
|
|
|
/* Control uses header SegmentIndex field to access bus number... */
|
2014-10-23 18:30:28 +00:00
|
|
|
u32 dev_no; /**< bus-relative (0..n-1) device number */
|
|
|
|
} ; /* for CONTROLVM_DEVICE_CONFIGURE */
|
2014-03-04 13:58:07 +00:00
|
|
|
|
2014-10-23 18:30:29 +00:00
|
|
|
struct controlvm_message_device_create {
|
|
|
|
struct controlvm_message_header header;
|
|
|
|
struct controlvm_packet_device_create packet;
|
|
|
|
}; /* total 128 bytes */
|
2014-03-04 13:58:07 +00:00
|
|
|
|
|
|
|
typedef struct _CONTROLVM_MESSAGE_DEVICE_CONFIGURE {
|
2014-10-23 18:30:26 +00:00
|
|
|
struct controlvm_message_header Header;
|
2014-10-23 18:30:28 +00:00
|
|
|
struct controlvm_packet_device_configure Packet;
|
2014-03-04 13:58:07 +00:00
|
|
|
} CONTROLVM_MESSAGE_DEVICE_CONFIGURE; /* total 56 bytes */
|
|
|
|
|
|
|
|
/* This is the format for a message in any ControlVm queue. */
|
2014-10-23 18:30:25 +00:00
|
|
|
struct controlvm_message_packet {
|
2014-03-04 13:58:07 +00:00
|
|
|
union {
|
|
|
|
struct {
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 bus_no; /* bus # (0..n-1) from the msg
|
|
|
|
* receiver's perspective */
|
|
|
|
u32 dev_count; /* indicates the max number of
|
|
|
|
* devices on this bus */
|
|
|
|
u64 channel_addr; /* Guest physical address of
|
|
|
|
* the channel, which can be
|
|
|
|
* dereferenced by the receiver
|
|
|
|
* of this ControlVm command */
|
|
|
|
u64 channel_bytes; /* size of the channel */
|
|
|
|
uuid_le bus_data_type_uuid; /* indicates format of
|
|
|
|
* data in bus channel*/
|
|
|
|
uuid_le bus_inst_uuid; /* instance uuid for the bus */
|
|
|
|
} create_bus; /* for CONTROLVM_BUS_CREATE */
|
2014-03-04 13:58:07 +00:00
|
|
|
struct {
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 bus_no; /* bus # (0..n-1) from the msg
|
|
|
|
* receiver's perspective */
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 reserved; /* Natural alignment purposes */
|
2014-10-23 18:30:25 +00:00
|
|
|
} destroy_bus; /* for CONTROLVM_BUS_DESTROY */
|
2014-03-04 13:58:07 +00:00
|
|
|
struct {
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 bus_no; /* bus # (0..n-1) from the receiver's
|
|
|
|
* perspective */
|
|
|
|
u32 reserved1; /* for alignment purposes */
|
|
|
|
u64 guest_handle; /* This is used to convert
|
|
|
|
* guest physical address to
|
|
|
|
* physical address */
|
|
|
|
u64 recv_bus_irq_handle;
|
|
|
|
/* specifies interrupt info. It is used by SP
|
|
|
|
* to register to receive interrupts from the
|
|
|
|
* CP. This interrupt is used for bus level
|
|
|
|
* notifications. The corresponding
|
|
|
|
* sendBusInterruptHandle is kept in CP. */
|
|
|
|
} configure_bus; /* for CONTROLVM_BUS_CONFIGURE */
|
2014-03-04 13:58:07 +00:00
|
|
|
/* for CONTROLVM_DEVICE_CREATE */
|
2014-10-23 18:30:27 +00:00
|
|
|
struct controlvm_packet_device_create create_device;
|
2014-03-04 13:58:07 +00:00
|
|
|
struct {
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 bus_no; /* bus # (0..n-1) from the msg
|
|
|
|
* receiver's perspective */
|
|
|
|
u32 dev_no; /* bus-relative (0..n-1) device # */
|
|
|
|
} destroy_device; /* for CONTROLVM_DEVICE_DESTROY */
|
2014-03-04 13:58:07 +00:00
|
|
|
/* for CONTROLVM_DEVICE_CONFIGURE */
|
2014-10-23 18:30:28 +00:00
|
|
|
struct controlvm_packet_device_configure configure_device;
|
2014-03-04 13:58:07 +00:00
|
|
|
struct {
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 bus_no; /* bus # (0..n-1) from the msg
|
|
|
|
* receiver's perspective */
|
|
|
|
u32 dev_no; /* bus-relative (0..n-1) device # */
|
|
|
|
} reconfigure_device; /* for CONTROLVM_DEVICE_RECONFIGURE */
|
2014-03-04 13:58:07 +00:00
|
|
|
struct {
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 bus_no;
|
2014-10-23 18:30:12 +00:00
|
|
|
struct spar_segment_state state;
|
2014-07-29 19:09:40 +00:00
|
|
|
u8 reserved[2]; /* Natural alignment purposes */
|
2014-10-23 18:30:25 +00:00
|
|
|
} bus_change_state; /* for CONTROLVM_BUS_CHANGESTATE */
|
2014-03-04 13:58:07 +00:00
|
|
|
struct {
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 bus_no;
|
|
|
|
u32 dev_no;
|
2014-10-23 18:30:12 +00:00
|
|
|
struct spar_segment_state state;
|
2014-03-04 13:58:07 +00:00
|
|
|
struct {
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 phys_device:1; /* =1 if message is for
|
2014-03-04 13:58:07 +00:00
|
|
|
* a physical device */
|
|
|
|
} flags;
|
2014-07-29 19:09:40 +00:00
|
|
|
u8 reserved[2]; /* Natural alignment purposes */
|
2014-10-23 18:30:25 +00:00
|
|
|
} device_change_state; /* for CONTROLVM_DEVICE_CHANGESTATE */
|
2014-03-04 13:58:07 +00:00
|
|
|
struct {
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 bus_no;
|
|
|
|
u32 dev_no;
|
2014-10-23 18:30:12 +00:00
|
|
|
struct spar_segment_state state;
|
2014-07-29 19:09:40 +00:00
|
|
|
u8 reserved[6]; /* Natural alignment purposes */
|
2014-10-23 18:30:25 +00:00
|
|
|
} device_change_state_event;
|
|
|
|
/* for CONTROLVM_DEVICE_CHANGESTATE_EVENT */
|
2014-03-04 13:58:07 +00:00
|
|
|
struct {
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 bus_count; /* indicates the max number of busses */
|
|
|
|
u32 switch_count; /* indicates the max number of
|
|
|
|
* switches if a service partition */
|
2014-10-23 18:30:24 +00:00
|
|
|
enum ultra_chipset_feature features;
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 platform_number; /* Platform Number */
|
|
|
|
} init_chipset; /* for CONTROLVM_CHIPSET_INIT */
|
2014-03-04 13:58:07 +00:00
|
|
|
struct {
|
2014-10-23 18:30:25 +00:00
|
|
|
u32 options; /* reserved */
|
|
|
|
u32 test; /* bit 0 set to run embedded selftest */
|
|
|
|
} chipset_selftest; /* for CONTROLVM_CHIPSET_SELFTEST */
|
|
|
|
u64 addr; /* a physical address of something, that can be
|
|
|
|
* dereferenced by the receiver of this
|
|
|
|
* ControlVm command (depends on command id) */
|
|
|
|
u64 handle; /* a handle of something (depends on command
|
|
|
|
* id) */
|
2014-03-04 13:58:07 +00:00
|
|
|
};
|
2014-10-23 18:30:25 +00:00
|
|
|
};
|
2014-03-04 13:58:07 +00:00
|
|
|
|
|
|
|
/* All messages in any ControlVm queue have this layout. */
|
|
|
|
typedef struct _CONTROLVM_MESSAGE {
|
2014-10-23 18:30:26 +00:00
|
|
|
struct controlvm_message_header hdr;
|
2014-10-23 18:30:25 +00:00
|
|
|
struct controlvm_message_packet cmd;
|
2014-03-04 13:58:07 +00:00
|
|
|
} CONTROLVM_MESSAGE;
|
|
|
|
|
|
|
|
typedef struct _DEVICE_MAP {
|
|
|
|
GUEST_PHYSICAL_ADDRESS DeviceChannelAddress;
|
2014-07-31 16:00:51 +00:00
|
|
|
u64 DeviceChannelSize;
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 CA_Index;
|
|
|
|
u32 Reserved; /* natural alignment */
|
2014-07-31 16:00:51 +00:00
|
|
|
u64 Reserved2; /* Align structure on 32-byte boundary */
|
2014-03-04 13:58:07 +00:00
|
|
|
} DEVICE_MAP;
|
|
|
|
|
|
|
|
typedef struct _GUEST_DEVICES {
|
|
|
|
DEVICE_MAP VideoChannel;
|
|
|
|
DEVICE_MAP KeyboardChannel;
|
|
|
|
DEVICE_MAP NetworkChannel;
|
|
|
|
DEVICE_MAP StorageChannel;
|
|
|
|
DEVICE_MAP ConsoleChannel;
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 PartitionIndex;
|
|
|
|
u32 Pad;
|
2014-03-04 13:58:07 +00:00
|
|
|
} GUEST_DEVICES;
|
|
|
|
|
|
|
|
typedef struct _ULTRA_CONTROLVM_CHANNEL_PROTOCOL {
|
2014-10-23 18:29:55 +00:00
|
|
|
struct channel_header Header;
|
2014-03-04 13:58:07 +00:00
|
|
|
GUEST_PHYSICAL_ADDRESS gpControlVm; /* guest physical address of
|
|
|
|
* this channel */
|
|
|
|
GUEST_PHYSICAL_ADDRESS gpPartitionTables; /* guest physical address of
|
|
|
|
* partition tables */
|
|
|
|
GUEST_PHYSICAL_ADDRESS gpDiagGuest; /* guest physical address of
|
|
|
|
* diagnostic channel */
|
|
|
|
GUEST_PHYSICAL_ADDRESS gpBootRomDisk; /* guest phys addr of (read
|
|
|
|
* only) Boot ROM disk */
|
|
|
|
GUEST_PHYSICAL_ADDRESS gpBootRamDisk; /* guest phys addr of writable
|
|
|
|
* Boot RAM disk */
|
|
|
|
GUEST_PHYSICAL_ADDRESS gpAcpiTable; /* guest phys addr of acpi
|
|
|
|
* table */
|
|
|
|
GUEST_PHYSICAL_ADDRESS gpControlChannel; /* guest phys addr of control
|
|
|
|
* channel */
|
|
|
|
GUEST_PHYSICAL_ADDRESS gpDiagRomDisk; /* guest phys addr of diagnostic
|
|
|
|
* ROM disk */
|
|
|
|
GUEST_PHYSICAL_ADDRESS gpNvram; /* guest phys addr of NVRAM
|
|
|
|
* channel */
|
2014-07-31 16:00:51 +00:00
|
|
|
u64 RequestPayloadOffset; /* Offset to request payload area */
|
|
|
|
u64 EventPayloadOffset; /* Offset to event payload area */
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 RequestPayloadBytes; /* Bytes available in request payload
|
2014-03-04 13:58:07 +00:00
|
|
|
* area */
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 EventPayloadBytes; /* Bytes available in event payload area */
|
|
|
|
u32 ControlChannelBytes;
|
|
|
|
u32 NvramChannelBytes; /* Bytes in PartitionNvram segment */
|
|
|
|
u32 MessageBytes; /* sizeof(CONTROLVM_MESSAGE) */
|
|
|
|
u32 MessageCount; /* CONTROLVM_MESSAGE_MAX */
|
2014-03-04 13:58:07 +00:00
|
|
|
GUEST_PHYSICAL_ADDRESS gpSmbiosTable; /* guest phys addr of SMBIOS
|
|
|
|
* tables */
|
|
|
|
GUEST_PHYSICAL_ADDRESS gpPhysicalSmbiosTable; /* guest phys addr of
|
|
|
|
* SMBIOS table */
|
|
|
|
/* ULTRA_MAX_GUESTS_PER_SERVICE */
|
|
|
|
GUEST_DEVICES gpObsoleteGuestDevices[16];
|
|
|
|
|
|
|
|
/* guest physical address of EFI firmware image base */
|
|
|
|
GUEST_PHYSICAL_ADDRESS VirtualGuestFirmwareImageBase;
|
|
|
|
|
|
|
|
/* guest physical address of EFI firmware entry point */
|
|
|
|
GUEST_PHYSICAL_ADDRESS VirtualGuestFirmwareEntryPoint;
|
|
|
|
|
|
|
|
/* guest EFI firmware image size */
|
2014-07-31 16:00:51 +00:00
|
|
|
u64 VirtualGuestFirmwareImageSize;
|
2014-03-04 13:58:07 +00:00
|
|
|
|
|
|
|
/* GPA = 1MB where EFI firmware image is copied to */
|
|
|
|
GUEST_PHYSICAL_ADDRESS VirtualGuestFirmwareBootBase;
|
|
|
|
GUEST_PHYSICAL_ADDRESS VirtualGuestImageBase;
|
|
|
|
GUEST_PHYSICAL_ADDRESS VirtualGuestImageSize;
|
2014-07-31 16:00:51 +00:00
|
|
|
u64 PrototypeControlChannelOffset;
|
2014-03-04 13:58:07 +00:00
|
|
|
GUEST_PHYSICAL_ADDRESS VirtualGuestPartitionHandle;
|
|
|
|
|
2014-07-31 16:00:49 +00:00
|
|
|
u16 RestoreAction; /* Restore Action field to restore the guest
|
2014-03-04 13:58:07 +00:00
|
|
|
* partition */
|
2014-07-31 16:00:49 +00:00
|
|
|
u16 DumpAction; /* For Windows guests it shows if the visordisk
|
2014-03-04 13:58:07 +00:00
|
|
|
* is running in dump mode */
|
2014-07-31 16:00:49 +00:00
|
|
|
u16 NvramFailCount;
|
|
|
|
u16 SavedCrashMsgCount; /* = CONTROLVM_CRASHMSG_MAX */
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 SavedCrashMsgOffset; /* Offset to request payload area needed
|
2014-03-04 13:58:07 +00:00
|
|
|
* for crash dump */
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 InstallationError; /* Type of error encountered during
|
2014-03-04 13:58:07 +00:00
|
|
|
* installation */
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 InstallationTextId; /* Id of string to display */
|
2014-07-31 16:00:49 +00:00
|
|
|
u16 InstallationRemainingSteps; /* Number of remaining installation
|
2014-03-04 13:58:07 +00:00
|
|
|
* steps (for progress bars) */
|
2014-07-29 19:09:40 +00:00
|
|
|
u8 ToolAction; /* ULTRA_TOOL_ACTIONS Installation Action
|
2014-03-04 13:58:07 +00:00
|
|
|
* field */
|
2014-07-29 19:09:40 +00:00
|
|
|
u8 Reserved; /* alignment */
|
2014-10-23 18:30:21 +00:00
|
|
|
struct efi_spar_indication EfiSparIndication;
|
|
|
|
struct efi_spar_indication EfiSparIndicationSupported;
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 SPReserved;
|
2014-07-29 19:09:40 +00:00
|
|
|
u8 Reserved2[28]; /* Force signals to begin on 128-byte cache
|
2014-03-04 13:58:07 +00:00
|
|
|
* line */
|
2014-10-23 18:30:03 +00:00
|
|
|
struct signal_queue_header RequestQueue;/* Service or guest partition
|
2014-03-04 13:58:07 +00:00
|
|
|
* uses this queue to send
|
|
|
|
* requests to Control */
|
2014-10-23 18:30:03 +00:00
|
|
|
struct signal_queue_header ResponseQueue;/* Control uses this queue to
|
2014-03-04 13:58:07 +00:00
|
|
|
* respond to service or guest
|
|
|
|
* partition requests */
|
2014-10-23 18:30:03 +00:00
|
|
|
struct signal_queue_header EventQueue; /* Control uses this queue to
|
2014-03-04 13:58:07 +00:00
|
|
|
* send events to service or
|
|
|
|
* guest partition */
|
2014-10-23 18:30:03 +00:00
|
|
|
struct signal_queue_header EventAckQueue;/* Service or guest partition
|
2014-03-04 13:58:07 +00:00
|
|
|
* uses this queue to ack
|
|
|
|
* Control events */
|
|
|
|
|
|
|
|
/* Request fixed-size message pool - does not include payload */
|
|
|
|
CONTROLVM_MESSAGE RequestMsg[CONTROLVM_MESSAGE_MAX];
|
|
|
|
|
|
|
|
/* Response fixed-size message pool - does not include payload */
|
|
|
|
CONTROLVM_MESSAGE ResponseMsg[CONTROLVM_MESSAGE_MAX];
|
|
|
|
|
|
|
|
/* Event fixed-size message pool - does not include payload */
|
|
|
|
CONTROLVM_MESSAGE EventMsg[CONTROLVM_MESSAGE_MAX];
|
|
|
|
|
|
|
|
/* Ack fixed-size message pool - does not include payload */
|
|
|
|
CONTROLVM_MESSAGE EventAckMsg[CONTROLVM_MESSAGE_MAX];
|
|
|
|
|
|
|
|
/* Message stored during IOVM creation to be reused after crash */
|
|
|
|
CONTROLVM_MESSAGE SavedCrashMsg[CONTROLVM_CRASHMSG_MAX];
|
|
|
|
} ULTRA_CONTROLVM_CHANNEL_PROTOCOL;
|
|
|
|
|
|
|
|
/* Offsets for VM channel attributes... */
|
|
|
|
#define VM_CH_REQ_QUEUE_OFFSET \
|
|
|
|
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, RequestQueue)
|
|
|
|
#define VM_CH_RESP_QUEUE_OFFSET \
|
|
|
|
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, ResponseQueue)
|
|
|
|
#define VM_CH_EVENT_QUEUE_OFFSET \
|
|
|
|
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventQueue)
|
|
|
|
#define VM_CH_ACK_QUEUE_OFFSET \
|
|
|
|
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventAckQueue)
|
|
|
|
#define VM_CH_REQ_MSG_OFFSET \
|
|
|
|
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, RequestMsg)
|
|
|
|
#define VM_CH_RESP_MSG_OFFSET \
|
|
|
|
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, ResponseMsg)
|
|
|
|
#define VM_CH_EVENT_MSG_OFFSET \
|
|
|
|
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventMsg)
|
|
|
|
#define VM_CH_ACK_MSG_OFFSET \
|
|
|
|
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, EventAckMsg)
|
|
|
|
#define VM_CH_CRASH_MSG_OFFSET \
|
|
|
|
offsetof(ULTRA_CONTROLVM_CHANNEL_PROTOCOL, SavedCrashMsg)
|
|
|
|
|
|
|
|
/* The following header will be located at the beginning of PayloadVmOffset for
|
|
|
|
* various ControlVm commands. The receiver of a ControlVm command with a
|
|
|
|
* PayloadVmOffset will dereference this address and then use ConnectionOffset,
|
|
|
|
* InitiatorOffset, and TargetOffset to get the location of UTF-8 formatted
|
|
|
|
* strings that can be parsed to obtain command-specific information. The value
|
|
|
|
* of TotalLength should equal PayloadBytes. The format of the strings at
|
|
|
|
* PayloadVmOffset will take different forms depending on the message. See the
|
|
|
|
* following Wiki page for more information:
|
|
|
|
* https://ustr-linux-1.na.uis.unisys.com/spar/index.php/ControlVm_Parameters_Area
|
|
|
|
*/
|
|
|
|
typedef struct _ULTRA_CONTROLVM_PARAMETERS_HEADER {
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 TotalLength;
|
|
|
|
u32 HeaderLength;
|
|
|
|
u32 ConnectionOffset;
|
|
|
|
u32 ConnectionLength;
|
|
|
|
u32 InitiatorOffset;
|
|
|
|
u32 InitiatorLength;
|
|
|
|
u32 TargetOffset;
|
|
|
|
u32 TargetLength;
|
|
|
|
u32 ClientOffset;
|
|
|
|
u32 ClientLength;
|
|
|
|
u32 NameOffset;
|
|
|
|
u32 NameLength;
|
2014-05-06 13:58:23 +00:00
|
|
|
uuid_le Id;
|
2014-07-31 16:00:50 +00:00
|
|
|
u32 Revision;
|
|
|
|
u32 Reserved; /* Natural alignment */
|
2014-03-04 13:58:07 +00:00
|
|
|
} ULTRA_CONTROLVM_PARAMETERS_HEADER;
|
|
|
|
|
|
|
|
#endif /* __CONTROLVMCHANNEL_H__ */
|