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.roe...@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


--
To unsubscribe from this list: send the line "unsubscribe kvm" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to