diff options
-rw-r--r-- | arch/x86/kvm/svm.c | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c index 3bb6d4b92b34..67fad6641d55 100644 --- a/arch/x86/kvm/svm.c +++ b/arch/x86/kvm/svm.c | |||
@@ -1359,18 +1359,15 @@ static int nested_svm_check_permissions(struct vcpu_svm *svm) | |||
1359 | static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr, | 1359 | static int nested_svm_check_exception(struct vcpu_svm *svm, unsigned nr, |
1360 | bool has_error_code, u32 error_code) | 1360 | bool has_error_code, u32 error_code) |
1361 | { | 1361 | { |
1362 | if (is_nested(svm)) { | 1362 | if (!is_nested(svm)) |
1363 | svm->vmcb->control.exit_code = SVM_EXIT_EXCP_BASE + nr; | 1363 | return 0; |
1364 | svm->vmcb->control.exit_code_hi = 0; | ||
1365 | svm->vmcb->control.exit_info_1 = error_code; | ||
1366 | svm->vmcb->control.exit_info_2 = svm->vcpu.arch.cr2; | ||
1367 | if (nested_svm_exit_handled(svm, false)) { | ||
1368 | nsvm_printk("VMexit -> EXCP 0x%x\n", nr); | ||
1369 | return 1; | ||
1370 | } | ||
1371 | } | ||
1372 | 1364 | ||
1373 | return 0; | 1365 | svm->vmcb->control.exit_code = SVM_EXIT_EXCP_BASE + nr; |
1366 | svm->vmcb->control.exit_code_hi = 0; | ||
1367 | svm->vmcb->control.exit_info_1 = error_code; | ||
1368 | svm->vmcb->control.exit_info_2 = svm->vcpu.arch.cr2; | ||
1369 | |||
1370 | return nested_svm_exit_handled(svm, false); | ||
1374 | } | 1371 | } |
1375 | 1372 | ||
1376 | static inline int nested_svm_intr(struct vcpu_svm *svm) | 1373 | static inline int nested_svm_intr(struct vcpu_svm *svm) |