diff options
author | Avi Kivity <avi@qumranet.com> | 2007-11-25 15:22:50 +0200 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 17:53:18 +0200 |
commit | 7ee5d940f5064a7a4f0e53a8ffe755bc26a8b0f1 (patch) | |
tree | d14454d9254e90f77c5e7dc55b4adc21ae593e2f /drivers/kvm/svm.c | |
parent | c1a5d4f990ce034bcb19aebbb910c07019e60f6b (diff) |
KVM: Use generalized exception queue for injecting #UD
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r-- | drivers/kvm/svm.c | 12 |
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index f9769338c62..06beed7d4a0 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c @@ -207,13 +207,6 @@ static bool svm_exception_injected(struct kvm_vcpu *vcpu) return !(svm->vmcb->control.exit_int_info & SVM_EXITINTINFO_VALID); } -static void inject_ud(struct kvm_vcpu *vcpu) -{ - to_svm(vcpu)->vmcb->control.event_inj = SVM_EVTINJ_VALID | - SVM_EVTINJ_TYPE_EXEPT | - UD_VECTOR; -} - static int is_external_interrupt(u32 info) { info &= SVM_EVTINJ_TYPE_MASK | SVM_EVTINJ_VALID; @@ -948,8 +941,7 @@ static int ud_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) er = emulate_instruction(&svm->vcpu, kvm_run, 0, 0, 0); if (er != EMULATE_DONE) - inject_ud(&svm->vcpu); - + kvm_queue_exception(&svm->vcpu, UD_VECTOR); return 1; } @@ -1027,7 +1019,7 @@ static int vmmcall_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) static int invalid_op_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run) { - inject_ud(&svm->vcpu); + kvm_queue_exception(&svm->vcpu, UD_VECTOR); return 1; } |