diff options
author | Adrian Herrera <adrian.herrera@arm.com> | 2019-11-06 13:00:21 +0000 |
---|---|---|
committer | Giacomo Travaglini <giacomo.travaglini@arm.com> | 2020-02-04 13:39:54 +0000 |
commit | 465f7d0f56fe47ad5070cc7fcc69bf69cb7d3d82 (patch) | |
tree | e6434d38f7d7888a359931d937dfde4470d0d6a9 /src/arch | |
parent | 6cff0dd218941eabf2b9cf3a7ce6d641ea7884cb (diff) | |
download | gem5-465f7d0f56fe47ad5070cc7fcc69bf69cb7d3d82.tar.xz |
arch-arm: reg access permissions highest EL helper
This patch implements a helper function to filter a register access
permissions by the highest EL implemented by the system.
This filtering is convenient to follow the architecture pseudocode.
Change-Id: Iedfb2d8624c926f2f0a9326f8b1b073ea9424ab9
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/24663
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/arch')
-rw-r--r-- | src/arch/arm/isa.cc | 14 | ||||
-rw-r--r-- | src/arch/arm/isa.hh | 3 |
2 files changed, 15 insertions, 2 deletions
diff --git a/src/arch/arm/isa.cc b/src/arch/arm/isa.cc index 767fd9f6a..101ca5420 100644 --- a/src/arch/arm/isa.cc +++ b/src/arch/arm/isa.cc @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010-2019 ARM Limited + * Copyright (c) 2010-2020 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -2190,6 +2190,18 @@ ISA::zeroSveVecRegUpperPart(VecRegContainer &vc, unsigned eCount) } } +ISA::MiscRegLUTEntryInitializer::chain +ISA::MiscRegLUTEntryInitializer::highest(ArmSystem *const sys) const +{ + switch (FullSystem ? sys->highestEL() : EL1) { + case EL0: + case EL1: priv(); break; + case EL2: hyp(); break; + case EL3: mon(); break; + } + return *this; +} + } // namespace ArmISA ArmISA::ISA * diff --git a/src/arch/arm/isa.hh b/src/arch/arm/isa.hh index fea372ed4..7ffa682ef 100644 --- a/src/arch/arm/isa.hh +++ b/src/arch/arm/isa.hh @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2012-2019 ARM Limited + * Copyright (c) 2010, 2012-2020 ARM Limited * All rights reserved * * The license below extends only to copyright in the software and shall @@ -357,6 +357,7 @@ namespace ArmISA user(0); return *this; } + chain highest(ArmSystem *const sys) const; MiscRegLUTEntryInitializer(struct MiscRegLUTEntry &e, std::bitset<NUM_MISCREG_INFOS> &i) : entry(e), |