tcg/i386: rdpmc: fix the the condtions

Backports c45b426acd1ad8e30fbe1b9af8c07b2889c28c6b
This commit is contained in:
Zheng Zhan Liang 2021-03-04 18:50:33 -05:00 committed by Lioncash
parent d7adcf1d7f
commit dfd53d7573

View file

@ -207,7 +207,8 @@ void helper_rdtscp(CPUX86State *env)
void helper_rdpmc(CPUX86State *env)
{
if ((env->cr[4] & CR4_PCE_MASK) && ((env->hflags & HF_CPL_MASK) != 0)) {
if (((env->cr[4] & CR4_PCE_MASK) == 0 ) &&
((env->hflags & HF_CPL_MASK) != 0)) {
raise_exception_ra(env, EXCP0D_GPF, GETPC());
}
cpu_svm_check_intercept_param(env, SVM_EXIT_RDPMC, 0, GETPC());