arch-arm: Speedup ARM execution by avoiding expensive RTTI check
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Wed, 26 Feb 2020 13:46:24 +0000 (13:46 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 10 Mar 2020 11:24:13 +0000 (11:24 +0000)
commitea33d438a2253ba864d19046a495e60f9e2424ed
tree3e4d35f1524663dbf5672278217312595ed57bd1
parent41df2f8b26e39d851c6f53eed956f963ce28925b
arch-arm: Speedup ARM execution by avoiding expensive RTTI check

getArmSystem is the building block for a lot of ArmSystem getters
a client can use to check for a specific feature.
This method is called very often during simulation and it is basically
casting a System pointer into an ArmSystem pointer.
To do so, it is using dynamic casting to check if the system is really
an ArmSystem. This is very expensive and usually not needed.

The only chance arm code would use a non ArmSystem is when in SE mode.
But if that's the case, we can just replace the assertion with a

assert(FullSystem).

Testing Linux boot with this patch provides a speedup of nearly 2x!
(atomic mode).

This is partially related to:

JIRA: https://gem5.atlassian.net/browse/GEM5-337

Since the PAuth patch changed the purifyTagged helper (on the critical
path of simulation) to rely more heavilly on getArmSystem (via
ArmSystem:: static methods)

Change-Id: Idbf079548ffe03513b4fc58c76f0d69613952a50
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/25964
Tested-by: kokoro <noreply+kokoro@google.com>
src/arch/arm/system.cc