qemu-commits
[Top][All Lists]
Advanced

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

[Qemu-commits] [qemu/qemu] 62c688: target-mips: fix CP0.BadVAddr by stop


From: GitHub
Subject: [Qemu-commits] [qemu/qemu] 62c688: target-mips: fix CP0.BadVAddr by stopping translat...
Date: Thu, 19 Mar 2015 07:30:05 -0700

  Branch: refs/heads/master
  Home:   https://github.com/qemu/qemu
  Commit: 62c688693bf2f0355fc5bad5dcc59c1cd2a51f1a
      
https://github.com/qemu/qemu/commit/62c688693bf2f0355fc5bad5dcc59c1cd2a51f1a
  Author: Leon Alrae <address@hidden>
  Date:   2015-03-18 (Wed, 18 Mar 2015)

  Changed paths:
    M target-mips/translate.c

  Log Message:
  -----------
  target-mips: fix CP0.BadVAddr by stopping translation on Address Error

CP0.BadVAddr is supposed to capture the most recent virtual address that caused
the exception. Currently this does not work correctly for unaligned instruction
fetch as translation is not stopped and CP0.BadVAddr is updated with subsequent
addresses.

Signed-off-by: Leon Alrae <address@hidden>


  Commit: a5f533909e746ca6e534b232fb42c9c6fd81b468
      
https://github.com/qemu/qemu/commit/a5f533909e746ca6e534b232fb42c9c6fd81b468
  Author: Leon Alrae <address@hidden>
  Date:   2015-03-18 (Wed, 18 Mar 2015)

  Changed paths:
    M target-mips/translate.c

  Log Message:
  -----------
  target-mips: fix hflags modified in delay / forbidden slot

All instructions which may change hflags terminate tb. However, this doesn't
work if such an instruction is placed in delay or forbidden slot.
gen_branch() clears MIPS_HFLAG_BMASK in ctx->hflags and then generates code
to overwrite hflags with ctx->hflags, consequently we loose any execution-time
hflags modifications. For example, in the following scenario hflag related to
Status.CU1 will not be updated:
    /* Set Status.CU1 in delay slot */
    mfc0  $24, $12, 0
    lui   $25, 0x2000
    or    $25, $25, $24
    b     check_Status_CU1
    mtc0  $25, $12, 0

With this change we clear MIPS_HFLAG_BMASK in execution-time hflags if
instruction in delay or forbidden slot wants to terminate tb for some reason
(i.e. ctx->bstate != BS_NONE).

Also, die early and loudly if "unknown branch" is encountered as this should
never happen.

Signed-off-by: Leon Alrae <address@hidden>


  Commit: 0af7a37054310384e00209e0a43efe95b7c19ef0
      
https://github.com/qemu/qemu/commit/0af7a37054310384e00209e0a43efe95b7c19ef0
  Author: Leon Alrae <address@hidden>
  Date:   2015-03-18 (Wed, 18 Mar 2015)

  Changed paths:
    M target-mips/translate.c

  Log Message:
  -----------
  target-mips: save cpu state before calling MSA load and store helpers

PC needs to be saved if an exception can be generated by an helper.
This fixes a problem related to resuming the execution at unexpected address
after an exception (caused by MSA load/store instruction) has been serviced.

Signed-off-by: Leon Alrae <address@hidden>


  Commit: d88aec88cdd2cdb1939b88a8cdab0a5da3c4559b
      
https://github.com/qemu/qemu/commit/d88aec88cdd2cdb1939b88a8cdab0a5da3c4559b
  Author: Peter Maydell <address@hidden>
  Date:   2015-03-19 (Thu, 19 Mar 2015)

  Changed paths:
    M target-mips/translate.c

  Log Message:
  -----------
  Merge remote-tracking branch 'remotes/lalrae/tags/mips-20150318' into staging

MIPS patches 2015-03-18

Changes:
* bug fixes

# gpg: Signature made Wed Mar 18 10:06:00 2015 GMT using RSA key ID 0B29DA6B
# gpg: Can't check signature: public key not found

* remotes/lalrae/tags/mips-20150318:
  target-mips: save cpu state before calling MSA load and store helpers
  target-mips: fix hflags modified in delay / forbidden slot
  target-mips: fix CP0.BadVAddr by stopping translation on Address Error

Signed-off-by: Peter Maydell <address@hidden>


Compare: https://github.com/qemu/qemu/compare/1cfa7e0ab223...d88aec88cdd2

reply via email to

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