From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:54778) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZFoV-0000Ng-9C for qemu-devel@nongnu.org; Tue, 08 Sep 2015 06:07:44 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZZFoS-0001RA-2Y for qemu-devel@nongnu.org; Tue, 08 Sep 2015 06:07:43 -0400 Received: from mailapp01.imgtec.com ([195.59.15.196]:11685) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZZFoR-0001Qf-U4 for qemu-devel@nongnu.org; Tue, 08 Sep 2015 06:07:40 -0400 References: <1441354861-9598-1-git-send-email-alex.smith@imgtec.com> <55EEAE09.6090906@imgtec.com> From: Alex Smith Message-ID: <55EEB366.3040500@imgtec.com> Date: Tue, 8 Sep 2015 11:07:34 +0100 MIME-Version: 1.0 In-Reply-To: <55EEAE09.6090906@imgtec.com> Content-Type: text/plain; charset="windows-1252" Content-Transfer-Encoding: 7bit Subject: Re: [Qemu-devel] [PATCH] target-mips: Fix RDHWR on CP0.Count List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: Leon Alrae , qemu-devel@nongnu.org Cc: Alex Smith , Aurelien Jarno On 08/09/2015 10:44, Leon Alrae wrote: > 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 >> Cc: Aurelien Jarno >> Cc: Leon Alrae >> --- >> 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? Sure, will do. I'll send a new patch shortly. Thanks, Alex