Index: target-i386/helper.c --- target-i386/helper.c 18 Nov 2007 01:44:38 -0000 1.95 +++ target-i386/helper.c 5 Dec 2007 19:31:31 -0000 @@ -2743,6 +2816,19 @@ EDX = (uint32_t)(val >> 32); } +void helper_rdpmc() +{ + if ((env->cr[4] & CR4_PCE_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) { + raise_exception(EXCP0D_GPF); + } + + if (!svm_check_intercept_param(SVM_EXIT_RDPMC, 0)) + { + // currently unimplemented + raise_exception_err(EXCP06_ILLOP, 0); + } +} + #if defined(CONFIG_USER_ONLY) void helper_wrmsr(void) { Index: target-i386/op.c --- target-i386/op.c 23 Sep 2007 15:28:04 -0000 1.51 +++ target-i386/op.c 5 Dec 2007 19:31:32 -0000 @@ -953,6 +953,11 @@ helper_rdtsc(); } +void OPPROTO op_rdpmc(void) +{ + helper_rdpmc(); +} + void OPPROTO op_cpuid(void) { helper_cpuid(); Index: target-i386/translate.c --- target-i386/translate.c 8 Nov 2007 14:25:03 -0000 1.74 +++ target-i386/translate.c 5 Dec 2007 19:31:38 -0000 @@ -5653,5 +5653,9 @@ gen_op_rdtsc(); break; + case 0x133: /* rdpmc */ + gen_jmp_im(pc_start - s->cs_base); + gen_op_rdpmc(); + break; case 0x134: /* sysenter */ if (CODE64(s)) goto illegal_op;