aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/kvm/svm.c
diff options
context:
space:
mode:
authorAvi Kivity <avi@qumranet.com>2007-11-25 08:22:50 -0500
committerAvi Kivity <avi@qumranet.com>2008-01-30 10:53:18 -0500
commit7ee5d940f5064a7a4f0e53a8ffe755bc26a8b0f1 (patch)
treed14454d9254e90f77c5e7dc55b4adc21ae593e2f /drivers/kvm/svm.c
parentc1a5d4f990ce034bcb19aebbb910c07019e60f6b (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.c12
1 files changed, 2 insertions, 10 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c
index f9769338c621..06beed7d4a08 100644
--- a/drivers/kvm/svm.c
+++ b/drivers/kvm/svm.c
@@ -207,13 +207,6 @@ static bool svm_exception_injected(struct kvm_vcpu *vcpu)
207 return !(svm->vmcb->control.exit_int_info & SVM_EXITINTINFO_VALID); 207 return !(svm->vmcb->control.exit_int_info & SVM_EXITINTINFO_VALID);
208} 208}
209 209
210static void inject_ud(struct kvm_vcpu *vcpu)
211{
212 to_svm(vcpu)->vmcb->control.event_inj = SVM_EVTINJ_VALID |
213 SVM_EVTINJ_TYPE_EXEPT |
214 UD_VECTOR;
215}
216
217static int is_external_interrupt(u32 info) 210static int is_external_interrupt(u32 info)
218{ 211{
219 info &= SVM_EVTINJ_TYPE_MASK | SVM_EVTINJ_VALID; 212 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)
948 941
949 er = emulate_instruction(&svm->vcpu, kvm_run, 0, 0, 0); 942 er = emulate_instruction(&svm->vcpu, kvm_run, 0, 0, 0);
950 if (er != EMULATE_DONE) 943 if (er != EMULATE_DONE)
951 inject_ud(&svm->vcpu); 944 kvm_queue_exception(&svm->vcpu, UD_VECTOR);
952
953 return 1; 945 return 1;
954} 946}
955 947
@@ -1027,7 +1019,7 @@ static int vmmcall_interception(struct vcpu_svm *svm, struct kvm_run *kvm_run)
1027static int invalid_op_interception(struct vcpu_svm *svm, 1019static int invalid_op_interception(struct vcpu_svm *svm,
1028 struct kvm_run *kvm_run) 1020 struct kvm_run *kvm_run)
1029{ 1021{
1030 inject_ud(&svm->vcpu); 1022 kvm_queue_exception(&svm->vcpu, UD_VECTOR);
1031 return 1; 1023 return 1;
1032} 1024}
1033 1025