Tiago Mück has uploaded this change for review. ( https://gem5-review.googlesource.com/c/public/gem5/+/19288

Change subject: dev-arm: Check for gem5 extensions in GicV2
......................................................................

dev-arm: Check for gem5 extensions in GicV2

Using GicV2 without setting the gem5_extensions parameter in a
config  with more than 8 is not allowed to prevent overflow of
the 8-bit mask.

Change-Id: I780c6985e8f44ed780b4f74f9a27805124e23a7b
Signed-off-by: Tiago Mück <tiago.m...@arm.com>
---
M src/dev/arm/gic_v2.hh
1 file changed, 6 insertions(+), 3 deletions(-)



diff --git a/src/dev/arm/gic_v2.hh b/src/dev/arm/gic_v2.hh
index f9b66b8..4104140 100644
--- a/src/dev/arm/gic_v2.hh
+++ b/src/dev/arm/gic_v2.hh
@@ -1,5 +1,5 @@
 /*
- * Copyright (c) 2010, 2013, 2015-2018 ARM Limited
+ * Copyright (c) 2010, 2013, 2015-2019 ARM Limited
  * All rights reserved
  *
  * The license below extends only to copyright in the software and shall
@@ -309,8 +309,11 @@
             if (gem5ExtensionsEnabled) {
                 ctx_mask = ctx;
             } else {
-            // convert the CPU id number into a bit mask
-                ctx_mask = power(2, ctx);
+                fatal_if(ctx >= 8,
+                    "%s requires the gem5_extensions parameter to support "
+                    "more than 8 cores\n", name());
+                // convert the CPU id number into a bit mask
+                ctx_mask = 1 << ctx;
             }
             return ctx_mask;
         } else {

--
To view, visit https://gem5-review.googlesource.com/c/public/gem5/+/19288
To unsubscribe, or for help writing mail filters, visit https://gem5-review.googlesource.com/settings

Gerrit-Project: public/gem5
Gerrit-Branch: master
Gerrit-Change-Id: I780c6985e8f44ed780b4f74f9a27805124e23a7b
Gerrit-Change-Number: 19288
Gerrit-PatchSet: 1
Gerrit-Owner: Tiago Mück <tiago.m...@arm.com>
Gerrit-MessageType: newchange
_______________________________________________
gem5-dev mailing list
gem5-dev@gem5.org
http://m5sim.org/mailman/listinfo/gem5-dev

Reply via email to