diff options
author | Avi Kivity <avi@qumranet.com> | 2007-11-25 07:04:58 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:53:18 -0500 |
commit | c3c91fee5195ba5176a6da5ddc2a2822243eb79f (patch) | |
tree | 1fcccd77e5705d5f885bbb24ecb08bd93cf71c63 /drivers/kvm/svm.c | |
parent | 298101da2f507c13eaf179ee4507a7c0fe3e7b06 (diff) |
KVM: Replace page fault injection by the generalized exception queue
Signed-off-by: Avi Kivity <avi@qumranet.com>
Diffstat (limited to 'drivers/kvm/svm.c')
-rw-r--r-- | drivers/kvm/svm.c | 35 |
1 files changed, 0 insertions, 35 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 87072c647f28..aa8e90b404a0 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -225,12 +225,6 @@ static void inject_ud(struct kvm_vcpu *vcpu) | |||
225 | UD_VECTOR; | 225 | UD_VECTOR; |
226 | } | 226 | } |
227 | 227 | ||
228 | static int is_page_fault(uint32_t info) | ||
229 | { | ||
230 | info &= SVM_EVTINJ_VEC_MASK | SVM_EVTINJ_TYPE_MASK | SVM_EVTINJ_VALID; | ||
231 | return info == (PF_VECTOR | SVM_EVTINJ_VALID | SVM_EVTINJ_TYPE_EXEPT); | ||
232 | } | ||
233 | |||
234 | static int is_external_interrupt(u32 info) | 228 | static int is_external_interrupt(u32 info) |
235 | { | 229 | { |
236 | info &= SVM_EVTINJ_TYPE_MASK | SVM_EVTINJ_VALID; | 230 | info &= SVM_EVTINJ_TYPE_MASK | SVM_EVTINJ_VALID; |
@@ -1624,34 +1618,6 @@ static void svm_set_cr3(struct kvm_vcpu *vcpu, unsigned long root) | |||
1624 | } | 1618 | } |
1625 | } | 1619 | } |
1626 | 1620 | ||
1627 | static void svm_inject_page_fault(struct kvm_vcpu *vcpu, | ||
1628 | unsigned long addr, | ||
1629 | uint32_t err_code) | ||
1630 | { | ||
1631 | struct vcpu_svm *svm = to_svm(vcpu); | ||
1632 | uint32_t exit_int_info = svm->vmcb->control.exit_int_info; | ||
1633 | |||
1634 | ++vcpu->stat.pf_guest; | ||
1635 | |||
1636 | if (is_page_fault(exit_int_info)) { | ||
1637 | |||
1638 | svm->vmcb->control.event_inj_err = 0; | ||
1639 | svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | | ||
1640 | SVM_EVTINJ_VALID_ERR | | ||
1641 | SVM_EVTINJ_TYPE_EXEPT | | ||
1642 | DF_VECTOR; | ||
1643 | return; | ||
1644 | } | ||
1645 | vcpu->cr2 = addr; | ||
1646 | svm->vmcb->save.cr2 = addr; | ||
1647 | svm->vmcb->control.event_inj = SVM_EVTINJ_VALID | | ||
1648 | SVM_EVTINJ_VALID_ERR | | ||
1649 | SVM_EVTINJ_TYPE_EXEPT | | ||
1650 | PF_VECTOR; | ||
1651 | svm->vmcb->control.event_inj_err = err_code; | ||
1652 | } | ||
1653 | |||
1654 | |||
1655 | static int is_disabled(void) | 1621 | static int is_disabled(void) |
1656 | { | 1622 | { |
1657 | u64 vm_cr; | 1623 | u64 vm_cr; |
@@ -1721,7 +1687,6 @@ static struct kvm_x86_ops svm_x86_ops = { | |||
1721 | .set_rflags = svm_set_rflags, | 1687 | .set_rflags = svm_set_rflags, |
1722 | 1688 | ||
1723 | .tlb_flush = svm_flush_tlb, | 1689 | .tlb_flush = svm_flush_tlb, |
1724 | .inject_page_fault = svm_inject_page_fault, | ||
1725 | 1690 | ||
1726 | .inject_gp = svm_inject_gp, | 1691 | .inject_gp = svm_inject_gp, |
1727 | 1692 | ||