aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZheng Zhan Liang <linuxmaker@163.com>2021-02-25 13:47:57 +0800
committerPaolo Bonzini <pbonzini@redhat.com>2021-02-25 15:41:53 +0100
commitc45b426acd1ad8e30fbe1b9af8c07b2889c28c6b (patch)
tree1129501f9de5e44cf521316b5ca670890fa37855
parent9d902d51154bcbd305ae7138ef31e2843bb3427e (diff)
downloadqemu-c45b426acd1ad8e30fbe1b9af8c07b2889c28c6b.zip
qemu-c45b426acd1ad8e30fbe1b9af8c07b2889c28c6b.tar.gz
qemu-c45b426acd1ad8e30fbe1b9af8c07b2889c28c6b.tar.bz2
tcg/i386: rdpmc: fix the the condtions
Signed-off-by: Zheng Zhan Liang <linuxmaker@163.com> Message-Id: <20210225054756.35962-1-linuxmaker@163.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
-rw-r--r--target/i386/tcg/misc_helper.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/target/i386/tcg/misc_helper.c b/target/i386/tcg/misc_helper.c
index f02e4fd..90b87fd 100644
--- a/target/i386/tcg/misc_helper.c
+++ b/target/i386/tcg/misc_helper.c
@@ -222,7 +222,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());