Commit f629cf84 authored by Gleb Natapov's avatar Gleb Natapov Committed by Avi Kivity

KVM: skip_emulated_instruction() decode instruction if size is not known

Signed-off-by: default avatarGleb Natapov <gleb@redhat.com>
Signed-off-by: default avatarAvi Kivity <avi@redhat.com>
parent 923c61bb
...@@ -228,7 +228,9 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu) ...@@ -228,7 +228,9 @@ static void skip_emulated_instruction(struct kvm_vcpu *vcpu)
struct vcpu_svm *svm = to_svm(vcpu); struct vcpu_svm *svm = to_svm(vcpu);
if (!svm->next_rip) { if (!svm->next_rip) {
printk(KERN_DEBUG "%s: NOP\n", __func__); if (emulate_instruction(vcpu, vcpu->run, 0, 0, EMULTYPE_SKIP) !=
EMULATE_DONE)
printk(KERN_DEBUG "%s: NOP\n", __func__);
return; return;
} }
if (svm->next_rip - kvm_rip_read(vcpu) > MAX_INST_SIZE) if (svm->next_rip - kvm_rip_read(vcpu) > MAX_INST_SIZE)
...@@ -1868,11 +1870,8 @@ static int task_switch_interception(struct vcpu_svm *svm, ...@@ -1868,11 +1870,8 @@ static int task_switch_interception(struct vcpu_svm *svm,
if (reason != TASK_SWITCH_GATE || if (reason != TASK_SWITCH_GATE ||
int_type == SVM_EXITINTINFO_TYPE_SOFT || int_type == SVM_EXITINTINFO_TYPE_SOFT ||
(int_type == SVM_EXITINTINFO_TYPE_EXEPT && (int_type == SVM_EXITINTINFO_TYPE_EXEPT &&
(int_vec == OF_VECTOR || int_vec == BP_VECTOR))) { (int_vec == OF_VECTOR || int_vec == BP_VECTOR)))
if (emulate_instruction(&svm->vcpu, kvm_run, 0, 0, skip_emulated_instruction(&svm->vcpu);
EMULTYPE_SKIP) != EMULATE_DONE)
return 0;
}
return kvm_task_switch(&svm->vcpu, tss_selector, reason); return kvm_task_switch(&svm->vcpu, tss_selector, reason);
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment