qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Alex Smith <alex.smith@imgtec.com>
To: qemu-devel@nongnu.org
Cc: Leon Alrae <leon.alrae@imgtec.com>,
	Alex Smith <alex@alex-smith.me.uk>,
	Aurelien Jarno <aurelien@aurel32.net>
Subject: [Qemu-devel] [PATCH] target-mips: Fix RDHWR on CP0.Count
Date: Fri, 4 Sep 2015 09:21:01 +0100	[thread overview]
Message-ID: <1441354861-9598-1-git-send-email-alex.smith@imgtec.com> (raw)

For RDHWR on the CP0.Count register, env->CP0_Count was being returned.
This value is a delta against the QEMU_CLOCK_VIRTUAL clock, not the
correct current value of CP0.Count. Use cpu_mips_get_count() instead.

Signed-off-by: Alex Smith <alex.smith@imgtec.com>
Cc: Aurelien Jarno <aurelien@aurel32.net>
Cc: Leon Alrae <leon.alrae@imgtec.com>
---
 target-mips/op_helper.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/target-mips/op_helper.c b/target-mips/op_helper.c
index 809a061e296b..6fe00201c10d 100644
--- a/target-mips/op_helper.c
+++ b/target-mips/op_helper.c
@@ -2185,7 +2185,7 @@ target_ulong helper_rdhwr_cc(CPUMIPSState *env)
 {
     if ((env->hflags & MIPS_HFLAG_CP0) ||
         (env->CP0_HWREna & (1 << 2)))
-        return env->CP0_Count;
+        return (int32_t)cpu_mips_get_count(env);
     else
         helper_raise_exception(env, EXCP_RI);
 
-- 
2.5.0

             reply	other threads:[~2015-09-04  8:21 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-09-04  8:21 Alex Smith [this message]
2015-09-08  9:44 ` [Qemu-devel] [PATCH] target-mips: Fix RDHWR on CP0.Count Leon Alrae
2015-09-08 10:07   ` Alex Smith

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1441354861-9598-1-git-send-email-alex.smith@imgtec.com \
    --to=alex.smith@imgtec.com \
    --cc=alex@alex-smith.me.uk \
    --cc=aurelien@aurel32.net \
    --cc=leon.alrae@imgtec.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).