aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorGleb Natapov <gleb@redhat.com>2009-05-11 06:35:50 -0400
committerAvi Kivity <avi@redhat.com>2009-06-10 04:48:58 -0400
commit66fd3f7f901f29a557a473af595bf11b270b9ac2 (patch)
tree6adc1e94de39238a357980068f599070428767d8 /arch/x86/kvm/svm.c
parentf629cf8485c9e1063fd8b915fa3bde80917400a1 (diff)
KVM: Do not re-execute INTn instruction.
Re-inject event instead. This is what Intel suggest. Also use correct instruction length when re-injecting soft fault/interrupt. Signed-off-by: Gleb Natapov <gleb@redhat.com> Signed-off-by: Avi Kivity <avi@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 1315ce025e57..377c4f17d170 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -2310,13 +2310,13 @@ static void svm_queue_irq(struct kvm_vcpu *vcpu, unsigned nr)
2310 SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_INTR; 2310 SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_INTR;
2311} 2311}
2312 2312
2313static void svm_set_irq(struct kvm_vcpu *vcpu, int irq) 2313static void svm_set_irq(struct kvm_vcpu *vcpu)
2314{ 2314{
2315 struct vcpu_svm *svm = to_svm(vcpu); 2315 struct vcpu_svm *svm = to_svm(vcpu);
2316 2316
2317 nested_svm_intr(svm); 2317 nested_svm_intr(svm);
2318 2318
2319 svm_queue_irq(vcpu, irq); 2319 svm_queue_irq(vcpu, vcpu->arch.interrupt.nr);
2320} 2320}
2321 2321
2322static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr) 2322static void update_cr8_intercept(struct kvm_vcpu *vcpu, int tpr, int irr)
@@ -2418,7 +2418,7 @@ static void svm_complete_interrupts(struct vcpu_svm *svm)
2418 case SVM_EXITINTINFO_TYPE_EXEPT: 2418 case SVM_EXITINTINFO_TYPE_EXEPT:
2419 /* In case of software exception do not reinject an exception 2419 /* In case of software exception do not reinject an exception
2420 vector, but re-execute and instruction instead */ 2420 vector, but re-execute and instruction instead */
2421 if (vector == BP_VECTOR || vector == OF_VECTOR) 2421 if (kvm_exception_is_soft(vector))
2422 break; 2422 break;
2423 if (exitintinfo & SVM_EXITINTINFO_VALID_ERR) { 2423 if (exitintinfo & SVM_EXITINTINFO_VALID_ERR) {
2424 u32 err = svm->vmcb->control.exit_int_info_err; 2424 u32 err = svm->vmcb->control.exit_int_info_err;
@@ -2428,7 +2428,7 @@ static void svm_complete_interrupts(struct vcpu_svm *svm)
2428 kvm_queue_exception(&svm->vcpu, vector); 2428 kvm_queue_exception(&svm->vcpu, vector);
2429 break; 2429 break;
2430 case SVM_EXITINTINFO_TYPE_INTR: 2430 case SVM_EXITINTINFO_TYPE_INTR:
2431 kvm_queue_interrupt(&svm->vcpu, vector); 2431 kvm_queue_interrupt(&svm->vcpu, vector, false);
2432 break; 2432 break;
2433 default: 2433 default:
2434 break; 2434 break;