@@ -63,7 +63,7 @@ static int is_guest_irq_enabled(struct vcpu *vcpu)
63
63
if ((guest_rflags & HV_ARCH_VCPU_RFLAGS_IF ) != 0UL ) {
64
64
/* Interrupts are allowed */
65
65
/* Check for temporarily disabled interrupts */
66
- guest_state = exec_vmread (VMX_GUEST_INTERRUPTIBILITY_INFO );
66
+ guest_state = exec_vmread32 (VMX_GUEST_INTERRUPTIBILITY_INFO );
67
67
68
68
if ((guest_state & (HV_ARCH_VCPU_BLOCKED_BY_STI |
69
69
HV_ARCH_VCPU_BLOCKED_BY_MOVSS )) == 0UL ) {
@@ -139,7 +139,7 @@ static int vcpu_do_pending_event(struct vcpu *vcpu)
139
139
return -1 ;
140
140
}
141
141
142
- exec_vmwrite (VMX_ENTRY_INT_INFO_FIELD , VMX_INT_INFO_VALID |
142
+ exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD , VMX_INT_INFO_VALID |
143
143
(vector & 0xFFU ));
144
144
145
145
vlapic_intr_accepted (vlapic , vector );
@@ -163,7 +163,7 @@ static int vcpu_do_pending_extint(struct vcpu *vcpu)
163
163
if (vector <= NR_MAX_VECTOR ) {
164
164
dev_dbg (ACRN_DBG_INTR , "VPIC: to inject PIC vector %d\n" ,
165
165
vector & 0xFFU );
166
- exec_vmwrite (VMX_ENTRY_INT_INFO_FIELD ,
166
+ exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD ,
167
167
VMX_INT_INFO_VALID |
168
168
(vector & 0xFFU ));
169
169
vpic_intr_accepted (vcpu -> vm , vector );
@@ -245,12 +245,12 @@ int vcpu_queue_exception(struct vcpu *vcpu, uint32_t vector,
245
245
static void _vcpu_inject_exception (struct vcpu * vcpu , uint32_t vector )
246
246
{
247
247
if ((exception_type [vector ] & EXCEPTION_ERROR_CODE_VALID ) != 0U ) {
248
- exec_vmwrite (VMX_ENTRY_EXCEPTION_ERROR_CODE ,
248
+ exec_vmwrite32 (VMX_ENTRY_EXCEPTION_ERROR_CODE ,
249
249
vcpu -> arch_vcpu .exception_info .error );
250
250
}
251
251
252
- exec_vmwrite (VMX_ENTRY_INT_INFO_FIELD , VMX_INT_INFO_VALID |
253
- (exception_type [vector ] << 8 ) | (vector & 0xFFU ));
252
+ exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD , VMX_INT_INFO_VALID |
253
+ (exception_type [vector ] << 8U ) | (vector & 0xFFU ));
254
254
255
255
vcpu -> arch_vcpu .exception_info .exception = VECTOR_INVALID ;
256
256
}
@@ -324,9 +324,9 @@ int interrupt_window_vmexit_handler(struct vcpu *vcpu)
324
324
* Disable the interrupt window exiting
325
325
*/
326
326
vcpu -> arch_vcpu .irq_window_enabled = 0U ;
327
- value32 = exec_vmread (VMX_PROC_VM_EXEC_CONTROLS );
327
+ value32 = exec_vmread32 (VMX_PROC_VM_EXEC_CONTROLS );
328
328
value32 &= ~(VMX_PROCBASED_CTLS_IRQ_WIN );
329
- exec_vmwrite (VMX_PROC_VM_EXEC_CONTROLS , value32 );
329
+ exec_vmwrite32 (VMX_PROC_VM_EXEC_CONTROLS , value32 );
330
330
}
331
331
332
332
vcpu_retain_rip (vcpu );
@@ -338,7 +338,7 @@ int external_interrupt_vmexit_handler(struct vcpu *vcpu)
338
338
uint32_t intr_info ;
339
339
struct intr_excp_ctx ctx ;
340
340
341
- intr_info = exec_vmread (VMX_EXIT_INT_INFO );
341
+ intr_info = exec_vmread32 (VMX_EXIT_INT_INFO );
342
342
if (((intr_info & VMX_INT_INFO_VALID ) == 0U ) ||
343
343
(((intr_info & VMX_INT_TYPE_MASK ) >> 8 )
344
344
!= VMX_INT_TYPE_EXT_INT )) {
@@ -383,10 +383,10 @@ int acrn_handle_pending_request(struct vcpu *vcpu)
383
383
if (vcpu -> arch_vcpu .inject_event_pending ) {
384
384
if ((vcpu -> arch_vcpu .inject_info .intr_info &
385
385
(EXCEPTION_ERROR_CODE_VALID << 8 )) != 0U )
386
- exec_vmwrite (VMX_ENTRY_EXCEPTION_ERROR_CODE ,
386
+ exec_vmwrite32 (VMX_ENTRY_EXCEPTION_ERROR_CODE ,
387
387
vcpu -> arch_vcpu .inject_info .error_code );
388
388
389
- exec_vmwrite (VMX_ENTRY_INT_INFO_FIELD ,
389
+ exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD ,
390
390
vcpu -> arch_vcpu .inject_info .intr_info );
391
391
392
392
vcpu -> arch_vcpu .inject_event_pending = false;
@@ -401,8 +401,8 @@ int acrn_handle_pending_request(struct vcpu *vcpu)
401
401
/* inject NMI before maskable hardware interrupt */
402
402
if (bitmap_test_and_clear (ACRN_REQUEST_NMI , pending_req_bits )) {
403
403
/* Inject NMI vector = 2 */
404
- exec_vmwrite (VMX_ENTRY_INT_INFO_FIELD ,
405
- VMX_INT_INFO_VALID | (VMX_INT_TYPE_NMI << 8 ) | IDT_NMI );
404
+ exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD ,
405
+ VMX_INT_INFO_VALID | (VMX_INT_TYPE_NMI << 8U ) | IDT_NMI );
406
406
407
407
goto INTR_WIN ;
408
408
}
@@ -415,7 +415,7 @@ int acrn_handle_pending_request(struct vcpu *vcpu)
415
415
* at next vm exit?
416
416
*/
417
417
if ((vcpu -> arch_vcpu .idt_vectoring_info & VMX_INT_INFO_VALID ) != 0U ) {
418
- exec_vmwrite (VMX_ENTRY_INT_INFO_FIELD ,
418
+ exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD ,
419
419
vcpu -> arch_vcpu .idt_vectoring_info );
420
420
goto INTR_WIN ;
421
421
}
@@ -450,9 +450,9 @@ int acrn_handle_pending_request(struct vcpu *vcpu)
450
450
/* Enable interrupt window exiting if pending */
451
451
if (intr_pending && vcpu -> arch_vcpu .irq_window_enabled == 0U ) {
452
452
vcpu -> arch_vcpu .irq_window_enabled = 1U ;
453
- tmp = exec_vmread (VMX_PROC_VM_EXEC_CONTROLS );
453
+ tmp = exec_vmread32 (VMX_PROC_VM_EXEC_CONTROLS );
454
454
tmp |= (VMX_PROCBASED_CTLS_IRQ_WIN );
455
- exec_vmwrite (VMX_PROC_VM_EXEC_CONTROLS , tmp );
455
+ exec_vmwrite32 (VMX_PROC_VM_EXEC_CONTROLS , tmp );
456
456
}
457
457
458
458
return ret ;
@@ -462,7 +462,7 @@ void cancel_event_injection(struct vcpu *vcpu)
462
462
{
463
463
uint32_t intinfo ;
464
464
465
- intinfo = exec_vmread (VMX_ENTRY_INT_INFO_FIELD );
465
+ intinfo = exec_vmread32 (VMX_ENTRY_INT_INFO_FIELD );
466
466
467
467
/*
468
468
* If event is injected, we clear VMX_ENTRY_INT_INFO_FIELD,
@@ -475,10 +475,10 @@ void cancel_event_injection(struct vcpu *vcpu)
475
475
476
476
if ((intinfo & (EXCEPTION_ERROR_CODE_VALID << 8 )) != 0U )
477
477
vcpu -> arch_vcpu .inject_info .error_code =
478
- exec_vmread (VMX_ENTRY_EXCEPTION_ERROR_CODE );
478
+ exec_vmread32 (VMX_ENTRY_EXCEPTION_ERROR_CODE );
479
479
480
480
vcpu -> arch_vcpu .inject_info .intr_info = intinfo ;
481
- exec_vmwrite (VMX_ENTRY_INT_INFO_FIELD , 0UL );
481
+ exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD , 0UL );
482
482
}
483
483
}
484
484
@@ -500,21 +500,21 @@ int exception_vmexit_handler(struct vcpu *vcpu)
500
500
pr_dbg (" Handling guest exception" );
501
501
502
502
/* Obtain VM-Exit information field pg 2912 */
503
- intinfo = exec_vmread (VMX_EXIT_INT_INFO );
503
+ intinfo = exec_vmread32 (VMX_EXIT_INT_INFO );
504
504
if ((intinfo & VMX_INT_INFO_VALID ) != 0U ) {
505
505
exception_vector = intinfo & 0xFFU ;
506
506
/* Check if exception caused by the guest is a HW exception.
507
507
* If the exit occurred due to a HW exception obtain the
508
508
* error code to be conveyed to get via the stack
509
509
*/
510
510
if ((intinfo & VMX_INT_INFO_ERR_CODE_VALID ) != 0U ) {
511
- int_err_code = exec_vmread (VMX_EXIT_INT_ERROR_CODE );
511
+ int_err_code = exec_vmread32 (VMX_EXIT_INT_ERROR_CODE );
512
512
513
513
/* get current privilege level and fault address */
514
- cpl = exec_vmread (VMX_GUEST_CS_ATTR );
515
- cpl = (cpl >> 5 ) & 3U ;
514
+ cpl = exec_vmread32 (VMX_GUEST_CS_ATTR );
515
+ cpl = (cpl >> 5U ) & 3U ;
516
516
517
- if (cpl < 3 )
517
+ if (cpl < 3U )
518
518
int_err_code &= ~4U ;
519
519
else
520
520
int_err_code |= 4U ;
0 commit comments