aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 65fc11438b75..30e49fe7f8c0 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -338,7 +338,8 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
338} 338}
339 339
340static void svm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr, 340static void svm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr,
341 bool has_error_code, u32 error_code) 341 bool has_error_code, u32 error_code,
342 bool reinject)
342{ 343{
343 struct vcpu_svm *svm = to_svm(vcpu); 344 struct vcpu_svm *svm = to_svm(vcpu);
344 345
@@ -346,7 +347,8 @@ static void svm_queue_exception(struct kvm_vcpu *vcpu, unsigned nr,
346 * If we are within a nested VM we'd better #VMEXIT and let the guest 347 * If we are within a nested VM we'd better #VMEXIT and let the guest
347 * handle the exception 348 * handle the exception
348 */ 349 */
349 if (nested_svm_check_exception(svm, nr, has_error_code, error_code)) 350 if (!reinject &&
351 nested_svm_check_exception(svm, nr, has_error_code, error_code))
350 return; 352 return;
351 353
352 if (nr == BP_VECTOR && !svm_has(SVM_FEATURE_NRIP)) { 354 if (nr == BP_VECTOR && !svm_has(SVM_FEATURE_NRIP)) {
@@ -2918,8 +2920,6 @@ static void svm_complete_interrupts(struct vcpu_svm *svm)
2918 svm->vcpu.arch.nmi_injected = true; 2920 svm->vcpu.arch.nmi_injected = true;
2919 break; 2921 break;
2920 case SVM_EXITINTINFO_TYPE_EXEPT: 2922 case SVM_EXITINTINFO_TYPE_EXEPT:
2921 if (is_nested(svm))
2922 break;
2923 /* 2923 /*
2924 * In case of software exceptions, do not reinject the vector, 2924 * In case of software exceptions, do not reinject the vector,
2925 * but re-execute the instruction instead. Rewind RIP first 2925 * but re-execute the instruction instead. Rewind RIP first
@@ -2935,10 +2935,10 @@ static void svm_complete_interrupts(struct vcpu_svm *svm)
2935 } 2935 }
2936 if (exitintinfo & SVM_EXITINTINFO_VALID_ERR) { 2936 if (exitintinfo & SVM_EXITINTINFO_VALID_ERR) {
2937 u32 err = svm->vmcb->control.exit_int_info_err; 2937 u32 err = svm->vmcb->control.exit_int_info_err;
2938 kvm_queue_exception_e(&svm->vcpu, vector, err); 2938 kvm_requeue_exception_e(&svm->vcpu, vector, err);
2939 2939
2940 } else 2940 } else
2941 kvm_queue_exception(&svm->vcpu, vector); 2941 kvm_requeue_exception(&svm->vcpu, vector);
2942 break; 2942 break;
2943 case SVM_EXITINTINFO_TYPE_INTR: 2943 case SVM_EXITINTINFO_TYPE_INTR:
2944 kvm_queue_interrupt(&svm->vcpu, vector, false); 2944 kvm_queue_interrupt(&svm->vcpu, vector, false);