lkml.org 
[lkml]   [2010]   [Nov]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
From
Subject[PATCH 3/9] KVM: SVM: Add checks for DRx read and write intercepts
Date
This patch adds checking for read and write intercepts
from/to DRx registers from the KVM instruction emulator
path.

Signed-off-by: Joerg Roedel <joerg.roedel@amd.com>
---
arch/x86/kvm/svm.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 29f0491..16ff569 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -3669,6 +3669,9 @@ static int svm_insn_intercepted(struct kvm_vcpu *vcpu,
case 0x20: /* CR read */
vmcb->control.exit_code = SVM_EXIT_READ_CR0 + c->modrm_reg;
break;
+ case 0x21:
+ vmcb->control.exit_code = SVM_EXIT_READ_DR0 + c->modrm_reg;
+ break;
case 0x22: /* CR write */
vmcb->control.exit_code = SVM_EXIT_WRITE_CR0 + c->modrm_reg;
if (c->modrm_reg == 0 &&
@@ -3683,6 +3686,9 @@ static int svm_insn_intercepted(struct kvm_vcpu *vcpu,
vmcb->control.exit_code = SVM_EXIT_CR0_SEL_WRITE;
}
break;
+ case 0x23:
+ vmcb->control.exit_code = SVM_EXIT_WRITE_DR0 + c->modrm_reg;
+ break;
}

vmcb->control.next_rip = ctxt->eip;
--
1.7.1



\
 
 \ /
  Last update: 2010-11-24 19:21    [W:0.169 / U:0.076 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site