summaryrefslogtreecommitdiffstats
path: root/drivers/staging/unisys/visorbus/vmcallinterface.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/staging/unisys/visorbus/vmcallinterface.h')
-rw-r--r--drivers/staging/unisys/visorbus/vmcallinterface.h149
1 files changed, 13 insertions, 136 deletions
diff --git a/drivers/staging/unisys/visorbus/vmcallinterface.h b/drivers/staging/unisys/visorbus/vmcallinterface.h
index d1d72c1..cc70e1b 100644
--- a/drivers/staging/unisys/visorbus/vmcallinterface.h
+++ b/drivers/staging/unisys/visorbus/vmcallinterface.h
@@ -12,54 +12,9 @@
* details.
*/
-#ifndef __IOMONINTF_H__
-#define __IOMONINTF_H__
+#ifndef __VMCALLINTERFACE_H__
+#define __VMCALLINTERFACE_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.
- */
-static inline unsigned long
-__unisys_vmcall_gnuc(unsigned long tuple, unsigned long reg_ebx,
- unsigned long reg_ecx)
-{
- unsigned long result = 0;
- unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
-
- cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
- if (!(cpuid_ecx & 0x80000000))
- return -EPERM;
-
- __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
- "a"(tuple), "b"(reg_ebx), "c"(reg_ecx));
- return result;
-}
-
-static inline unsigned long
-__unisys_extended_vmcall_gnuc(unsigned long long tuple,
- unsigned long long reg_ebx,
- unsigned long long reg_ecx,
- unsigned long long reg_edx)
-{
- unsigned long result = 0;
- unsigned int cpuid_eax, cpuid_ebx, cpuid_ecx, cpuid_edx;
-
- cpuid(0x00000001, &cpuid_eax, &cpuid_ebx, &cpuid_ecx, &cpuid_edx);
- if (!(cpuid_ecx & 0x80000000))
- return -EPERM;
-
- __asm__ __volatile__(".byte 0x00f, 0x001, 0x0c1" : "=a"(result) :
- "a"(tuple), "b"(reg_ebx), "c"(reg_ecx), "d"(reg_edx));
- return result;
-}
-
-#ifdef VMCALL_IO_CONTROLVM_ADDR
-#undef VMCALL_IO_CONTROLVM_ADDR
-#endif /* */
-
-/* define subsystem number for AppOS, used in uislib driver */
-#define MDS_APPOS 0x4000000000000000L /* subsystem = 62 - AppOS */
enum vmcall_monitor_interface_method_tuple { /* VMCALL identification tuples */
/* Note: when a new VMCALL is added:
* - the 1st 2 hex digits correspond to one of the
@@ -72,30 +27,20 @@ enum vmcall_monitor_interface_method_tuple { /* VMCALL identification tuples */
* type of VMCALL
*/
/* 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
+ VMCALL_CONTROLVM_ADDR = 0x0501,
};
-#define VMCALL_SUCCESS 0
-#define VMCALL_SUCCESSFUL(result) (result == 0)
-
-#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)
-#define ISSUE_IO_VMCALL(method, param, result) \
- (result = unisys_vmcall(method, (param) & 0xFFFFFFFF, \
- (param) >> 32))
+enum vmcall_result {
+ VMCALL_RESULT_SUCCESS = 0,
+ VMCALL_RESULT_INVALID_PARAM = 1,
+ VMCALL_RESULT_DATA_UNAVAILABLE = 2,
+ VMCALL_RESULT_FAILURE_UNAVAILABLE = 3,
+ VMCALL_RESULT_DEVICE_ERROR = 4,
+ VMCALL_RESULT_DEVICE_NOT_READY = 5
+};
/* Structures for IO VMCALLs */
-
-/* Parameters to VMCALL_IO_CONTROLVM_ADDR interface */
+/* Parameters to VMCALL_CONTROLVM_ADDR interface */
struct vmcall_io_controlvm_addr_params {
/* The Guest-relative physical address of the ControlVm channel. */
/* This VMCall fills this in with the appropriate address. */
@@ -106,72 +51,4 @@ struct vmcall_io_controlvm_addr_params {
u8 unused[4]; /* Unused Bytes in the 64-Bit Aligned Struct */
} __packed;
-/******* INFO ON ISSUE_POSTCODE_LINUX() BELOW *******/
-enum driver_pc { /* POSTCODE driver identifier tuples */
- /* visorbus driver files */
- VISOR_BUS_PC = 0xF0,
- VISOR_BUS_PC_visorbus_main_c = 0xFF,
- VISOR_BUS_PC_visorchipset_c = 0xFE,
-};
-
-enum event_pc { /* POSTCODE event identifier tuples */
- BUS_CREATE_ENTRY_PC = 0x001,
- BUS_CREATE_FAILURE_PC = 0x002,
- BUS_CREATE_EXIT_PC = 0x003,
- BUS_CONFIGURE_ENTRY_PC = 0x004,
- BUS_CONFIGURE_FAILURE_PC = 0x005,
- BUS_CONFIGURE_EXIT_PC = 0x006,
- CHIPSET_INIT_ENTRY_PC = 0x007,
- CHIPSET_INIT_SUCCESS_PC = 0x008,
- CHIPSET_INIT_FAILURE_PC = 0x009,
- CHIPSET_INIT_EXIT_PC = 0x00A,
- CONTROLVM_INIT_FAILURE_PC = 0x00B,
- DEVICE_CREATE_ENTRY_PC = 0x00C,
- DEVICE_CREATE_FAILURE_PC = 0x00D,
- DEVICE_CREATE_SUCCESS_PC = 0x00E,
- DEVICE_CREATE_EXIT_PC = 0x00F,
- DEVICE_ADD_PC = 0x010,
- DEVICE_REGISTER_FAILURE_PC = 0x011,
- DEVICE_CHANGESTATE_FAILURE_PC = 0x012,
- DRIVER_ENTRY_PC = 0x013,
- DRIVER_EXIT_PC = 0x014,
- MALLOC_FAILURE_PC = 0x015,
- CRASH_DEV_ENTRY_PC = 0x016,
- CRASH_DEV_EXIT_PC = 0x017,
- CRASH_DEV_RD_BUS_FAILURE_PC = 0x018,
- CRASH_DEV_RD_DEV_FAILURE_PC = 0x019,
- CRASH_DEV_BUS_NULL_FAILURE_PC = 0x01A,
- CRASH_DEV_DEV_NULL_FAILURE_PC = 0x01B,
- CRASH_DEV_CTRL_RD_FAILURE_PC = 0x01C,
- CRASH_DEV_COUNT_FAILURE_PC = 0x01D,
- SAVE_MSG_BUS_FAILURE_PC = 0x01E,
- SAVE_MSG_DEV_FAILURE_PC = 0x01F,
-};
-
-/* Write a 64-bit value to the hypervisor's log file
- * POSTCODE_LINUX generates a value in the form 0xAABBBCCCDDDDEEEE where
- * A is an identifier for the file logging the postcode
- * B is an identifier for the event logging the postcode
- * C is the line logging the postcode
- * D is additional information the caller wants to log
- * E is additional information the caller wants to log
- * Please also note that the resulting postcode is in hex, so if you are
- * searching for the __LINE__ number, convert it first to decimal. The line
- * number combined with driver and type of call, will allow you to track down
- * exactly what line an error occurred on, or where the last driver
- * entered/exited from.
- */
-
-#define POSTCODE_LINUX(EVENT_PC, pc16bit1, pc16bit2, severity) \
-do { \
- unsigned long long post_code_temp; \
- post_code_temp = (((u64)CURRENT_FILE_PC) << 56) | \
- (((u64)EVENT_PC) << 44) | \
- ((((u64)__LINE__) & 0xFFF) << 32) | \
- ((((u64)pc16bit1) & 0xFFFF) << 16) | \
- (((u64)pc16bit2) & 0xFFFF); \
- unisys_extended_vmcall(VMCALL_POST_CODE_LOGEVENT, severity, \
- MDS_APPOS, post_code_temp); \
-} while (0)
-
-#endif /* __IOMONINTF_H__ */
+#endif /* __VMCALLINTERFACE_H__ */
OpenPOWER on IntegriCloud