cpu: fix exec tracing memory corruption bug
authorSteve Reinhardt <steve.reinhardt@amd.com>
Tue, 23 Mar 2010 15:50:57 +0000 (08:50 -0700)
committerSteve Reinhardt <steve.reinhardt@amd.com>
Tue, 23 Mar 2010 15:50:57 +0000 (08:50 -0700)
commit4d77ea7a5783d1de87a8eb804b17a6ef352998ce
treefbf1fd950e46885fdca93abbaf689f5131752995
parentd484e1b334c6fd3f2721a2a4628c2324ed14fd08
cpu: fix exec tracing memory corruption bug
Accessing traceData (to call setAddress() and/or setData())
after initiating a timing translation was causing crashes,
since a failed translation could delete the traceData
object before returning.

It turns out that there was never a need to access traceData
after initiating the translation, as the traced data was
always available earlier; this ordering was merely
historical.  Furthermore, traceData->setAddress() and
traceData->setData() were being called both from the CPU
model and the ISA definition, often redundantly.

This patch standardizes all setAddress and setData calls
for memory instructions to be in the CPU models and not
in the ISA definition.  It also moves those calls above
the translation calls to eliminate the crashes.
src/arch/alpha/isa/mem.isa
src/arch/arm/isa/formats/mem.isa
src/arch/mips/isa/formats/mem.isa
src/arch/mips/isa/formats/util.isa
src/arch/power/isa/formats/mem.isa
src/arch/power/isa/formats/util.isa
src/cpu/inorder/resources/cache_unit.cc
src/cpu/simple/atomic.cc
src/cpu/simple/base.cc
src/cpu/simple/base.hh
src/cpu/simple/timing.cc