[PATCH 6/9] KVM: SVM: Add intercept checks for remaining twobyte instructions

From: Joerg Roedel
Date: Wed Nov 24 2010 - 13:20:40 EST


This patch adds intercepts checks for the remaining twobyte
instructions to the KVM instruction emulator.

Signed-off-by: Joerg Roedel <joerg.roedel@xxxxxxx>
---
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


--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/