@@ -16,123 +16,129 @@ ioctl_iow_nr!(
16
16
17
17
// partition fd
18
18
ioctl_io_nr ! ( MSHV_INITIALIZE_PARTITION , MSHV_IOCTL , 0x00 ) ;
19
- ioctl_iow_nr ! ( MSHV_CREATE_VP , MSHV_IOCTL , 0x04 , mshv_create_vp) ;
20
- ioctl_iowr_nr ! ( MSHV_GET_VP_REGISTERS , MSHV_IOCTL , 0x05 , mshv_vp_registers) ;
21
- ioctl_iow_nr ! ( MSHV_SET_VP_REGISTERS , MSHV_IOCTL , 0x06 , mshv_vp_registers) ;
22
- ioctl_ior_nr ! ( MSHV_RUN_VP , MSHV_IOCTL , 0x00 , mshv_run_vp) ;
23
- #[ cfg( target_arch = "x86_64" ) ]
24
- ioctl_iowr_nr ! ( MSHV_GET_VP_STATE , MSHV_IOCTL , 0x0A , mshv_get_set_vp_state) ;
25
- #[ cfg( target_arch = "x86_64" ) ]
26
- ioctl_iowr_nr ! ( MSHV_SET_VP_STATE , MSHV_IOCTL , 0x0B , mshv_get_set_vp_state) ;
19
+ ioctl_iow_nr ! ( MSHV_CREATE_VP , MSHV_IOCTL , 0x01 , mshv_create_vp) ;
27
20
ioctl_iow_nr ! (
28
- MSHV_SET_PARTITION_PROPERTY ,
21
+ MSHV_SET_GUEST_MEMORY ,
29
22
MSHV_IOCTL ,
30
- 0x0C ,
31
- mshv_partition_property
23
+ 0x02 ,
24
+ mshv_user_mem_region
32
25
) ;
26
+ ioctl_iow_nr ! ( MSHV_IRQFD , MSHV_IOCTL , 0x03 , mshv_user_irqfd) ;
27
+ ioctl_iow_nr ! ( MSHV_IOEVENTFD , MSHV_IOCTL , 0x4 , mshv_user_ioeventfd) ;
28
+ ioctl_iow_nr ! ( MSHV_SET_MSI_ROUTING , MSHV_IOCTL , 0x05 , mshv_user_irq_table) ;
33
29
ioctl_iowr_nr ! (
34
- MSHV_GET_PARTITION_PROPERTY ,
30
+ MSHV_GET_GPAP_ACCESS_BITMAP ,
35
31
MSHV_IOCTL ,
36
- 0x0D ,
37
- mshv_partition_property
32
+ 0x06 ,
33
+ mshv_gpap_access_bitmap
38
34
) ;
39
- ioctl_iow_nr ! ( MSHV_IRQFD , MSHV_IOCTL , 0x0E , mshv_user_irqfd) ;
40
- ioctl_iow_nr ! ( MSHV_IOEVENTFD , MSHV_IOCTL , 0xF , mshv_user_ioeventfd) ;
41
- ioctl_iow_nr ! ( MSHV_SET_MSI_ROUTING , MSHV_IOCTL , 0x11 , mshv_user_irq_table) ;
35
+ ioctl_iowr_nr ! ( MSHV_ROOT_HVCALL , MSHV_IOCTL , 0x07 , mshv_root_hvcall) ;
36
+ ioctl_iowr_nr ! ( MSHV_CREATE_DEVICE , MSHV_IOCTL , 0x08 , mshv_create_device) ;
42
37
ioctl_iow_nr ! (
43
- MSHV_SET_GUEST_MEMORY ,
38
+ MSHV_MODIFY_GPA_HOST_ACCESS ,
44
39
MSHV_IOCTL ,
45
- 0x02 ,
46
- mshv_user_mem_region
40
+ 0x09 ,
41
+ mshv_modify_gpa_host_access
47
42
) ;
43
+ ioctl_iow_nr ! (
44
+ MSHV_IMPORT_ISOLATED_PAGES ,
45
+ MSHV_IOCTL ,
46
+ 0x0A ,
47
+ mshv_import_isolated_pages
48
+ ) ;
49
+
50
+ // deprecated
48
51
ioctl_iow_nr ! (
49
52
MSHV_INSTALL_INTERCEPT ,
50
53
MSHV_IOCTL ,
51
- 0x08 ,
54
+ 0xF0 ,
52
55
mshv_install_intercept
53
56
) ;
54
57
ioctl_iow_nr ! (
55
58
MSHV_ASSERT_INTERRUPT ,
56
59
MSHV_IOCTL ,
57
- 0x09 ,
60
+ 0xF1 ,
58
61
mshv_assert_interrupt
59
62
) ;
60
- ioctl_iowr_nr ! ( MSHV_VP_TRANSLATE_GVA , MSHV_IOCTL , 0x0E , mshv_translate_gva) ;
61
- ioctl_iowr_nr ! (
62
- MSHV_GET_GPAP_ACCESS_BITMAP ,
63
- MSHV_IOCTL ,
64
- 0x07 ,
65
- mshv_gpap_access_bitmap
66
- ) ;
67
-
68
- ioctl_iowr_nr ! ( MSHV_CREATE_DEVICE , MSHV_IOCTL , 0x13 , mshv_create_device) ;
69
- ioctl_iow_nr ! ( MSHV_SET_DEVICE_ATTR , MSHV_IOCTL , 0x14 , mshv_device_attr) ;
70
- ioctl_iow_nr ! ( MSHV_GET_DEVICE_ATTR , MSHV_IOCTL , 0x15 , mshv_device_attr) ;
71
- ioctl_iow_nr ! ( MSHV_HAS_DEVICE_ATTR , MSHV_IOCTL , 0x16 , mshv_device_attr) ;
72
-
73
- #[ cfg( target_arch = "x86_64" ) ]
74
63
ioctl_iow_nr ! (
75
- MSHV_VP_REGISTER_INTERCEPT_RESULT ,
64
+ MSHV_SET_PARTITION_PROPERTY ,
76
65
MSHV_IOCTL ,
77
- 0x17 ,
78
- mshv_register_intercept_result
66
+ 0xF2 ,
67
+ mshv_partition_property
79
68
) ;
80
-
81
69
ioctl_iowr_nr ! (
82
- MSHV_SIGNAL_EVENT_DIRECT ,
70
+ MSHV_GET_PARTITION_PROPERTY ,
83
71
MSHV_IOCTL ,
84
- 0x18 ,
85
- mshv_signal_event_direct
72
+ 0xF3 ,
73
+ mshv_partition_property
86
74
) ;
87
75
ioctl_iow_nr ! (
88
- MSHV_POST_MESSAGE_DIRECT ,
76
+ MSHV_COMPLETE_ISOLATED_IMPORT ,
89
77
MSHV_IOCTL ,
90
- 0x19 ,
91
- mshv_post_message_direct
78
+ 0xF4 ,
79
+ mshv_complete_isolated_import
92
80
) ;
93
81
ioctl_iow_nr ! (
94
- MSHV_REGISTER_DELIVERABILITY_NOTIFICATIONS ,
82
+ MSHV_ISSUE_PSP_GUEST_REQUEST ,
95
83
MSHV_IOCTL ,
96
- 0x1A ,
97
- mshv_register_deliverabilty_notifications
84
+ 0xF5 ,
85
+ mshv_issue_psp_guest_request
98
86
) ;
99
- ioctl_iowr_nr ! (
100
- MSHV_GET_VP_CPUID_VALUES ,
87
+ ioctl_iow_nr ! (
88
+ MSHV_SEV_SNP_AP_CREATE ,
101
89
MSHV_IOCTL ,
102
- 0x1B ,
103
- mshv_get_vp_cpuid_values
90
+ 0xF6 ,
91
+ mshv_sev_snp_ap_create
104
92
) ;
105
- ioctl_iow_nr ! (
106
- MSHV_MODIFY_GPA_HOST_ACCESS ,
93
+ ioctl_iowr_nr ! (
94
+ MSHV_SIGNAL_EVENT_DIRECT ,
107
95
MSHV_IOCTL ,
108
- 0x28 ,
109
- mshv_modify_gpa_host_access
96
+ 0xF7 ,
97
+ mshv_signal_event_direct
110
98
) ;
111
99
ioctl_iow_nr ! (
112
- MSHV_IMPORT_ISOLATED_PAGES ,
100
+ MSHV_POST_MESSAGE_DIRECT ,
113
101
MSHV_IOCTL ,
114
- 0x29 ,
115
- mshv_import_isolated_pages
102
+ 0xF8 ,
103
+ mshv_post_message_direct
116
104
) ;
117
105
ioctl_iow_nr ! (
118
- MSHV_COMPLETE_ISOLATED_IMPORT ,
106
+ MSHV_REGISTER_DELIVERABILITY_NOTIFICATIONS ,
119
107
MSHV_IOCTL ,
120
- 0x30 ,
121
- mshv_complete_isolated_import
108
+ 0xF9 ,
109
+ mshv_register_deliverabilty_notifications
122
110
) ;
111
+
112
+ // VP fd
113
+ ioctl_ior_nr ! ( MSHV_RUN_VP , MSHV_IOCTL , 0x00 , mshv_run_vp) ;
114
+ #[ cfg( target_arch = "x86_64" ) ]
115
+ ioctl_iowr_nr ! ( MSHV_GET_VP_STATE , MSHV_IOCTL , 0x01 , mshv_get_set_vp_state) ;
116
+ #[ cfg( target_arch = "x86_64" ) ]
117
+ ioctl_iowr_nr ! ( MSHV_SET_VP_STATE , MSHV_IOCTL , 0x02 , mshv_get_set_vp_state) ;
118
+ // NOTE: defined above, also used with VP fd:
119
+ // ioctl_iowr_nr!(MSHV_ROOT_HVCALL, MSHV_IOCTL, 0x07, mshv_root_hvcall);
120
+
121
+ // deprecated
122
+ ioctl_iowr_nr ! ( MSHV_GET_VP_REGISTERS , MSHV_IOCTL , 0xF0 , mshv_vp_registers) ;
123
+ ioctl_iow_nr ! ( MSHV_SET_VP_REGISTERS , MSHV_IOCTL , 0xF1 , mshv_vp_registers) ;
124
+ ioctl_iowr_nr ! ( MSHV_VP_TRANSLATE_GVA , MSHV_IOCTL , 0xF2 , mshv_translate_gva) ;
125
+ #[ cfg( target_arch = "x86_64" ) ]
123
126
ioctl_iow_nr ! (
124
- MSHV_ISSUE_PSP_GUEST_REQUEST ,
127
+ MSHV_VP_REGISTER_INTERCEPT_RESULT ,
125
128
MSHV_IOCTL ,
126
- 0x31 ,
127
- mshv_issue_psp_guest_request
129
+ 0xF3 ,
130
+ mshv_register_intercept_result
128
131
) ;
129
- ioctl_iowr_nr ! ( MSHV_READ_GPA , MSHV_IOCTL , 0x32 , mshv_read_write_gpa) ;
130
- ioctl_iow_nr ! ( MSHV_WRITE_GPA , MSHV_IOCTL , 0x33 , mshv_read_write_gpa) ;
131
- ioctl_iow_nr ! (
132
- MSHV_SEV_SNP_AP_CREATE ,
132
+ ioctl_iowr_nr ! (
133
+ MSHV_GET_VP_CPUID_VALUES ,
133
134
MSHV_IOCTL ,
134
- 0x34 ,
135
- mshv_sev_snp_ap_create
135
+ 0xF4 ,
136
+ mshv_get_vp_cpuid_values
136
137
) ;
138
+ ioctl_iowr_nr ! ( MSHV_READ_GPA , MSHV_IOCTL , 0xF5 , mshv_read_write_gpa) ;
139
+ ioctl_iow_nr ! ( MSHV_WRITE_GPA , MSHV_IOCTL , 0xF6 , mshv_read_write_gpa) ;
137
140
138
- ioctl_iowr_nr ! ( MSHV_ROOT_HVCALL , MSHV_IOCTL , 0x35 , mshv_root_hvcall) ;
141
+ // device fd
142
+ ioctl_iow_nr ! ( MSHV_SET_DEVICE_ATTR , MSHV_IOCTL , 0x00 , mshv_device_attr) ;
143
+ ioctl_iow_nr ! ( MSHV_GET_DEVICE_ATTR , MSHV_IOCTL , 0x01 , mshv_device_attr) ;
144
+ ioctl_iow_nr ! ( MSHV_HAS_DEVICE_ATTR , MSHV_IOCTL , 0x02 , mshv_device_attr) ;
0 commit comments