From cba75858ab94b525c2daad973b8197e9ebd1f1af Mon Sep 17 00:00:00 2001 From: Giacomo Travaglini Date: Tue, 18 Dec 2018 14:20:44 +0000 Subject: arch-arm: Read VMPIDR instead of MPIDR when EL2 is Enabled Trying to read MPIDR(_EL1) from EL1, should return the value of VMPIDR_EL2 if EL2 is enabled. This patch is modifying the utility function for reading MPIDR in order to match this behaviour for both AArch32 and AArch64. Change-Id: I32c2d4d5052f509e6e0542a5314844164221c6a3 Signed-off-by: Giacomo Travaglini Reviewed-by: Andreas Sandberg Reviewed-on: https://gem5-review.googlesource.com/c/15617 Maintainer: Andreas Sandberg --- src/arch/arm/utility.hh | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'src/arch/arm/utility.hh') diff --git a/src/arch/arm/utility.hh b/src/arch/arm/utility.hh index 33696984e..01b95b3b5 100644 --- a/src/arch/arm/utility.hh +++ b/src/arch/arm/utility.hh @@ -250,7 +250,13 @@ inline bool isSecureBelowEL3(ThreadContext *tc); bool longDescFormatInUse(ThreadContext *tc); -uint32_t getMPIDR(ArmSystem *arm_sys, ThreadContext *tc); +/** This helper function is either returing the value of + * MPIDR_EL1 (by calling getMPIDR), or it is issuing a read + * to VMPIDR_EL2 (as it happens in virtualized systems) */ +MiscReg readMPIDR(ArmSystem *arm_sys, ThreadContext *tc); + +/** This helper function is returing the value of MPIDR_EL1 */ +MiscReg getMPIDR(ArmSystem *arm_sys, ThreadContext *tc); static inline uint32_t mcrMrcIssBuild(bool isRead, uint32_t crm, IntRegIndex rt, uint32_t crn, -- cgit v1.2.3