File tree Expand file tree Collapse file tree 7 files changed +20
-19
lines changed Expand file tree Collapse file tree 7 files changed +20
-19
lines changed Original file line number Diff line number Diff line change @@ -930,7 +930,7 @@ vlapic_set_cr8(struct vlapic *vlapic, uint64_t val)
930
930
uint8_t tpr ;
931
931
932
932
if (val & ~0xf ) {
933
- vcpu_inject_gp (vlapic -> vcpu );
933
+ vcpu_inject_gp (vlapic -> vcpu , 0 );
934
934
return ;
935
935
}
936
936
Original file line number Diff line number Diff line change @@ -185,7 +185,7 @@ int rdmsr_vmexit_handler(struct vcpu *vcpu)
185
185
case MSR_IA32_MTRR_CAP :
186
186
case MSR_IA32_MTRR_DEF_TYPE :
187
187
{
188
- vcpu_inject_gp (vcpu );
188
+ vcpu_inject_gp (vcpu , 0 );
189
189
break ;
190
190
}
191
191
case MSR_IA32_BIOS_SIGN_ID :
@@ -236,7 +236,7 @@ int rdmsr_vmexit_handler(struct vcpu *vcpu)
236
236
msr <= MSR_IA32_VMX_TRUE_ENTRY_CTLS ))) {
237
237
pr_warn ("rdmsr: %lx should not come here!" , msr );
238
238
}
239
- vcpu_inject_gp (vcpu );
239
+ vcpu_inject_gp (vcpu , 0 );
240
240
v = 0 ;
241
241
break ;
242
242
}
@@ -284,7 +284,7 @@ int wrmsr_vmexit_handler(struct vcpu *vcpu)
284
284
case MSR_IA32_MTRR_CAP :
285
285
case MSR_IA32_MTRR_DEF_TYPE :
286
286
{
287
- vcpu_inject_gp (vcpu );
287
+ vcpu_inject_gp (vcpu , 0 );
288
288
break ;
289
289
}
290
290
case MSR_IA32_BIOS_SIGN_ID :
@@ -348,7 +348,7 @@ int wrmsr_vmexit_handler(struct vcpu *vcpu)
348
348
msr <= MSR_IA32_VMX_TRUE_ENTRY_CTLS ))) {
349
349
pr_warn ("rdmsr: %lx should not come here!" , msr );
350
350
}
351
- vcpu_inject_gp (vcpu );
351
+ vcpu_inject_gp (vcpu , 0 );
352
352
break ;
353
353
}
354
354
}
Original file line number Diff line number Diff line change @@ -316,9 +316,10 @@ int vcpu_inject_nmi(struct vcpu *vcpu)
316
316
return vcpu_make_request (vcpu , ACRN_REQUEST_NMI );
317
317
}
318
318
319
- int vcpu_inject_gp (struct vcpu * vcpu )
319
+ int vcpu_inject_gp (struct vcpu * vcpu , uint32_t err_code )
320
320
{
321
- return vcpu_make_request (vcpu , ACRN_REQUEST_GP );
321
+ vcpu_queue_exception (vcpu , IDT_GP , err_code );
322
+ return vcpu_make_request (vcpu , ACRN_REQUEST_EXCP );
322
323
}
323
324
324
325
int interrupt_window_vmexit_handler (struct vcpu * vcpu )
@@ -533,8 +534,8 @@ int exception_vmexit_handler(struct vcpu *vcpu)
533
534
534
535
/* Handle all other exceptions */
535
536
VCPU_RETAIN_RIP (vcpu );
536
- vcpu -> arch_vcpu . exception_info . exception = exception_vector ;
537
- vcpu -> arch_vcpu . exception_info . error = int_err_code ;
537
+
538
+ vcpu_queue_exception ( vcpu , exception_vector , int_err_code ) ;
538
539
539
540
if (exception_vector == IDT_MC ) {
540
541
/* just print error message for #MC, it then will be injected
Original file line number Diff line number Diff line change @@ -437,7 +437,7 @@ static int xsetbv_vmexit_handler(struct vcpu *vcpu)
437
437
438
438
val64 = exec_vmread (VMX_GUEST_CR4 );
439
439
if (!(val64 & CR4_OSXSAVE )) {
440
- vcpu_inject_gp (vcpu );
440
+ vcpu_inject_gp (vcpu , 0 );
441
441
return -1 ;
442
442
}
443
443
@@ -449,7 +449,7 @@ static int xsetbv_vmexit_handler(struct vcpu *vcpu)
449
449
450
450
/*to access XCR0,'rcx' should be 0*/
451
451
if (ctx_ptr -> guest_cpu_regs .regs .rcx != 0 ) {
452
- vcpu_inject_gp (vcpu );
452
+ vcpu_inject_gp (vcpu , 0 );
453
453
return -1 ;
454
454
}
455
455
@@ -458,7 +458,7 @@ static int xsetbv_vmexit_handler(struct vcpu *vcpu)
458
458
459
459
/*bit 0(x87 state) of XCR0 can't be cleared*/
460
460
if (!(val64 & 0x01 )) {
461
- vcpu_inject_gp (vcpu );
461
+ vcpu_inject_gp (vcpu , 0 );
462
462
return -1 ;
463
463
}
464
464
@@ -467,7 +467,7 @@ static int xsetbv_vmexit_handler(struct vcpu *vcpu)
467
467
*to use AVX instructions.
468
468
**/
469
469
if (((val64 >> 1 ) & 0x3 ) == 0x2 ) {
470
- vcpu_inject_gp (vcpu );
470
+ vcpu_inject_gp (vcpu , 0 );
471
471
return -1 ;
472
472
}
473
473
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ void vcpu_thread(struct vcpu *vcpu)
117
117
pr_fatal ("dispatch VM exit handler failed for reason"
118
118
" %d, ret = %d!" ,
119
119
vcpu -> arch_vcpu .exit_reason & 0xFFFF , ret );
120
- vcpu_inject_gp (vcpu );
120
+ vcpu_inject_gp (vcpu , 0 );
121
121
continue ;
122
122
}
123
123
Original file line number Diff line number Diff line change @@ -64,10 +64,10 @@ int get_req_info(char *str, int str_max);
64
64
/*
65
65
* VCPU related APIs
66
66
*/
67
- #define ACRN_REQUEST_EVENT 0
68
- #define ACRN_REQUEST_EXTINT 1
69
- #define ACRN_REQUEST_NMI 2
70
- #define ACRN_REQUEST_GP 3
67
+ #define ACRN_REQUEST_EXCP 0
68
+ #define ACRN_REQUEST_EVENT 1
69
+ #define ACRN_REQUEST_EXTINT 2
70
+ #define ACRN_REQUEST_NMI 3
71
71
#define ACRN_REQUEST_TMR_UPDATE 4
72
72
#define ACRN_REQUEST_TLB_FLUSH 5
73
73
#define ACRN_REQUEST_TRP_FAULT 6
Original file line number Diff line number Diff line change @@ -183,7 +183,7 @@ extern spurious_handler_t spurious_handler;
183
183
184
184
int vcpu_inject_extint (struct vcpu * vcpu );
185
185
int vcpu_inject_nmi (struct vcpu * vcpu );
186
- int vcpu_inject_gp (struct vcpu * vcpu );
186
+ int vcpu_inject_gp (struct vcpu * vcpu , uint32_t err_code );
187
187
int vcpu_make_request (struct vcpu * vcpu , int eventid );
188
188
int vcpu_queue_exception (struct vcpu * vcpu , int32_t vector , uint32_t err_code );
189
189
You can’t perform that action at this time.
0 commit comments