82
82
#define REQUEST_READ 0
83
83
#define REQUEST_WRITE 1
84
84
85
+ /* Generic VM flags from guest OS */
86
+ #define SECURE_WORLD_ENABLED (1UL<<0) /* Whether secure world is enabled */
87
+
85
88
/**
86
89
* @brief Hypercall
87
90
*
@@ -161,29 +164,31 @@ struct acrn_create_vm {
161
164
/** created vmid return to VHM. Keep it first field */
162
165
int32_t vmid ;
163
166
164
- /** vcpu numbers this VM want to create */
167
+ /** VCPU numbers this VM want to create */
165
168
uint32_t vcpu_num ;
166
169
167
170
/** the GUID of this VM */
168
171
uint8_t GUID [16 ];
169
172
170
- /** whether Secure World is enabled for this VM */
171
- uint8_t secure_world_enabled ;
173
+ /* VM flag bits from Guest OS, now used
174
+ * SECURE_WORLD_ENABLED (1UL<<0)
175
+ */
176
+ uint64_t vm_flag ;
172
177
173
178
/** Reserved for future use*/
174
- uint8_t reserved [31 ];
179
+ uint8_t reserved [24 ];
175
180
} __aligned (8 );
176
181
177
182
/**
178
- * @brief Info to create a vcpu
183
+ * @brief Info to create a VCPU
179
184
*
180
185
* the parameter for HC_CREATE_VCPU hypercall
181
186
*/
182
187
struct acrn_create_vcpu {
183
- /** the virtual cpu id for the vcpu want to create */
188
+ /** the virtual CPU ID for the VCPU created */
184
189
uint32_t vcpu_id ;
185
190
186
- /** the physical cpu id for the vcpu want to create */
191
+ /** the physical CPU ID for the VCPU created */
187
192
uint32_t pcpu_id ;
188
193
} __aligned (8 );
189
194
@@ -193,7 +198,7 @@ struct acrn_create_vcpu {
193
198
* the parameter for HC_SET_IOREQ_BUFFER hypercall
194
199
*/
195
200
struct acrn_set_ioreq_buffer {
196
- /** gpa of per VM request_buffer */
201
+ /** guest physical address of VM request_buffer */
197
202
uint64_t req_buf ;
198
203
} __aligned (8 );
199
204
@@ -204,7 +209,7 @@ struct acrn_set_ioreq_buffer {
204
209
#define ACRN_INTR_TYPE_IOAPIC 1
205
210
206
211
/**
207
- * @brief Info to assert/deassert/pulse a virtual irq line for a VM
212
+ * @brief Info to assert/deassert/pulse a virtual IRQ line for a VM
208
213
*
209
214
* the parameter for HC_ASSERT_IRQLINE/HC_DEASSERT_IRQLINE/HC_PULSE_IRQLINE
210
215
* hypercall
@@ -216,76 +221,76 @@ struct acrn_irqline {
216
221
/** reserved for alignment padding */
217
222
uint32_t reserved ;
218
223
219
- /** pic irq for ISA type */
224
+ /** pic IRQ for ISA type */
220
225
uint64_t pic_irq ;
221
226
222
- /** ioapic irq for IOAPIC & ISA TYPE,
223
- * if -1 then this irq will not be injected
227
+ /** ioapic IRQ for IOAPIC & ISA TYPE,
228
+ * if -1 then this IRQ will not be injected
224
229
*/
225
230
uint64_t ioapic_irq ;
226
231
} __aligned (8 );
227
232
228
233
/**
229
- * @brief Info to inject a msi interrupt for a VM
234
+ * @brief Info to inject a MSI interrupt to VM
230
235
*
231
236
* the parameter for HC_INJECT_MSI hypercall
232
237
*/
233
238
struct acrn_msi_entry {
234
- /** msi addr[19:12] with dest vcpu id */
239
+ /** MSI addr[19:12] with dest VCPU ID */
235
240
uint64_t msi_addr ;
236
241
237
- /** msi data[7:0] with vector */
242
+ /** MSI data[7:0] with vector */
238
243
uint64_t msi_data ;
239
244
} __aligned (8 );
240
245
241
246
/**
242
- * @brief Info to inject a nmi interrupt for a VM
247
+ * @brief Info to inject a NMI interrupt for a VM
243
248
*/
244
249
struct acrn_nmi_entry {
245
- /** virtual cpu id to inject */
250
+ /** virtual CPU ID to inject */
246
251
int64_t vcpu_id ;
247
252
} __aligned (8 );
248
253
249
254
/**
250
- * @brief Info to remap pass-through pci msi for a VM
255
+ * @brief Info to remap pass-through PCI MSI for a VM
251
256
*
252
257
* the parameter for HC_VM_PCI_MSIX_REMAP hypercall
253
258
*/
254
259
struct acrn_vm_pci_msix_remap {
255
- /** pass-through pci device virtual BDF# */
260
+ /** pass-through PCI device virtual BDF# */
256
261
uint16_t virt_bdf ;
257
262
258
- /** pass-through pci device physical BDF# */
263
+ /** pass-through PCI device physical BDF# */
259
264
uint16_t phys_bdf ;
260
265
261
- /** pass-through pci device MSI/x cap control data */
266
+ /** pass-through PCI device MSI/MSI-X cap control data */
262
267
uint16_t msi_ctl ;
263
268
264
269
/** reserved for alignment padding */
265
270
uint16_t reserved ;
266
271
267
- /** pass-through pci device msi address to remap, which will
272
+ /** pass-through PCI device MSI address to remap, which will
268
273
* return the caller after remapping
269
274
*/
270
275
uint64_t msi_addr ; /* IN/OUT: msi address to fix */
271
276
272
- /** pass-through pci device msi data to remap, which will
277
+ /** pass-through PCI device MSI data to remap, which will
273
278
* return the caller after remapping
274
279
*/
275
280
uint32_t msi_data ;
276
281
277
- /** pass-through pci device is msi or msix
282
+ /** pass-through PCI device is MSI or MSI-X
278
283
* 0 - MSI, 1 - MSI-X
279
284
*/
280
285
int32_t msix ;
281
286
282
- /** if the pass-through pci device is msix , this field contains
287
+ /** if the pass-through PCI device is MSI-X , this field contains
283
288
* the MSI-X entry table index
284
289
*/
285
290
int32_t msix_entry_index ;
286
291
287
- /** if the pass-through pci device is msix , this field contains
288
- * Vector Control for MSI-X Entry, field defined in MSIX spec
292
+ /** if the pass-through PCI device is MSI-X , this field contains
293
+ * Vector Control for MSI-X Entry, field defined in MSI-X spec
289
294
*/
290
295
uint32_t vector_ctl ;
291
296
} __aligned (8 );
@@ -294,7 +299,7 @@ struct acrn_vm_pci_msix_remap {
294
299
* @brief The guest config pointer offset.
295
300
*
296
301
* It's designed to support passing DM config data pointer, based on it,
297
- * hypervisor would parse then pass DM defined configration to GUEST vcpu
302
+ * hypervisor would parse then pass DM defined configuration to GUEST VCPU
298
303
* when booting guest VM.
299
304
* the address 0xd0000 here is designed by DM, as it arranged all memory
300
305
* layout below 1M, DM should make sure there is no overlap for the address
0 commit comments