summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorGiacomo Travaglini <giacomo.travaglini@arm.com>2019-06-06 23:03:07 +0100
committerGiacomo Travaglini <giacomo.travaglini@arm.com>2019-06-07 14:51:28 +0000
commitaece7fcdf97d2864fbb31e02940bfcdd470db7b9 (patch)
treea6e3207f8ba4cdc10ea3f45bcb5fb955d4b7f173 /src/arch
parent2574dc41a6b420f0101d0ecf2a3205091ef96940 (diff)
downloadgem5-aece7fcdf97d2864fbb31e02940bfcdd470db7b9.tar.xz
arch-arm: Fix WalkerState,Descriptors default constructor
Those POD strutures are not initializing all members at construction. This could lead to undefined behaviour Change-Id: Iaa8afb126382b6bfbef686883a026262f24d5ca1 Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com> Reviewed-by: Ciro Santilli <ciro.santilli@arm.com> Reviewed-by: Javier Setoain <javier.setoain@arm.com> Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/19149 Maintainer: Andreas Sandberg <andreas.sandberg@arm.com> Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/arch')
-rw-r--r--src/arch/arm/table_walker.cc5
-rw-r--r--src/arch/arm/table_walker.hh4
2 files changed, 8 insertions, 1 deletions
diff --git a/src/arch/arm/table_walker.cc b/src/arch/arm/table_walker.cc
index 6f06b7112..461194d82 100644
--- a/src/arch/arm/table_walker.cc
+++ b/src/arch/arm/table_walker.cc
@@ -130,7 +130,10 @@ TableWalker::getPort(const std::string &if_name, PortID idx)
TableWalker::WalkerState::WalkerState() :
tc(nullptr), aarch64(false), el(EL0), physAddrRange(0), req(nullptr),
asid(0), vmid(0), isHyp(false), transState(nullptr),
- vaddr(0), vaddr_tainted(0), isWrite(false), isFetch(false), isSecure(false),
+ vaddr(0), vaddr_tainted(0),
+ sctlr(0), scr(0), cpsr(0), tcr(0),
+ htcr(0), hcr(0), vtcr(0),
+ isWrite(false), isFetch(false), isSecure(false),
secureLookup(false), rwTable(false), userTable(false), xnTable(false),
pxnTable(false), stage2Req(false),
stage2Tran(nullptr), timing(false), functional(false),
diff --git a/src/arch/arm/table_walker.hh b/src/arch/arm/table_walker.hh
index 752b57a64..dacde641a 100644
--- a/src/arch/arm/table_walker.hh
+++ b/src/arch/arm/table_walker.hh
@@ -67,6 +67,8 @@ class TableWalker : public ClockedObject
class DescriptorBase {
public:
+ DescriptorBase() : lookupLevel(L0) {}
+
/** Current lookup level for this descriptor */
LookupLevel lookupLevel;
@@ -382,6 +384,8 @@ class TableWalker : public ClockedObject
Page
};
+ LongDescriptor() : data(0), _dirty(false) {}
+
/** The raw bits of the entry */
uint64_t data;