From: Leon Alrae <leon.alrae@imgtec.com>
To: Alex Smith <alex.smith@imgtec.com>, qemu-devel@nongnu.org
Cc: Alex Smith <alex@alex-smith.me.uk>,
Aurelien Jarno <aurelien@aurel32.net>
Subject: Re: [Qemu-devel] [PATCH] target-mips: Fix RDHWR on CP0.Count
Date: Tue, 8 Sep 2015 10:44:41 +0100 [thread overview]
Message-ID: <55EEAE09.6090906@imgtec.com> (raw)
In-Reply-To: <1441354861-9598-1-git-send-email-alex.smith@imgtec.com>
On 04/09/15 09:21, Alex Smith wrote:
> 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);
>
>
Thanks for the patch, this looks correct for system mode. However, if
you try to build mips*-linux-user it will fail -- cpu_mips_get_count()
and family aren't defined in linux-user (we don't seem to care about
modifying CP0_Count).
Also, QEMU coding style requires that every indented statement is braced
(these style issues are in quite many places in existing code, but new
code should follow the correct style).
Could you fix these two issues, please?
Thanks,
Leon
next prev parent reply other threads:[~2015-09-08 9:44 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-09-04 8:21 [Qemu-devel] [PATCH] target-mips: Fix RDHWR on CP0.Count Alex Smith
2015-09-08 9:44 ` Leon Alrae [this message]
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=55EEAE09.6090906@imgtec.com \
--to=leon.alrae@imgtec.com \
--cc=alex.smith@imgtec.com \
--cc=alex@alex-smith.me.uk \
--cc=aurelien@aurel32.net \
--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).