|
Lines 1106-1111
static void init_vmcb(struct vcpu_svm *s
Link Here
|
| 1106 |
set_exception_intercept(svm, PF_VECTOR); |
1106 |
set_exception_intercept(svm, PF_VECTOR); |
| 1107 |
set_exception_intercept(svm, UD_VECTOR); |
1107 |
set_exception_intercept(svm, UD_VECTOR); |
| 1108 |
set_exception_intercept(svm, MC_VECTOR); |
1108 |
set_exception_intercept(svm, MC_VECTOR); |
|
|
1109 |
set_exception_intercept(svm, AC_VECTOR); |
| 1110 |
set_exception_intercept(svm, DB_VECTOR); |
| 1109 |
|
1111 |
|
| 1110 |
set_intercept(svm, INTERCEPT_INTR); |
1112 |
set_intercept(svm, INTERCEPT_INTR); |
| 1111 |
set_intercept(svm, INTERCEPT_NMI); |
1113 |
set_intercept(svm, INTERCEPT_NMI); |
|
Lines 1641-1660
static void svm_set_segment(struct kvm_v
Link Here
|
| 1641 |
mark_dirty(svm->vmcb, VMCB_SEG); |
1643 |
mark_dirty(svm->vmcb, VMCB_SEG); |
| 1642 |
} |
1644 |
} |
| 1643 |
|
1645 |
|
| 1644 |
static void update_db_bp_intercept(struct kvm_vcpu *vcpu) |
1646 |
static void update_bp_intercept(struct kvm_vcpu *vcpu) |
| 1645 |
{ |
1647 |
{ |
| 1646 |
struct vcpu_svm *svm = to_svm(vcpu); |
1648 |
struct vcpu_svm *svm = to_svm(vcpu); |
| 1647 |
|
1649 |
|
| 1648 |
clr_exception_intercept(svm, DB_VECTOR); |
|
|
| 1649 |
clr_exception_intercept(svm, BP_VECTOR); |
1650 |
clr_exception_intercept(svm, BP_VECTOR); |
| 1650 |
|
1651 |
|
| 1651 |
if (svm->nmi_singlestep) |
|
|
| 1652 |
set_exception_intercept(svm, DB_VECTOR); |
| 1653 |
|
| 1654 |
if (vcpu->guest_debug & KVM_GUESTDBG_ENABLE) { |
1652 |
if (vcpu->guest_debug & KVM_GUESTDBG_ENABLE) { |
| 1655 |
if (vcpu->guest_debug & |
|
|
| 1656 |
(KVM_GUESTDBG_SINGLESTEP | KVM_GUESTDBG_USE_HW_BP)) |
| 1657 |
set_exception_intercept(svm, DB_VECTOR); |
| 1658 |
if (vcpu->guest_debug & KVM_GUESTDBG_USE_SW_BP) |
1653 |
if (vcpu->guest_debug & KVM_GUESTDBG_USE_SW_BP) |
| 1659 |
set_exception_intercept(svm, BP_VECTOR); |
1654 |
set_exception_intercept(svm, BP_VECTOR); |
| 1660 |
} else |
1655 |
} else |
|
Lines 1760-1766
static int db_interception(struct vcpu_s
Link Here
|
| 1760 |
if (!(svm->vcpu.guest_debug & KVM_GUESTDBG_SINGLESTEP)) |
1755 |
if (!(svm->vcpu.guest_debug & KVM_GUESTDBG_SINGLESTEP)) |
| 1761 |
svm->vmcb->save.rflags &= |
1756 |
svm->vmcb->save.rflags &= |
| 1762 |
~(X86_EFLAGS_TF | X86_EFLAGS_RF); |
1757 |
~(X86_EFLAGS_TF | X86_EFLAGS_RF); |
| 1763 |
update_db_bp_intercept(&svm->vcpu); |
|
|
| 1764 |
} |
1758 |
} |
| 1765 |
|
1759 |
|
| 1766 |
if (svm->vcpu.guest_debug & |
1760 |
if (svm->vcpu.guest_debug & |
|
Lines 1795-1800
static int ud_interception(struct vcpu_s
Link Here
|
| 1795 |
return 1; |
1789 |
return 1; |
| 1796 |
} |
1790 |
} |
| 1797 |
|
1791 |
|
|
|
1792 |
static int ac_interception(struct vcpu_svm *svm) |
| 1793 |
{ |
| 1794 |
kvm_queue_exception_e(&svm->vcpu, AC_VECTOR, 0); |
| 1795 |
return 1; |
| 1796 |
} |
| 1797 |
|
| 1798 |
static void svm_fpu_activate(struct kvm_vcpu *vcpu) |
1798 |
static void svm_fpu_activate(struct kvm_vcpu *vcpu) |
| 1799 |
{ |
1799 |
{ |
| 1800 |
struct vcpu_svm *svm = to_svm(vcpu); |
1800 |
struct vcpu_svm *svm = to_svm(vcpu); |
|
Lines 3369-3374
static int (*const svm_exit_handlers[])(
Link Here
|
| 3369 |
[SVM_EXIT_EXCP_BASE + PF_VECTOR] = pf_interception, |
3369 |
[SVM_EXIT_EXCP_BASE + PF_VECTOR] = pf_interception, |
| 3370 |
[SVM_EXIT_EXCP_BASE + NM_VECTOR] = nm_interception, |
3370 |
[SVM_EXIT_EXCP_BASE + NM_VECTOR] = nm_interception, |
| 3371 |
[SVM_EXIT_EXCP_BASE + MC_VECTOR] = mc_interception, |
3371 |
[SVM_EXIT_EXCP_BASE + MC_VECTOR] = mc_interception, |
|
|
3372 |
[SVM_EXIT_EXCP_BASE + AC_VECTOR] = ac_interception, |
| 3372 |
[SVM_EXIT_INTR] = intr_interception, |
3373 |
[SVM_EXIT_INTR] = intr_interception, |
| 3373 |
[SVM_EXIT_NMI] = nmi_interception, |
3374 |
[SVM_EXIT_NMI] = nmi_interception, |
| 3374 |
[SVM_EXIT_SMI] = nop_on_interception, |
3375 |
[SVM_EXIT_SMI] = nop_on_interception, |
|
Lines 3756-3762
static void enable_nmi_window(struct kvm
Link Here
|
| 3756 |
*/ |
3757 |
*/ |
| 3757 |
svm->nmi_singlestep = true; |
3758 |
svm->nmi_singlestep = true; |
| 3758 |
svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF); |
3759 |
svm->vmcb->save.rflags |= (X86_EFLAGS_TF | X86_EFLAGS_RF); |
| 3759 |
update_db_bp_intercept(vcpu); |
|
|
| 3760 |
} |
3760 |
} |
| 3761 |
|
3761 |
|
| 3762 |
static int svm_set_tss_addr(struct kvm *kvm, unsigned int addr) |
3762 |
static int svm_set_tss_addr(struct kvm *kvm, unsigned int addr) |
|
Lines 4382-4388
static struct kvm_x86_ops svm_x86_ops =
Link Here
|
| 4382 |
.vcpu_load = svm_vcpu_load, |
4382 |
.vcpu_load = svm_vcpu_load, |
| 4383 |
.vcpu_put = svm_vcpu_put, |
4383 |
.vcpu_put = svm_vcpu_put, |
| 4384 |
|
4384 |
|
| 4385 |
.update_db_bp_intercept = update_db_bp_intercept, |
4385 |
.update_db_bp_intercept = update_bp_intercept, |
| 4386 |
.get_msr = svm_get_msr, |
4386 |
.get_msr = svm_get_msr, |
| 4387 |
.set_msr = svm_set_msr, |
4387 |
.set_msr = svm_set_msr, |
| 4388 |
.get_segment_base = svm_get_segment_base, |
4388 |
.get_segment_base = svm_get_segment_base, |