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;
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;
}
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;
}
return !(vmx->idt_vectoring_info & VECTORING_INFO_VALID_MASK);
}
-static void vmx_inject_ud(struct kvm_vcpu *vcpu)
-{
- vmcs_write32(VM_ENTRY_INTR_INFO_FIELD,
- UD_VECTOR |
- INTR_TYPE_EXCEPTION |
- INTR_INFO_VALID_MASK);
-}
-
/*
* Swap MSR entry in host/guest MSR entry array.
*/
if (is_invalid_opcode(intr_info)) {
er = emulate_instruction(vcpu, kvm_run, 0, 0, 0);
if (er != EMULATE_DONE)
- vmx_inject_ud(vcpu);
-
+ kvm_queue_exception(vcpu, UD_VECTOR);
return 1;
}