MAKE_INSTR(VMCALL, 3, 0x0f, 0x01, 0xd9);
MAKE_INSTR(HLT, 1, 0xf4);
MAKE_INSTR(INT3, 1, 0xcc);
+MAKE_INSTR(RDTSC, 2, 0x0f, 0x31);
static const u8 *opc_bytes[INSTR_MAX_COUNT] =
{
[INSTR_WRMSR] = OPCODE_WRMSR,
[INSTR_VMCALL] = OPCODE_VMCALL,
[INSTR_HLT] = OPCODE_HLT,
- [INSTR_INT3] = OPCODE_INT3
+ [INSTR_INT3] = OPCODE_INT3,
+ [INSTR_RDTSC] = OPCODE_RDTSC
};
static int fetch(struct vcpu *v, u8 *buf, unsigned long addr, int len)
hvm_hlt(regs->eflags);
}
+static void svm_vmexit_do_rdtsc(struct cpu_user_regs *regs)
+{
+ unsigned int inst_len;
+
+ if ( (inst_len = __get_instruction_length(current, INSTR_RDTSC)) == 0 )
+ return;
+ __update_guest_eip(regs, inst_len);
+
+ hvm_rdtsc_intercept(regs);
+}
+
static void wbinvd_ipi(void *info)
{
wbinvd();
break;
case VMEXIT_RDTSC:
- hvm_rdtsc_intercept(regs);
+ svm_vmexit_do_rdtsc(regs);
break;
case VMEXIT_RDTSCP: