Skip to content

Commit c45b426

Browse files
Zheng Zhan Liangbonzini
authored andcommitted
tcg/i386: rdpmc: fix the the condtions
Signed-off-by: Zheng Zhan Liang <[email protected]> Message-Id: <[email protected]> Signed-off-by: Paolo Bonzini <[email protected]>
1 parent 9d902d5 commit c45b426

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

target/i386/tcg/misc_helper.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,8 @@ void helper_rdtscp(CPUX86State *env)
222222

223223
void helper_rdpmc(CPUX86State *env)
224224
{
225-
if ((env->cr[4] & CR4_PCE_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) {
225+
if (((env->cr[4] & CR4_PCE_MASK) == 0 ) &&
226+
((env->hflags & HF_CPL_MASK) != 0)) {
226227
raise_exception_ra(env, EXCP0D_GPF, GETPC());
227228
}
228229
cpu_svm_check_intercept_param(env, SVM_EXIT_RDPMC, 0, GETPC());

0 commit comments

Comments
 (0)