OSDN Git Service

target-arm: Use dedicated CPU state fields for ARM946 access bit registers
authorPeter Maydell <peter.maydell@linaro.org>
Tue, 15 Apr 2014 18:18:41 +0000 (19:18 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 17 Apr 2014 20:34:04 +0000 (21:34 +0100)
commit7e09797c299712cafa7bc05dd57c1b13afcc6039
tree8f02e78b0d6923cdd53aea71c05f82bf7d04d381
parentaca3f40b374428e9c01068cf96294483cbb760a0
target-arm: Use dedicated CPU state fields for ARM946 access bit registers

The ARM946 model currently uses the c5_data and c5_insn fields in the CPU
state struct to store the contents of its access permission registers.
This is confusing and a good source of bugs because for all the MMU-based
CPUs those fields are fault status and fault address registers, which
behave completely differently; they just happen to use the same cpreg
encoding. Split them out to use their own fields instead.

These registers are only present in PMSAv5 MPU systems (of which the
ARM946 is our only current example); PMSAv6 and PMSAv7 (which we have
no implementations of) handle access permissions differently. We name
the new state fields accordingly.

Note that this change fixes a bug where a data abort or prefetch abort
on the ARM946 would accidentally corrupt the access permission registers
because the interrupt handling code assumed the c5_data and c5_insn
fields were always fault status registers.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Peter Crosthwaite <peter.crosthwaite@xilinx.com>
target-arm/cpu.h
target-arm/helper.c