diff options
author | Gleb Natapov <gleb@redhat.com> | 2009-05-11 06:35:50 -0400 |
---|---|---|
committer | Avi Kivity <avi@redhat.com> | 2009-06-10 04:48:58 -0400 |
commit | 66fd3f7f901f29a557a473af595bf11b270b9ac2 (patch) | |
tree | 6adc1e94de39238a357980068f599070428767d8 /arch/x86/kvm/x86.c | |
parent | f629cf8485c9e1063fd8b915fa3bde80917400a1 (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/x86.c')
-rw-r--r-- | arch/x86/kvm/x86.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/arch/x86/kvm/x86.c b/arch/x86/kvm/x86.c index 54eec3565485..73cfe87fba10 100644 --- a/arch/x86/kvm/x86.c +++ b/arch/x86/kvm/x86.c | |||
@@ -1441,7 +1441,7 @@ static int kvm_vcpu_ioctl_interrupt(struct kvm_vcpu *vcpu, | |||
1441 | return -ENXIO; | 1441 | return -ENXIO; |
1442 | vcpu_load(vcpu); | 1442 | vcpu_load(vcpu); |
1443 | 1443 | ||
1444 | kvm_queue_interrupt(vcpu, irq->irq); | 1444 | kvm_queue_interrupt(vcpu, irq->irq, false); |
1445 | 1445 | ||
1446 | vcpu_put(vcpu); | 1446 | vcpu_put(vcpu); |
1447 | 1447 | ||
@@ -3161,7 +3161,7 @@ static void inject_irq(struct kvm_vcpu *vcpu) | |||
3161 | } | 3161 | } |
3162 | 3162 | ||
3163 | if (vcpu->arch.interrupt.pending) { | 3163 | if (vcpu->arch.interrupt.pending) { |
3164 | kvm_x86_ops->set_irq(vcpu, vcpu->arch.interrupt.nr); | 3164 | kvm_x86_ops->set_irq(vcpu); |
3165 | return; | 3165 | return; |
3166 | } | 3166 | } |
3167 | 3167 | ||
@@ -3174,8 +3174,9 @@ static void inject_irq(struct kvm_vcpu *vcpu) | |||
3174 | } | 3174 | } |
3175 | } else if (kvm_cpu_has_interrupt(vcpu)) { | 3175 | } else if (kvm_cpu_has_interrupt(vcpu)) { |
3176 | if (kvm_x86_ops->interrupt_allowed(vcpu)) { | 3176 | if (kvm_x86_ops->interrupt_allowed(vcpu)) { |
3177 | kvm_queue_interrupt(vcpu, kvm_cpu_get_interrupt(vcpu)); | 3177 | kvm_queue_interrupt(vcpu, kvm_cpu_get_interrupt(vcpu), |
3178 | kvm_x86_ops->set_irq(vcpu, vcpu->arch.interrupt.nr); | 3178 | false); |
3179 | kvm_x86_ops->set_irq(vcpu); | ||
3179 | } | 3180 | } |
3180 | } | 3181 | } |
3181 | } | 3182 | } |
@@ -4098,7 +4099,7 @@ int kvm_arch_vcpu_ioctl_set_sregs(struct kvm_vcpu *vcpu, | |||
4098 | pending_vec = find_first_bit( | 4099 | pending_vec = find_first_bit( |
4099 | (const unsigned long *)sregs->interrupt_bitmap, max_bits); | 4100 | (const unsigned long *)sregs->interrupt_bitmap, max_bits); |
4100 | if (pending_vec < max_bits) { | 4101 | if (pending_vec < max_bits) { |
4101 | kvm_queue_interrupt(vcpu, pending_vec); | 4102 | kvm_queue_interrupt(vcpu, pending_vec, false); |
4102 | pr_debug("Set back pending irq %d\n", pending_vec); | 4103 | pr_debug("Set back pending irq %d\n", pending_vec); |
4103 | if (irqchip_in_kernel(vcpu->kvm)) | 4104 | if (irqchip_in_kernel(vcpu->kvm)) |
4104 | kvm_pic_clear_isr_ack(vcpu->kvm); | 4105 | kvm_pic_clear_isr_ack(vcpu->kvm); |