cpu: Avoid unnecessary dynamic_pointer_cast in atomic model
authorGiacomo Travaglini <giacomo.travaglini@arm.com>
Thu, 15 Feb 2018 15:15:22 +0000 (15:15 +0000)
committerGiacomo Travaglini <giacomo.travaglini@arm.com>
Tue, 29 May 2018 10:08:18 +0000 (10:08 +0000)
In the atomic model a dynamic_pointer_cast is performed at every tick to
check if the fault is a SyscallRetryFault. This was happening even when
there was no generated fault.

Change-Id: I7f4afeffffdf4f988230e05286602d8d9a919c6c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/10101
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/cpu/simple/atomic.cc

index bc7670b232a5318ad383e418724d23382778b7dc..7a368ab321e45357e3cac5a10032098e08ee4acb 100644 (file)
@@ -628,7 +628,8 @@ AtomicSimpleCPU::tick()
                     traceData = NULL;
                 }
 
-                if (dynamic_pointer_cast<SyscallRetryFault>(fault)) {
+                if (fault != NoFault &&
+                    dynamic_pointer_cast<SyscallRetryFault>(fault)) {
                     // Retry execution of system calls after a delay.
                     // Prevents immediate re-execution since conditions which
                     // caused the retry are unlikely to change every tick.