Go to the documentation of this file. 1 #ifndef _SPARC64_HYPERVISOR_H
2 #define _SPARC64_HYPERVISOR_H
53 #define HV_FAST_TRAP 0x80
54 #define HV_MMU_MAP_ADDR_TRAP 0x83
55 #define HV_MMU_UNMAP_ADDR_TRAP 0x84
56 #define HV_TTRACE_ADDENTRY_TRAP 0x85
57 #define HV_CORE_TRAP 0xff
68 #define HV_EBADALIGN 8
69 #define HV_EWOULDBLOCK 9
70 #define HV_ENOACCESS 10
72 #define HV_ECPUERROR 12
73 #define HV_ENOTSUPPORTED 13
75 #define HV_ETOOMANY 15
76 #define HV_ECHANNEL 16
98 #define HV_FAST_MACH_EXIT 0x00
127 #define HV_FAST_MACH_DESC 0x01
131 unsigned long buf_len,
132 unsigned long *real_buf_len);
148 #define HV_FAST_MACH_SIR 0x02
204 #define HV_FAST_MACH_SET_WATCHDOG 0x05
208 unsigned long *orig_timeout);
250 #define HV_FAST_CPU_START 0x10
278 #define HV_FAST_CPU_STOP 0x11
295 #define HV_FAST_CPU_YIELD 0x12
337 #define HV_FAST_CPU_QCONF 0x14
338 #define HV_CPU_QUEUE_CPU_MONDO 0x3c
339 #define HV_CPU_QUEUE_DEVICE_MONDO 0x3d
340 #define HV_CPU_QUEUE_RES_ERROR 0x3e
341 #define HV_CPU_QUEUE_NONRES_ERROR 0x3f
345 unsigned long queue_paddr,
346 unsigned long num_queue_entries);
366 #define HV_FAST_CPU_QINFO 0x15
394 #define HV_FAST_CPU_MONDO_SEND 0x42
410 #define HV_FAST_CPU_MYID 0x16
422 #define HV_FAST_CPU_STATE 0x17
423 #define HV_CPU_STATE_STOPPED 0x01
424 #define HV_CPU_STATE_RUNNING 0x02
425 #define HV_CPU_STATE_ERROR 0x03
446 #define HV_FAST_CPU_SET_RTBA 0x18
457 #define HV_FAST_CPU_GET_RTBA 0x19
474 #define HV_TSB_DESCR_PGSZ_IDX_OFFSET 0x00
475 #define HV_TSB_DESCR_ASSOC_OFFSET 0x02
476 #define HV_TSB_DESCR_NUM_TTES_OFFSET 0x04
477 #define HV_TSB_DESCR_CTX_IDX_OFFSET 0x08
478 #define HV_TSB_DESCR_PGSZ_MASK_OFFSET 0x0c
479 #define HV_TSB_DESCR_TSB_BASE_OFFSET 0x10
480 #define HV_TSB_DESCR_RESV_OFFSET 0x18
483 #define HV_PGSZ_MASK_8K (1 << 0)
484 #define HV_PGSZ_MASK_64K (1 << 1)
485 #define HV_PGSZ_MASK_512K (1 << 2)
486 #define HV_PGSZ_MASK_4MB (1 << 3)
487 #define HV_PGSZ_MASK_32MB (1 << 4)
488 #define HV_PGSZ_MASK_256MB (1 << 5)
489 #define HV_PGSZ_MASK_2GB (1 << 6)
490 #define HV_PGSZ_MASK_16GB (1 << 7)
495 #define HV_PGSZ_IDX_8K 0
496 #define HV_PGSZ_IDX_64K 1
497 #define HV_PGSZ_IDX_512K 2
498 #define HV_PGSZ_IDX_4MB 3
499 #define HV_PGSZ_IDX_32MB 4
500 #define HV_PGSZ_IDX_256MB 5
501 #define HV_PGSZ_IDX_2GB 6
502 #define HV_PGSZ_IDX_16GB 7
526 #define HV_FAULT_I_TYPE_OFFSET 0x00
527 #define HV_FAULT_I_ADDR_OFFSET 0x08
528 #define HV_FAULT_I_CTX_OFFSET 0x10
529 #define HV_FAULT_D_TYPE_OFFSET 0x40
530 #define HV_FAULT_D_ADDR_OFFSET 0x48
531 #define HV_FAULT_D_CTX_OFFSET 0x50
533 #define HV_FAULT_TYPE_FAST_MISS 1
534 #define HV_FAULT_TYPE_FAST_PROT 2
535 #define HV_FAULT_TYPE_MMU_MISS 3
536 #define HV_FAULT_TYPE_INV_RA 4
537 #define HV_FAULT_TYPE_PRIV_VIOL 5
538 #define HV_FAULT_TYPE_PROT_VIOL 6
539 #define HV_FAULT_TYPE_NFO 7
540 #define HV_FAULT_TYPE_NFO_SEFF 8
541 #define HV_FAULT_TYPE_INV_VA 9
542 #define HV_FAULT_TYPE_INV_ASI 10
543 #define HV_FAULT_TYPE_NC_ATOMIC 11
544 #define HV_FAULT_TYPE_PRIV_ACT 12
545 #define HV_FAULT_TYPE_RESV1 13
546 #define HV_FAULT_TYPE_UNALIGNED 14
547 #define HV_FAULT_TYPE_INV_PGSZ 15
549 #define HV_FAULT_TYPE_MULTIPLE -1
554 #define HV_MMU_DMMU 0x01
555 #define HV_MMU_IMMU 0x02
556 #define HV_MMU_ALL (HV_MMU_DMMU | HV_MMU_IMMU)
625 #define HV_FAST_MMU_TSB_CTX0 0x20
629 unsigned long tsb_desc_ra);
646 #define HV_FAST_MMU_TSB_CTXNON0 0x21
669 #define HV_FAST_MMU_DEMAP_PAGE 0x22
690 #define HV_FAST_MMU_DEMAP_CTX 0x23
710 #define HV_FAST_MMU_DEMAP_ALL 0x24
740 #define HV_FAST_MMU_MAP_PERM_ADDR 0x25
744 unsigned long set_to_zero,
746 unsigned long flags);
764 #define HV_FAST_MMU_FAULT_AREA_CONF 0x26
794 #define HV_FAST_MMU_ENABLE 0x27
811 #define HV_FAST_MMU_UNMAP_PERM_ADDR 0x28
832 #define HV_FAST_MMU_TSB_CTX0_INFO 0x29
853 #define HV_FAST_MMU_TSB_CTXNON0_INFO 0x2a
870 #define HV_FAST_MMU_FAULT_AREA_INFO 0x2b
901 #define HV_FAST_MEM_SCRUB 0x31
921 #define HV_FAST_MEM_SYNC 0x32
945 #define HV_FAST_TOD_GET 0x50
962 #define HV_FAST_TOD_SET 0x51
986 #define HV_FAST_CONS_GETCHAR 0x60
1001 #define HV_FAST_CONS_PUTCHAR 0x61
1024 #define HV_FAST_CONS_READ 0x62
1038 #define HV_FAST_CONS_WRITE 0x63
1040 #ifndef __ASSEMBLY__
1045 unsigned long *bytes_read);
1048 unsigned long *bytes_written);
1078 #define HV_FAST_MACH_SET_SOFT_STATE 0x70
1079 #define HV_SOFT_STATE_NORMAL 0x01
1080 #define HV_SOFT_STATE_TRANSITION 0x02
1082 #ifndef __ASSEMBLY__
1084 unsigned long msg_string_ra);
1102 #define HV_FAST_MACH_GET_SOFT_STATE 0x71
1117 #define HV_FAST_SVC_SEND 0x80
1132 #define HV_FAST_SVC_RECV 0x81
1141 #define HV_FAST_SVC_GETSTATUS 0x82
1150 #define HV_FAST_SVC_SETSTATUS 0x83
1159 #define HV_FAST_SVC_CLRSTATUS 0x84
1161 #ifndef __ASSEMBLY__
1164 unsigned long buffer_size,
1165 unsigned long *sent_bytes);
1168 unsigned long buffer_size,
1169 unsigned long *recv_bytes);
1191 #ifndef __ASSEMBLY__
1198 #define HV_TRAP_TRACE_CTRL_HEAD_OFFSET 0x00
1199 #define HV_TRAP_TRACE_CTRL_TAIL_OFFSET 0x08
1210 #ifndef __ASSEMBLY__
1227 #define HV_TRAP_TRACE_ENTRY_TYPE 0x00
1228 #define HV_TRAP_TRACE_ENTRY_HPSTATE 0x01
1229 #define HV_TRAP_TRACE_ENTRY_TL 0x02
1230 #define HV_TRAP_TRACE_ENTRY_GL 0x03
1231 #define HV_TRAP_TRACE_ENTRY_TT 0x04
1232 #define HV_TRAP_TRACE_ENTRY_TAG 0x06
1233 #define HV_TRAP_TRACE_ENTRY_TSTATE 0x08
1234 #define HV_TRAP_TRACE_ENTRY_TICK 0x10
1235 #define HV_TRAP_TRACE_ENTRY_TPC 0x18
1236 #define HV_TRAP_TRACE_ENTRY_F1 0x20
1237 #define HV_TRAP_TRACE_ENTRY_F2 0x28
1238 #define HV_TRAP_TRACE_ENTRY_F3 0x30
1239 #define HV_TRAP_TRACE_ENTRY_F4 0x38
1242 #define HV_TRAP_TYPE_UNDEF 0x00
1243 #define HV_TRAP_TYPE_HV 0x01
1244 #define HV_TRAP_TYPE_GUEST 0xff
1275 #define HV_FAST_TTRACE_BUF_CONF 0x90
1289 #define HV_FAST_TTRACE_BUF_INFO 0x91
1305 #define HV_FAST_TTRACE_ENABLE 0x92
1320 #define HV_FAST_TTRACE_FREEZE 0x93
1388 #define HV_FAST_DUMP_BUF_UPDATE 0x94
1402 #define HV_FAST_DUMP_BUF_INFO 0x95
1439 #define HV_INTR_STATE_IDLE 0
1440 #define HV_INTR_STATE_RECEIVED 1
1441 #define HV_INTR_STATE_DELIVERED 2
1443 #define HV_INTR_DISABLED 0
1444 #define HV_INTR_ENABLED 1
1458 #define HV_FAST_INTR_DEVINO2SYSINO 0xa0
1460 #ifndef __ASSEMBLY__
1462 unsigned long devino);
1476 #define HV_FAST_INTR_GETENABLED 0xa1
1478 #ifndef __ASSEMBLY__
1492 #define HV_FAST_INTR_SETENABLED 0xa2
1494 #ifndef __ASSEMBLY__
1508 #define HV_FAST_INTR_GETSTATE 0xa3
1510 #ifndef __ASSEMBLY__
1528 #define HV_FAST_INTR_SETSTATE 0xa4
1530 #ifndef __ASSEMBLY__
1546 #define HV_FAST_INTR_GETTARGET 0xa5
1548 #ifndef __ASSEMBLY__
1563 #define HV_FAST_INTR_SETTARGET 0xa6
1565 #ifndef __ASSEMBLY__
1577 #define HV_FAST_VINTR_GET_COOKIE 0xa7
1587 #define HV_FAST_VINTR_SET_COOKIE 0xa8
1597 #define HV_FAST_VINTR_GET_VALID 0xa9
1607 #define HV_FAST_VINTR_SET_VALID 0xaa
1617 #define HV_FAST_VINTR_GET_STATE 0xab
1627 #define HV_FAST_VINTR_SET_STATE 0xac
1637 #define HV_FAST_VINTR_GET_TARGET 0xad
1647 #define HV_FAST_VINTR_SET_TARGET 0xae
1649 #ifndef __ASSEMBLY__
1658 unsigned long *
valid);
1661 unsigned long valid);
1664 unsigned long *
state);
1667 unsigned long state);
1670 unsigned long *
cpuid);
1673 unsigned long cpuid);
1742 #define HV_PCI_MAP_ATTR_READ 0x01
1743 #define HV_PCI_MAP_ATTR_WRITE 0x02
1745 #define HV_PCI_DEVICE_BUILD(b,d,f) \
1746 ((((b) & 0xff) << 16) | \
1747 (((d) & 0x1f) << 11) | \
1748 (((f) & 0x07) << 8))
1750 #define HV_PCI_TSBID(__tsb_num, __tsb_index) \
1751 ((((u64)(__tsb_num)) << 32UL) | ((u64)(__tsb_index)))
1753 #define HV_PCI_SYNC_FOR_DEVICE 0x01
1754 #define HV_PCI_SYNC_FOR_CPU 0x02
1796 #define HV_FAST_PCI_IOMMU_MAP 0xb0
1824 #define HV_FAST_PCI_IOMMU_DEMAP 0xb1
1844 #define HV_FAST_PCI_IOMMU_GETMAP 0xb2
1862 #define HV_FAST_PCI_IOMMU_GETBYPASS 0xb3
1890 #define HV_FAST_PCI_CONFIG_GET 0xb4
1920 #define HV_FAST_PCI_CONFIG_PUT 0xb5
1955 #define HV_FAST_PCI_PEEK 0xb6
1999 #define HV_FAST_PCI_POKE 0xb7
2024 #define HV_FAST_PCI_DMA_SYNC 0xb8
2028 #define HV_MSITYPE_MSI32 0x00
2029 #define HV_MSITYPE_MSI64 0x01
2031 #define HV_MSIQSTATE_IDLE 0x00
2032 #define HV_MSIQSTATE_ERROR 0x01
2034 #define HV_MSIQ_INVALID 0x00
2035 #define HV_MSIQ_VALID 0x01
2037 #define HV_MSISTATE_IDLE 0x00
2038 #define HV_MSISTATE_DELIVERED 0x01
2040 #define HV_MSIVALID_INVALID 0x00
2041 #define HV_MSIVALID_VALID 0x01
2043 #define HV_PCIE_MSGTYPE_PME_MSG 0x18
2044 #define HV_PCIE_MSGTYPE_PME_ACK_MSG 0x1b
2045 #define HV_PCIE_MSGTYPE_CORR_MSG 0x30
2046 #define HV_PCIE_MSGTYPE_NONFATAL_MSG 0x31
2047 #define HV_PCIE_MSGTYPE_FATAL_MSG 0x33
2049 #define HV_MSG_INVALID 0x00
2050 #define HV_MSG_VALID 0x01
2075 #define HV_FAST_PCI_MSIQ_CONF 0xc0
2093 #define HV_FAST_PCI_MSIQ_INFO 0xc1
2107 #define HV_FAST_PCI_MSIQ_GETVALID 0xc2
2122 #define HV_FAST_PCI_MSIQ_SETVALID 0xc3
2136 #define HV_FAST_PCI_MSIQ_GETSTATE 0xc4
2151 #define HV_FAST_PCI_MSIQ_SETSTATE 0xc5
2165 #define HV_FAST_PCI_MSIQ_GETHEAD 0xc6
2180 #define HV_FAST_PCI_MSIQ_SETHEAD 0xc7
2194 #define HV_FAST_PCI_MSIQ_GETTAIL 0xc8
2208 #define HV_FAST_PCI_MSI_GETVALID 0xc9
2222 #define HV_FAST_PCI_MSI_SETVALID 0xca
2236 #define HV_FAST_PCI_MSI_GETMSIQ 0xcb
2251 #define HV_FAST_PCI_MSI_SETMSIQ 0xcc
2265 #define HV_FAST_PCI_MSI_GETSTATE 0xcd
2278 #define HV_FAST_PCI_MSI_SETSTATE 0xce
2291 #define HV_FAST_PCI_MSG_GETMSIQ 0xd0
2304 #define HV_FAST_PCI_MSG_SETMSIQ 0xd1
2318 #define HV_FAST_PCI_MSG_GETVALID 0xd2
2332 #define HV_FAST_PCI_MSG_SETVALID 0xd3
2336 #define LDC_CHANNEL_DOWN 0
2337 #define LDC_CHANNEL_UP 1
2338 #define LDC_CHANNEL_RESETTING 2
2376 #define HV_FAST_LDC_TX_QCONF 0xe0
2395 #define HV_FAST_LDC_TX_QINFO 0xe1
2411 #define HV_FAST_LDC_TX_GET_STATE 0xe2
2432 #define HV_FAST_LDC_TX_SET_QTAIL 0xe3
2468 #define HV_FAST_LDC_RX_QCONF 0xe4
2487 #define HV_FAST_LDC_RX_QINFO 0xe5
2503 #define HV_FAST_LDC_RX_GET_STATE 0xe6
2522 #define HV_FAST_LDC_RX_SET_QHEAD 0xe7
2528 #define LDC_MTE_PADDR 0x0fffffffffffe000
2529 #define LDC_MTE_COPY_W 0x0000000000000400
2530 #define LDC_MTE_COPY_R 0x0000000000000200
2531 #define LDC_MTE_IOMMU_W 0x0000000000000100
2532 #define LDC_MTE_IOMMU_R 0x0000000000000080
2533 #define LDC_MTE_EXEC 0x0000000000000040
2534 #define LDC_MTE_WRITE 0x0000000000000020
2535 #define LDC_MTE_READ 0x0000000000000010
2536 #define LDC_MTE_SZALL 0x000000000000000f
2537 #define LDC_MTE_SZ16GB 0x0000000000000007
2538 #define LDC_MTE_SZ2GB 0x0000000000000006
2539 #define LDC_MTE_SZ256MB 0x0000000000000005
2540 #define LDC_MTE_SZ32MB 0x0000000000000004
2541 #define LDC_MTE_SZ4MB 0x0000000000000003
2542 #define LDC_MTE_SZ512K 0x0000000000000002
2543 #define LDC_MTE_SZ64K 0x0000000000000001
2544 #define LDC_MTE_SZ8K 0x0000000000000000
2546 #ifndef __ASSEMBLY__
2565 #define HV_FAST_LDC_SET_MAP_TABLE 0xea
2578 #define HV_FAST_LDC_GET_MAP_TABLE 0xeb
2580 #define LDC_COPY_IN 0
2581 #define LDC_COPY_OUT 1
2594 #define HV_FAST_LDC_COPY 0xec
2596 #define LDC_MEM_READ 1
2597 #define LDC_MEM_WRITE 2
2598 #define LDC_MEM_EXEC 4
2609 #define HV_FAST_LDC_MAPIN 0xed
2617 #define HV_FAST_LDC_UNMAP 0xee
2627 #define HV_FAST_LDC_REVOKE 0xef
2629 #ifndef __ASSEMBLY__
2637 unsigned long *head_off,
2638 unsigned long *tail_off,
2639 unsigned long *chan_state);
2641 unsigned long tail_off);
2649 unsigned long *head_off,
2650 unsigned long *tail_off,
2651 unsigned long *chan_state);
2653 unsigned long head_off);
2661 unsigned long dir_code,
2662 unsigned long tgt_raddr,
2663 unsigned long lcl_raddr,
2665 unsigned long *actual_len);
2669 unsigned long *
perm);
2673 unsigned long mte_cookie);
2678 #define HV_PERF_JBUS_PERF_CTRL_REG 0x00
2679 #define HV_PERF_JBUS_PERF_CNT_REG 0x01
2680 #define HV_PERF_DRAM_PERF_CTRL_REG_0 0x02
2681 #define HV_PERF_DRAM_PERF_CNT_REG_0 0x03
2682 #define HV_PERF_DRAM_PERF_CTRL_REG_1 0x04
2683 #define HV_PERF_DRAM_PERF_CNT_REG_1 0x05
2684 #define HV_PERF_DRAM_PERF_CTRL_REG_2 0x06
2685 #define HV_PERF_DRAM_PERF_CNT_REG_2 0x07
2686 #define HV_PERF_DRAM_PERF_CTRL_REG_3 0x08
2687 #define HV_PERF_DRAM_PERF_CNT_REG_3 0x09
2700 #define HV_FAST_GET_PERFREG 0x100
2714 #define HV_FAST_SET_PERFREG 0x101
2716 #define HV_N2_PERF_SPARC_CTL 0x0
2717 #define HV_N2_PERF_DRAM_CTL0 0x1
2718 #define HV_N2_PERF_DRAM_CNT0 0x2
2719 #define HV_N2_PERF_DRAM_CTL1 0x3
2720 #define HV_N2_PERF_DRAM_CNT1 0x4
2721 #define HV_N2_PERF_DRAM_CTL2 0x5
2722 #define HV_N2_PERF_DRAM_CNT2 0x6
2723 #define HV_N2_PERF_DRAM_CTL3 0x7
2724 #define HV_N2_PERF_DRAM_CNT3 0x8
2726 #define HV_FAST_N2_GET_PERFREG 0x104
2727 #define HV_FAST_N2_SET_PERFREG 0x105
2729 #ifndef __ASSEMBLY__
2731 unsigned long *
val);
2735 unsigned long *
val);
2746 #ifndef __ASSEMBLY__
2817 #define HV_FAST_MMUSTAT_CONF 0x102
2829 #define HV_FAST_MMUSTAT_INFO 0x103
2831 #ifndef __ASSEMBLY__
2839 #define HV_NCS_QCONF 0x01
2840 #define HV_NCS_QTAIL_UPDATE 0x02
2842 #ifndef __ASSEMBLY__
2846 #define MAU_CONTROL_INV_PARITY 0x0000000000002000
2847 #define MAU_CONTROL_STRAND 0x0000000000001800
2848 #define MAU_CONTROL_BUSY 0x0000000000000400
2849 #define MAU_CONTROL_INT 0x0000000000000200
2850 #define MAU_CONTROL_OP 0x00000000000001c0
2851 #define MAU_CONTROL_OP_SHIFT 6
2852 #define MAU_OP_LOAD_MA_MEMORY 0x0
2853 #define MAU_OP_STORE_MA_MEMORY 0x1
2854 #define MAU_OP_MODULAR_MULT 0x2
2855 #define MAU_OP_MODULAR_REDUCE 0x3
2856 #define MAU_OP_MODULAR_EXP_LOOP 0x4
2857 #define MAU_CONTROL_LEN 0x000000000000003f
2858 #define MAU_CONTROL_LEN_SHIFT 0
2883 #define HV_NCS_SYNCFLAG_SYNC 0x00
2884 #define HV_NCS_SYNCFLAG_ASYNC 0x01
2919 #define HV_FAST_NCS_REQUEST 0x110
2921 #ifndef __ASSEMBLY__
2923 unsigned long arg_ra,
2924 unsigned long arg_size);
2927 #define HV_FAST_FIRE_GET_PERFREG 0x120
2928 #define HV_FAST_FIRE_SET_PERFREG 0x121
2930 #define HV_FAST_REBOOT_DATA_SET 0x172
2932 #ifndef __ASSEMBLY__
2937 #define HV_FAST_VT_GET_PERFREG 0x184
2938 #define HV_FAST_VT_SET_PERFREG 0x185
2940 #ifndef __ASSEMBLY__
2948 #define HV_CORE_SET_VER 0x00
2949 #define HV_CORE_PUTCHAR 0x01
2950 #define HV_CORE_EXIT 0x02
2951 #define HV_CORE_GET_VER 0x03
2956 #define HV_GRP_SUN4V 0x0000
2957 #define HV_GRP_CORE 0x0001
2958 #define HV_GRP_INTR 0x0002
2959 #define HV_GRP_SOFT_STATE 0x0003
2960 #define HV_GRP_TM 0x0080
2961 #define HV_GRP_PCI 0x0100
2962 #define HV_GRP_LDOM 0x0101
2963 #define HV_GRP_SVC_CHAN 0x0102
2964 #define HV_GRP_NCS 0x0103
2965 #define HV_GRP_RNG 0x0104
2966 #define HV_GRP_PBOOT 0x0105
2967 #define HV_GRP_TPM 0x0107
2968 #define HV_GRP_SDIO 0x0108
2969 #define HV_GRP_SDIO_ERR 0x0109
2970 #define HV_GRP_REBOOT_DATA 0x0110
2971 #define HV_GRP_NIAG_PERF 0x0200
2972 #define HV_GRP_FIRE_PERF 0x0201
2973 #define HV_GRP_N2_CPU 0x0202
2974 #define HV_GRP_NIU 0x0204
2975 #define HV_GRP_VF_CPU 0x0205
2976 #define HV_GRP_KT_CPU 0x0209
2977 #define HV_GRP_VT_CPU 0x020c
2978 #define HV_GRP_DIAG 0x0300
2980 #ifndef __ASSEMBLY__
2982 unsigned long *major,
2983 unsigned long *minor);
2985 unsigned long major,
2986 unsigned long minor,
2987 unsigned long *actual_minor);
2990 unsigned long *minor);
2993 unsigned long *major,
2994 unsigned long *minor);