diff options
author | Avi Kivity <avi@qumranet.com> | 2007-12-06 12:50:00 -0500 |
---|---|---|
committer | Avi Kivity <avi@qumranet.com> | 2008-01-30 10:53:19 -0500 |
commit | 80a8119ca3f021037b8513d39dbb0ffd1af86b20 (patch) | |
tree | 38928e7b3fbd21ad4508bce11fb35899babf7774 | |
parent | 6e3d5dfbad4d8c29bdf8ed160f91f955f0efc12b (diff) |
KVM: SVM: Trap access to the cr8 register
Later we may be able to use the virtual tpr feature, but for now,
just trap it.
Signed-off-by: Avi Kivity <avi@qumranet.com>
-rw-r--r-- | drivers/kvm/svm.c | 8 | ||||
-rw-r--r-- | drivers/kvm/svm.h | 1 |
2 files changed, 7 insertions, 2 deletions
diff --git a/drivers/kvm/svm.c b/drivers/kvm/svm.c index 06beed7d4a08..143d271d4431 100644 --- a/drivers/kvm/svm.c +++ b/drivers/kvm/svm.c | |||
@@ -449,11 +449,13 @@ static void init_vmcb(struct vmcb *vmcb) | |||
449 | 449 | ||
450 | control->intercept_cr_read = INTERCEPT_CR0_MASK | | 450 | control->intercept_cr_read = INTERCEPT_CR0_MASK | |
451 | INTERCEPT_CR3_MASK | | 451 | INTERCEPT_CR3_MASK | |
452 | INTERCEPT_CR4_MASK; | 452 | INTERCEPT_CR4_MASK | |
453 | INTERCEPT_CR8_MASK; | ||
453 | 454 | ||
454 | control->intercept_cr_write = INTERCEPT_CR0_MASK | | 455 | control->intercept_cr_write = INTERCEPT_CR0_MASK | |
455 | INTERCEPT_CR3_MASK | | 456 | INTERCEPT_CR3_MASK | |
456 | INTERCEPT_CR4_MASK; | 457 | INTERCEPT_CR4_MASK | |
458 | INTERCEPT_CR8_MASK; | ||
457 | 459 | ||
458 | control->intercept_dr_read = INTERCEPT_DR0_MASK | | 460 | control->intercept_dr_read = INTERCEPT_DR0_MASK | |
459 | INTERCEPT_DR1_MASK | | 461 | INTERCEPT_DR1_MASK | |
@@ -1195,10 +1197,12 @@ static int (*svm_exit_handlers[])(struct vcpu_svm *svm, | |||
1195 | [SVM_EXIT_READ_CR0] = emulate_on_interception, | 1197 | [SVM_EXIT_READ_CR0] = emulate_on_interception, |
1196 | [SVM_EXIT_READ_CR3] = emulate_on_interception, | 1198 | [SVM_EXIT_READ_CR3] = emulate_on_interception, |
1197 | [SVM_EXIT_READ_CR4] = emulate_on_interception, | 1199 | [SVM_EXIT_READ_CR4] = emulate_on_interception, |
1200 | [SVM_EXIT_READ_CR8] = emulate_on_interception, | ||
1198 | /* for now: */ | 1201 | /* for now: */ |
1199 | [SVM_EXIT_WRITE_CR0] = emulate_on_interception, | 1202 | [SVM_EXIT_WRITE_CR0] = emulate_on_interception, |
1200 | [SVM_EXIT_WRITE_CR3] = emulate_on_interception, | 1203 | [SVM_EXIT_WRITE_CR3] = emulate_on_interception, |
1201 | [SVM_EXIT_WRITE_CR4] = emulate_on_interception, | 1204 | [SVM_EXIT_WRITE_CR4] = emulate_on_interception, |
1205 | [SVM_EXIT_WRITE_CR8] = emulate_on_interception, | ||
1202 | [SVM_EXIT_READ_DR0] = emulate_on_interception, | 1206 | [SVM_EXIT_READ_DR0] = emulate_on_interception, |
1203 | [SVM_EXIT_READ_DR1] = emulate_on_interception, | 1207 | [SVM_EXIT_READ_DR1] = emulate_on_interception, |
1204 | [SVM_EXIT_READ_DR2] = emulate_on_interception, | 1208 | [SVM_EXIT_READ_DR2] = emulate_on_interception, |
diff --git a/drivers/kvm/svm.h b/drivers/kvm/svm.h index 5fa277c0187c..5fd50491b555 100644 --- a/drivers/kvm/svm.h +++ b/drivers/kvm/svm.h | |||
@@ -204,6 +204,7 @@ struct __attribute__ ((__packed__)) vmcb { | |||
204 | #define INTERCEPT_CR0_MASK 1 | 204 | #define INTERCEPT_CR0_MASK 1 |
205 | #define INTERCEPT_CR3_MASK (1 << 3) | 205 | #define INTERCEPT_CR3_MASK (1 << 3) |
206 | #define INTERCEPT_CR4_MASK (1 << 4) | 206 | #define INTERCEPT_CR4_MASK (1 << 4) |
207 | #define INTERCEPT_CR8_MASK (1 << 8) | ||
207 | 208 | ||
208 | #define INTERCEPT_DR0_MASK 1 | 209 | #define INTERCEPT_DR0_MASK 1 |
209 | #define INTERCEPT_DR1_MASK (1 << 1) | 210 | #define INTERCEPT_DR1_MASK (1 << 1) |