qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [Bug 1008728] [NEW] Program counter is wrong when re-enter


From: S.P. Lu
Subject: [Qemu-devel] [Bug 1008728] [NEW] Program counter is wrong when re-enter tb_find_fast in SH4 CPU
Date: Mon, 04 Jun 2012 20:55:43 -0000

Public bug reported:

Hi:

Recently, I use qemu-system-sh4 to emulate my legacy program (SH3).
But it goes wrong. After trace, I find when re-enter tb_find_fast function in 
file cpu-exec.c.
CPU program counter will be different with previous one.

In cpu-exec.c file, function tb_find_fast(env).
First, it will check whether the program counter address is in hash table.
(Mostly, jump address is in same hash entry. So it works normally.)
if yes, then execute tb_find_slow, then goes into decode...etc.
Otherwise, return NULL. (which is got from tb_jmp_cache.)
When first time, tb_find_fast return NULL.
Then in infinite loop in upper subroutine will call tb_find_fast again.
In 2nd time, the PC will be changed, different with previous one.
Then program goes wrong. At the end, it causes a forever loop in top-level.
Never goes into low-level function gen_intermediate_code_internal in file 
target-sh4/translate.c

Best Regards
S.P.Lu

** Affects: qemu
     Importance: Undecided
         Status: New


** Tags: sh4

-- 
You received this bug notification because you are a member of qemu-
devel-ml, which is subscribed to QEMU.
https://bugs.launchpad.net/bugs/1008728

Title:
  Program counter is wrong when re-enter tb_find_fast  in SH4 CPU

Status in QEMU:
  New

Bug description:
  Hi:

  Recently, I use qemu-system-sh4 to emulate my legacy program (SH3).
  But it goes wrong. After trace, I find when re-enter tb_find_fast function in 
file cpu-exec.c.
  CPU program counter will be different with previous one.

  In cpu-exec.c file, function tb_find_fast(env).
  First, it will check whether the program counter address is in hash table.
  (Mostly, jump address is in same hash entry. So it works normally.)
  if yes, then execute tb_find_slow, then goes into decode...etc.
  Otherwise, return NULL. (which is got from tb_jmp_cache.)
  When first time, tb_find_fast return NULL.
  Then in infinite loop in upper subroutine will call tb_find_fast again.
  In 2nd time, the PC will be changed, different with previous one.
  Then program goes wrong. At the end, it causes a forever loop in top-level.
  Never goes into low-level function gen_intermediate_code_internal in file 
target-sh4/translate.c

  Best Regards
  S.P.Lu

To manage notifications about this bug go to:
https://bugs.launchpad.net/qemu/+bug/1008728/+subscriptions



reply via email to

[Prev in Thread] Current Thread [Next in Thread]