target-arm: correct CNTFRQ access rights
authorPeter Maydell <peter.maydell@linaro.org>
Thu, 18 Feb 2016 14:16:15 +0000 (14:16 +0000)
committerPeter Maydell <peter.maydell@linaro.org>
Thu, 18 Feb 2016 14:16:15 +0000 (14:16 +0000)
commit755026728abb19fba70e6b4396a27fa2e7550d74
treed6339e9eb6347eee2be7c8758abac29d03b0b843
parent339b665c883b209982fa161dc090ffaf242ab12b
target-arm: correct CNTFRQ access rights

Correct some corner cases we were getting wrong for
CNTFRQ access rights:
 * should UNDEF from 32-bit Secure EL1
 * only writable from the highest implemented exception level,
   which might not be EL1 now

To clarify the code, provide a new utility function
arm_highest_el() which returns the highest implemented
exception level.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Sergey Fedorov <serge.fdrv@gmail.com>
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
target-arm/cpu.h
target-arm/helper.c