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 6/9] KVM: SVM: Add intercept checks for remaining twobyte instructions
Date
This patch adds intercepts checks for the remaining twobyte
instructions to the KVM instruction emulator.

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

diff --git a/arch/x86/kvm/svm.c b/arch/x86/kvm/svm.c
index 7284193..77b344e 100644
--- a/arch/x86/kvm/svm.c
+++ b/arch/x86/kvm/svm.c
@@ -3741,10 +3741,19 @@ static int svm_insn_intercepted(struct kvm_vcpu *vcpu,

break;
}
+ case 0x07: /* INVLPG */
+ vmcb->control.exit_code = SVM_EXIT_INVLPG;
+ break;
}
case 0x06: /* CLTS */
vmcb->control.exit_code = SVM_EXIT_WRITE_CR0;
break;
+ case 0x08: /* INVD */
+ vmcb->control.exit_code = SVM_EXIT_INVD;
+ break;
+ case 0x09: /* WBINVD */
+ vmcb->control.exit_code = SVM_EXIT_WBINVD;
+ break;
case 0x20: /* CR read */
vmcb->control.exit_code = SVM_EXIT_READ_CR0 + c->modrm_reg;
break;
@@ -3768,6 +3777,26 @@ static int svm_insn_intercepted(struct kvm_vcpu *vcpu,
case 0x23:
vmcb->control.exit_code = SVM_EXIT_WRITE_DR0 + c->modrm_reg;
break;
+ case 0x30: /* WRMSR */
+ vmcb->control.exit_code = SVM_EXIT_MSR;
+ vmcb->control.exit_info_1 = 1;
+ break;
+ case 0x31: /* RDTSC */
+ vmcb->control.exit_code = SVM_EXIT_RDTSC;
+ break;
+ case 0x32: /* RDMSR */
+ vmcb->control.exit_code = SVM_EXIT_MSR;
+ vmcb->control.exit_info_1 = 0;
+ break;
+ case 0x33: /* RDPMC */
+ vmcb->control.exit_code = SVM_EXIT_RDPMC;
+ break;
+ case 0xa2: /* CPUID */
+ vmcb->control.exit_code = SVM_EXIT_CPUID;
+ break;
+ case 0xaa: /* RSM */
+ vmcb->control.exit_code = SVM_EXIT_RSM;
+ break;
}

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



\
 
 \ /
  Last update: 2010-11-24 19:23    [W:0.073 / U:2.656 seconds]
©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site