2015-07-16 10:40:48 -06:00
|
|
|
/* Copyright (C) 2010 - 2015 UNISYS CORPORATION
|
2014-03-04 06:58:07 -07:00
|
|
|
* All rights reserved.
|
|
|
|
*
|
2015-07-16 10:40:48 -06:00
|
|
|
* This program is free software; you can redistribute it and/or modify it
|
|
|
|
* under the terms and conditions of the GNU General Public License,
|
|
|
|
* version 2, as published by the Free Software Foundation.
|
2014-03-04 06:58:07 -07:00
|
|
|
*
|
|
|
|
* 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 __IOMONINTF_H__
|
|
|
|
#define __IOMONINTF_H__
|
|
|
|
|
|
|
|
/*
|
|
|
|
* This file contains all structures needed to support the VMCALLs for IO
|
|
|
|
* Virtualization. The VMCALLs are provided by Monitor and used by IO code
|
|
|
|
* running on IO Partitions.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#include "iovmcall_gnuc.h"
|
|
|
|
#endif /* */
|
|
|
|
#include "diagchannel.h"
|
|
|
|
|
|
|
|
#ifdef VMCALL_IO_CONTROLVM_ADDR
|
|
|
|
#undef VMCALL_IO_CONTROLVM_ADDR
|
|
|
|
#endif /* */
|
|
|
|
|
|
|
|
/* define subsystem number for AppOS, used in uislib driver */
|
2014-03-13 14:39:19 -06:00
|
|
|
#define MDS_APPOS 0x4000000000000000L /* subsystem = 62 - AppOS */
|
2014-10-23 12:29:44 -06:00
|
|
|
enum vmcall_monitor_interface_method_tuple { /* VMCALL identification tuples */
|
2014-03-04 06:58:07 -07:00
|
|
|
/* Note: when a new VMCALL is added:
|
|
|
|
* - the 1st 2 hex digits correspond to one of the
|
|
|
|
* VMCALL_MONITOR_INTERFACE types and
|
|
|
|
* - the next 2 hex digits are the nth relative instance of within a
|
|
|
|
* type
|
|
|
|
* E.G. for VMCALL_VIRTPART_RECYCLE_PART,
|
|
|
|
* - the 0x02 identifies it as a VMCALL_VIRTPART type and
|
|
|
|
* - the 0x01 identifies it as the 1st instance of a VMCALL_VIRTPART
|
|
|
|
* type of VMCALL
|
|
|
|
*/
|
2015-11-17 11:34:56 -07:00
|
|
|
/* used by all Guests, not just IO */
|
|
|
|
VMCALL_IO_CONTROLVM_ADDR = 0x0501,
|
|
|
|
/* Allow caller to query virtual time offset */
|
|
|
|
VMCALL_QUERY_GUEST_VIRTUAL_TIME_OFFSET = 0x0708,
|
|
|
|
/* LOGEVENT Post Code (RDX) with specified subsystem mask */
|
|
|
|
/* (RCX - monitor_subsystems.h) and severity (RDX) */
|
|
|
|
VMCALL_POST_CODE_LOGEVENT = 0x070B,
|
|
|
|
/* Allow ULTRA_SERVICE_CAPABILITY_TIME capable guest to make VMCALL */
|
|
|
|
VMCALL_UPDATE_PHYSICAL_TIME = 0x0a02
|
2014-10-23 12:29:44 -06:00
|
|
|
};
|
2014-03-04 06:58:07 -07:00
|
|
|
|
|
|
|
#define VMCALL_SUCCESS 0
|
|
|
|
#define VMCALL_SUCCESSFUL(result) (result == 0)
|
|
|
|
|
|
|
|
#ifdef __GNUC__
|
|
|
|
#define unisys_vmcall(tuple, reg_ebx, reg_ecx) \
|
|
|
|
__unisys_vmcall_gnuc(tuple, reg_ebx, reg_ecx)
|
|
|
|
#define unisys_extended_vmcall(tuple, reg_ebx, reg_ecx, reg_edx) \
|
|
|
|
__unisys_extended_vmcall_gnuc(tuple, reg_ebx, reg_ecx, reg_edx)
|
2014-10-23 12:29:45 -06:00
|
|
|
#define ISSUE_IO_VMCALL(method, param, result) \
|
|
|
|
(result = unisys_vmcall(method, (param) & 0xFFFFFFFF, \
|
2014-03-04 06:58:07 -07:00
|
|
|
(param) >> 32))
|
2015-02-10 04:39:43 -07:00
|
|
|
#define ISSUE_IO_EXTENDED_VMCALL(method, param1, param2, param3) \
|
|
|
|
unisys_extended_vmcall(method, param1, param2, param3)
|
2014-03-04 06:58:07 -07:00
|
|
|
|
|
|
|
/* The following uses VMCALL_POST_CODE_LOGEVENT interface but is currently
|
2015-11-17 11:34:56 -07:00
|
|
|
* not used much
|
|
|
|
*/
|
2014-03-04 06:58:07 -07:00
|
|
|
#define ISSUE_IO_VMCALL_POSTCODE_SEVERITY(postcode, severity) \
|
|
|
|
ISSUE_IO_EXTENDED_VMCALL(VMCALL_POST_CODE_LOGEVENT, severity, \
|
2015-05-13 11:22:02 -06:00
|
|
|
MDS_APPOS, postcode)
|
2014-03-04 06:58:07 -07:00
|
|
|
#endif
|
|
|
|
|
|
|
|
/* Structures for IO VMCALLs */
|
|
|
|
|
|
|
|
/* Parameters to VMCALL_IO_CONTROLVM_ADDR interface */
|
2014-10-03 12:09:13 -06:00
|
|
|
struct vmcall_io_controlvm_addr_params {
|
2015-11-17 11:34:56 -07:00
|
|
|
/* The Guest-relative physical address of the ControlVm channel. */
|
|
|
|
/* This VMCall fills this in with the appropriate address. */
|
2014-10-03 12:09:13 -06:00
|
|
|
u64 address; /* contents provided by this VMCALL (OUT) */
|
2015-11-17 11:34:56 -07:00
|
|
|
/* the size of the ControlVm channel in bytes This VMCall fills this */
|
|
|
|
/* in with the appropriate address. */
|
2014-10-03 12:09:13 -06:00
|
|
|
u32 channel_bytes; /* contents provided by this VMCALL (OUT) */
|
|
|
|
u8 unused[4]; /* Unused Bytes in the 64-Bit Aligned Struct */
|
2015-10-13 09:37:23 -06:00
|
|
|
} __packed;
|
2014-03-04 06:58:07 -07:00
|
|
|
|
|
|
|
#endif /* __IOMONINTF_H__ */
|