cpu: Fix the type of the effective mem request size
authorGabor Dozsa <gabor.dozsa@arm.com>
Mon, 4 Feb 2019 14:39:08 +0000 (14:39 +0000)
committerGiacomo Gabrielli <giacomo.gabrielli@arm.com>
Sun, 28 Jul 2019 16:28:57 +0000 (16:28 +0000)
A memory request size can be larger than 255 bytes (e.g.
SVE with 2048-bit vector length) which could cause overflow
in the 'uint8_t effSize' variable.

Change-Id: I77e0d02a49ea7f81cacfa5be7e4ae40434af3109
Reviewed-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Signed-off-by: Giacomo Gabrielli <giacomo.gabrielli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19175
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>

src/cpu/base_dyn_inst.hh

index 6f9555a38ef823288040402ac76dd3af26759d4b..de76559fb43aa273a3370d9b75b6d06172d5540d 100644 (file)
@@ -221,7 +221,7 @@ class BaseDynInst : public ExecContext, public RefCounted
     short asid;
 
     /** The size of the request */
-    uint8_t effSize;
+    unsigned effSize;
 
     /** Pointer to the data for the memory access. */
     uint8_t *memData;