@@ -365,8 +365,6 @@ int32_t acrn_handle_pending_request(struct acrn_vcpu *vcpu)
365
365
bool injected = false;
366
366
int32_t ret = 0 ;
367
367
uint32_t tmp ;
368
- uint32_t intr_info ;
369
- uint32_t error_code ;
370
368
struct acrn_vcpu_arch * arch = & vcpu -> arch ;
371
369
uint64_t * pending_req_bits = & arch -> pending_req ;
372
370
@@ -387,42 +385,28 @@ int32_t acrn_handle_pending_request(struct acrn_vcpu *vcpu)
387
385
vcpu_set_vmcs_eoi_exit (vcpu );
388
386
}
389
387
390
- /* handling cancelled event injection when vcpu is switched out */
391
- if (arch -> inject_event_pending ) {
392
- if ((arch -> inject_info .intr_info & (EXCEPTION_ERROR_CODE_VALID << 8U )) != 0U ) {
393
- error_code = arch -> inject_info .error_code ;
394
- exec_vmwrite32 (VMX_ENTRY_EXCEPTION_ERROR_CODE , error_code );
395
- }
396
-
397
- intr_info = arch -> inject_info .intr_info ;
398
- exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD , intr_info );
399
-
400
- arch -> inject_event_pending = false;
401
- injected = true;
402
- } else {
403
- /* SDM Vol 3 - table 6-2, inject high priority exception before
404
- * maskable hardware interrupt */
405
- injected = vcpu_inject_hi_exception (vcpu );
406
- if (!injected ) {
407
- /* inject NMI before maskable hardware interrupt */
408
- if (bitmap_test_and_clear_lock (ACRN_REQUEST_NMI , pending_req_bits )) {
409
- /* Inject NMI vector = 2 */
410
- exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD ,
388
+ /* SDM Vol 3 - table 6-2, inject high priority exception before
389
+ * maskable hardware interrupt */
390
+ injected = vcpu_inject_hi_exception (vcpu );
391
+ if (!injected ) {
392
+ /* inject NMI before maskable hardware interrupt */
393
+ if (bitmap_test_and_clear_lock (ACRN_REQUEST_NMI , pending_req_bits )) {
394
+ /* Inject NMI vector = 2 */
395
+ exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD ,
411
396
VMX_INT_INFO_VALID | (VMX_INT_TYPE_NMI << 8U ) | IDT_NMI );
397
+ injected = true;
398
+ } else {
399
+ /* handling pending vector injection:
400
+ * there are many reason inject failed, we need re-inject again
401
+ * here should take care
402
+ * - SW exception (not maskable by IF)
403
+ * - external interrupt, if IF clear, will keep in IDT_VEC_INFO_FIELD
404
+ * at next vm exit?
405
+ */
406
+ if ((arch -> idt_vectoring_info & VMX_INT_INFO_VALID ) != 0U ) {
407
+ exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD , arch -> idt_vectoring_info );
408
+ arch -> idt_vectoring_info = 0U ;
412
409
injected = true;
413
- } else {
414
- /* handling pending vector injection:
415
- * there are many reason inject failed, we need re-inject again
416
- * here should take care
417
- * - SW exception (not maskable by IF)
418
- * - external interrupt, if IF clear, will keep in IDT_VEC_INFO_FIELD
419
- * at next vm exit?
420
- */
421
- if ((arch -> idt_vectoring_info & VMX_INT_INFO_VALID ) != 0U ) {
422
- exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD , arch -> idt_vectoring_info );
423
- arch -> idt_vectoring_info = 0U ;
424
- injected = true;
425
- }
426
410
}
427
411
}
428
412
}
@@ -485,31 +469,6 @@ static inline bool acrn_inject_pending_intr(struct acrn_vcpu *vcpu,
485
469
return ret ;
486
470
}
487
471
488
- void cancel_event_injection (struct acrn_vcpu * vcpu )
489
- {
490
- uint32_t intinfo ;
491
-
492
- intinfo = exec_vmread32 (VMX_ENTRY_INT_INFO_FIELD );
493
-
494
- /*
495
- * If event is injected, we clear VMX_ENTRY_INT_INFO_FIELD,
496
- * save injection info, and mark inject event pending.
497
- * The event will be re-injected in next acrn_handle_pending_request
498
- * call.
499
- */
500
- if ((intinfo & VMX_INT_INFO_VALID ) != 0U ) {
501
- vcpu -> arch .inject_event_pending = true;
502
-
503
- if ((intinfo & (EXCEPTION_ERROR_CODE_VALID << 8U )) != 0U ) {
504
- vcpu -> arch .inject_info .error_code =
505
- exec_vmread32 (VMX_ENTRY_EXCEPTION_ERROR_CODE );
506
- }
507
-
508
- vcpu -> arch .inject_info .intr_info = intinfo ;
509
- exec_vmwrite32 (VMX_ENTRY_INT_INFO_FIELD , 0U );
510
- }
511
- }
512
-
513
472
/*
514
473
* @pre vcpu != NULL
515
474
*/
0 commit comments