diff options
author | Avi Kivity <avi@qumranet.com> | 2007-11-25 07:12:03 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:53:18 -0500 |
commit | c1a5d4f990ce034bcb19aebbb910c07019e60f6b (patch) | |
tree | 23aeb993f99c0b9523486c0dcbedb61247352a45 /drivers/kvm/vmx.c | |
parent | c3c91fee5195ba5176a6da5ddc2a2822243eb79f (diff) |
KVM: Replace #GP injection by the generalized exception queue
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/vmx.c')
-rw-r--r-- | drivers/kvm/vmx.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/drivers/kvm/vmx.c b/drivers/kvm/vmx.c index be0b12e709e5..3b3c5f7d2e7c 100644 --- a/drivers/kvm/vmx.c +++ b/drivers/kvm/vmx.c | |||
@@ -613,18 +613,6 @@ static bool vmx_exception_injected(struct kvm_vcpu *vcpu) | |||
613 | return !(vmx->idt_vectoring_info & VECTORING_INFO_VALID_MASK); | 613 | return !(vmx->idt_vectoring_info & VECTORING_INFO_VALID_MASK); |
614 | } | 614 | } |
615 | 615 | ||
616 | static void vmx_inject_gp(struct kvm_vcpu *vcpu, unsigned error_code) | ||
617 | { | ||
618 | printk(KERN_DEBUG "inject_general_protection: rip 0x%lx\n", | ||
619 | vmcs_readl(GUEST_RIP)); | ||
620 | vmcs_write32(VM_ENTRY_EXCEPTION_ERROR_CODE, error_code); | ||
621 | vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, | ||
622 | GP_VECTOR | | ||
623 | INTR_TYPE_EXCEPTION | | ||
624 | INTR_INFO_DELIEVER_CODE_MASK | | ||
625 | INTR_INFO_VALID_MASK); | ||
626 | } | ||
627 | |||
628 | static void vmx_inject_ud(struct kvm_vcpu *vcpu) | 616 | static void vmx_inject_ud(struct kvm_vcpu *vcpu) |
629 | { | 617 | { |
630 | vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, | 618 | vmcs_write32(VM_ENTRY_INTR_INFO_FIELD, |
@@ -2083,7 +2071,7 @@ static int handle_rdmsr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
2083 | u64 data; | 2071 | u64 data; |
2084 | 2072 | ||
2085 | if (vmx_get_msr(vcpu, ecx, &data)) { | 2073 | if (vmx_get_msr(vcpu, ecx, &data)) { |
2086 | vmx_inject_gp(vcpu, 0); | 2074 | kvm_inject_gp(vcpu, 0); |
2087 | return 1; | 2075 | return 1; |
2088 | } | 2076 | } |
2089 | 2077 | ||
@@ -2101,7 +2089,7 @@ static int handle_wrmsr(struct kvm_vcpu *vcpu, struct kvm_run *kvm_run) | |||
2101 | | ((u64)(vcpu->regs[VCPU_REGS_RDX] & -1u) << 32); | 2089 | | ((u64)(vcpu->regs[VCPU_REGS_RDX] & -1u) << 32); |
2102 | 2090 | ||
2103 | if (vmx_set_msr(vcpu, ecx, data) != 0) { | 2091 | if (vmx_set_msr(vcpu, ecx, data) != 0) { |
2104 | vmx_inject_gp(vcpu, 0); | 2092 | kvm_inject_gp(vcpu, 0); |
2105 | return 1; | 2093 | return 1; |
2106 | } | 2094 | } |
2107 | 2095 | ||
@@ -2619,8 +2607,6 @@ static struct kvm_x86_ops vmx_x86_ops = { | |||
2619 | 2607 | ||
2620 | .tlb_flush = vmx_flush_tlb, | 2608 | .tlb_flush = vmx_flush_tlb, |
2621 | 2609 | ||
2622 | .inject_gp = vmx_inject_gp, | ||
2623 | |||
2624 | .run = vmx_vcpu_run, | 2610 | .run = vmx_vcpu_run, |
2625 | .handle_exit = kvm_handle_exit, | 2611 | .handle_exit = kvm_handle_exit, |
2626 | .skip_emulated_instruction = skip_emulated_instruction, | 2612 | .skip_emulated_instruction = skip_emulated_instruction, |