aboutsummaryrefslogtreecommitdiffstats
path: root/arch/x86/kvm/svm.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-01-20 12:20:20 -0500
committerMarcelo Tosatti <mtosatti@redhat.com>2010-03-01 10:36:02 -0500
commit727f5a23e2080b19da392f17fa3158a0941f81f5 (patch)
treea8be1259e0f31509e7c40a773711e7815f327ee0 /arch/x86/kvm/svm.c
parentc76de350c8a3ba770becc17eaa744dc3c7642295 (diff)
KVM: SVM: Trap all debug register accesses
To enable proper debug register emulation under all conditions, trap access to all DR0..7. This may be optimized later on. Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com> Signed-off-by: Marcelo Tosatti <mtosatti@redhat.com>
Diffstat (limited to 'arch/x86/kvm/svm.c')
-rw-r--r--arch/x86/kvm/svm.c14
1 files changed, 13 insertions, 1 deletions
diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 4295dfcc6031..a281368c3b96 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -554,13 +554,19 @@ static void init_vmcb(struct vcpu_svm *svm)
554 control->intercept_dr_read = INTERCEPT_DR0_MASK | 554 control->intercept_dr_read = INTERCEPT_DR0_MASK |
555 INTERCEPT_DR1_MASK | 555 INTERCEPT_DR1_MASK |
556 INTERCEPT_DR2_MASK | 556 INTERCEPT_DR2_MASK |
557 INTERCEPT_DR3_MASK; 557 INTERCEPT_DR3_MASK |
558 INTERCEPT_DR4_MASK |
559 INTERCEPT_DR5_MASK |
560 INTERCEPT_DR6_MASK |
561 INTERCEPT_DR7_MASK;
558 562
559 control->intercept_dr_write = INTERCEPT_DR0_MASK | 563 control->intercept_dr_write = INTERCEPT_DR0_MASK |
560 INTERCEPT_DR1_MASK | 564 INTERCEPT_DR1_MASK |
561 INTERCEPT_DR2_MASK | 565 INTERCEPT_DR2_MASK |
562 INTERCEPT_DR3_MASK | 566 INTERCEPT_DR3_MASK |
567 INTERCEPT_DR4_MASK |
563 INTERCEPT_DR5_MASK | 568 INTERCEPT_DR5_MASK |
569 INTERCEPT_DR6_MASK |
564 INTERCEPT_DR7_MASK; 570 INTERCEPT_DR7_MASK;
565 571
566 control->intercept_exceptions = (1 << PF_VECTOR) | 572 control->intercept_exceptions = (1 << PF_VECTOR) |
@@ -2319,11 +2325,17 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm) = {
2319 [SVM_EXIT_READ_DR1] = emulate_on_interception, 2325 [SVM_EXIT_READ_DR1] = emulate_on_interception,
2320 [SVM_EXIT_READ_DR2] = emulate_on_interception, 2326 [SVM_EXIT_READ_DR2] = emulate_on_interception,
2321 [SVM_EXIT_READ_DR3] = emulate_on_interception, 2327 [SVM_EXIT_READ_DR3] = emulate_on_interception,
2328 [SVM_EXIT_READ_DR4] = emulate_on_interception,
2329 [SVM_EXIT_READ_DR5] = emulate_on_interception,
2330 [SVM_EXIT_READ_DR6] = emulate_on_interception,
2331 [SVM_EXIT_READ_DR7] = emulate_on_interception,
2322 [SVM_EXIT_WRITE_DR0] = emulate_on_interception, 2332 [SVM_EXIT_WRITE_DR0] = emulate_on_interception,
2323 [SVM_EXIT_WRITE_DR1] = emulate_on_interception, 2333 [SVM_EXIT_WRITE_DR1] = emulate_on_interception,
2324 [SVM_EXIT_WRITE_DR2] = emulate_on_interception, 2334 [SVM_EXIT_WRITE_DR2] = emulate_on_interception,
2325 [SVM_EXIT_WRITE_DR3] = emulate_on_interception, 2335 [SVM_EXIT_WRITE_DR3] = emulate_on_interception,
2336 [SVM_EXIT_WRITE_DR4] = emulate_on_interception,
2326 [SVM_EXIT_WRITE_DR5] = emulate_on_interception, 2337 [SVM_EXIT_WRITE_DR5] = emulate_on_interception,
2338 [SVM_EXIT_WRITE_DR6] = emulate_on_interception,
2327 [SVM_EXIT_WRITE_DR7] = emulate_on_interception, 2339 [SVM_EXIT_WRITE_DR7] = emulate_on_interception,
2328 [SVM_EXIT_EXCP_BASE + DB_VECTOR] = db_interception, 2340 [SVM_EXIT_EXCP_BASE + DB_VECTOR] = db_interception,
2329 [SVM_EXIT_EXCP_BASE + BP_VECTOR] = bp_interception, 2341 [SVM_EXIT_EXCP_BASE + BP_VECTOR] = bp_interception,