Commit Graph

2252 Commits

Author SHA1 Message Date
Gabe Black
2da4a2cdca cpu: Stop including arch/isa.hh.
This header file is no longer needed.

Also fix some places where the isa header file was being transitively
included.

Change-Id: Ib9a9d7db0c9808b29d7614bbd68e2052ea345e9f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51239
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-20 01:17:06 +00:00
Gabe Black
5d00ba897f arch: Make the (read|set)MiscReg methods virtual.
They will then be accessible through the base class. This adds some
small hypothetical amount of overhead to each call, but a quick test
booting linux on x86 does not show any significant slowdown.

Change-Id: If706ddf173d4e24d85468fb118b45099acf3c05b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51237
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-08-20 01:15:23 +00:00
Gabe Black
b3365e767a arch: Make the ISA::clear() method virtual.
This method is not at all on the critical path, and the adding virtual
method overhead to it will have essentially no effect on over all
performance.

Change-Id: I583bbe30f5ed923a0c771f36c3f07e5979c28476
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51236
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-20 01:14:54 +00:00
Gabe Black
d130fdc092 arch: Remove unused register flattening methods.
Most flattening methods in the ISA classes aren't used. The one
exception is the flattenMiscIndex function in ARM.

Change-Id: I26088692fe3f56914009afb0203f59da7cf6023a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51235
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-08-20 01:14:36 +00:00
Gabe Black
eaa67ca1ab fastmodel,cpu: Remove the flattenRegId ThreadContext method.
This is no longer used or necessary.

Change-Id: Ide8dd74b5d39b245d3d71979dd84c7fee60d566e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51234
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-08-20 01:14:22 +00:00
Gabe Black
ff4b675fb8 arch-arm,cpu: Remove all uses of flattenRegId.
RegIds can now be flattened directly.

Change-Id: I2a603c12bbc586720082363996f303cd3b43ac9c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51233
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-20 01:14:13 +00:00
Gabe Black
c686c93d4d arch,cpu: Replace calls to (get|set)RegFlat.
Make these use RegIds which are based on already flattened RegClass-es.

Change-Id: I50f50614830c7010c18a8ebb95aba8decc078ac0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51231
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-08-20 01:13:29 +00:00
Giacomo Travaglini
0ad684a6f2 arch-arm: XPACD, XPACI, XPACLRI do not trap
The HCR_EL2.API and SCR_EL3.API bits do not control the trapping of
those stripping instructions.

Change-Id: I84349937f8c50d63b5b52146743b035d1058fd8d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/34055
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Kaustav Goswami <kggoswami@ucdavis.edu>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-08-17 13:30:08 +00:00
Philip Metzler
50c8d9655e fastmodel: Use current execution state for memory lookup
The previous implementation used the physical memory view when reporting
memory back to GDB. This circumvents MMUs and caches, and leads to wrong
backtraces at the least.

Current architectures support EL3, EL2, and EL1/EL0, and the Iris
interface presents a Msn that corresponds to that (`0x10ff`), see
table "Canonical memory space numbers" in the Iris user guide.

As GDB expects the view of the processor when querying memory (e.g. for
backtraces), this will allow proper backtraces.

Not sure if there is an implicit way of expressing memory attributes
(like in Lauterbach with the access modifiers before address
specifications), or if there is a need to implement special monitor
commands. But for the common use, using `CurrentMsn` should be the
correct choice.

Change-Id: Ibd14c1f94163105539a7fb9132550fe713b5c295
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61951
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-12 05:02:40 +00:00
Gabe Black
13d298e7c4 arch-arm: Implement RegClass based register flattening.
Change-Id: Iba5c74d5b6dccd7de3ff59fea18a0c27c74c56a3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51229
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-08-09 09:18:36 +00:00
Gabe Black
244f80dde1 arch: Eliminate the vecregs.hh switching header file.
Delete the headers that are in each arch, and remove it from the list of
switching header files in arch/SConscript.

Change-Id: Ic0089f83e83f76ad6308ecfb5007b5ef11e1d949
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50256
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-04 20:22:59 +00:00
Gabe Black
262463a867 misc: Stop including arch/vecregs.hh and fix transitive includes.
Change-Id: I7854e77517f52b7c19cdb91c67016315391fd87f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50255
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-04 20:22:44 +00:00
Bobby R. Bruce
787204c92d python: Apply Black formatter to Python files
The command executed was `black src configs tests util`.

Change-Id: I8dfaa6ab04658fea37618127d6ac19270028d771
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/47024
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-03 09:10:41 +00:00
Giacomo Travaglini
1cfaa8da83 arch-arm: Remove unimplemented miscreg handling in MSR imm
The checkFaultAccessAArch64SysReg function is now in charge
of returning the Undefined Instruction fault for unimplemented
registers

Change-Id: I75c00c6fbce33d1729a4923eae585260a8461db3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61971
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-08-02 20:45:51 +00:00
Gabe Black
e425bcabd2 arch,cpu,sim: Store registers in InstRecord with InstResult.
The InstResult knows how to print registers without having to know about
their actual types.

Change-Id: Ib858e32a7b2fabbde4857165b9e88e87294942c8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50254
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-08-02 12:44:25 +00:00
Giacomo Travaglini
174adc2993 arch-arm: Revamp TLB invalidation by introducing TLBIOp::match
Most of the invalidation methods in the TLB class are
doing the same thing: looping over all entries, checking if
the entry matches a certain criteria, and invalidating it
in case it does.

The only specific bit is the matching function, therefore
we add a virtual TLBIOp::match method which allows us
to specialize different TLBIs and to provide a single
flush method in the TLB class

Change-Id: I0672ff958742ac7ebff8d30218f75127343f1a58
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61753
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
2022-07-30 08:59:49 +00:00
Giacomo Travaglini
1290d15973 arch-arm: Simplify TLB invalidation with flushMva
The method is no longer calling the lookup method which
had been complicated by the introduction of partial translations.
(which is now called during address translation only)

The lookup method is iterating over all TLB Entries until a non
partial translation is found. Using lookup in flushMva makes it
O(n^2). With this patch we iterate over the TLB entries only once
(making flushMva O(n))

Change-Id: I8f2ae56192812cee231baf6943068abea4d7ef91
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61752
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-30 08:59:49 +00:00
Giacomo Travaglini
bad3e14bd7 arch-arm: Fix IPAS2 invalidation
Fixing invalidation behaviour for the following stage 2 TLB maintainance
instructions

MISCREG_TLBI_IPAS2E1_Xt
MISCREG_TLBI_IPAS2LE1_X
MISCREG_TLBI_IPAS2E1_Xt
MISCREG_TLBI_IPAS2LE1_Xt

1) Do nothing if EL2 is not enabled in the current security state
2) If we are in secure state, the 63 bit of the Xt register selects
the security domain (s/ns) of the invalidated entries

Change-Id: I4573ed60ce619bcefd9cb05f00c5d3fcfa8d3199
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61751
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-30 08:59:49 +00:00
Gabe Black
cc4380b0d6 cpu,arch: Put the name of the RegClass into the RegClass.
Move the name of the RegClass out of constants which belong to the
RegId, and instead store them in the RegClass instances.

Change-Id: I1ddd4bc8467d5e3f178db7a11c8f8052f43fd7ec
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50251
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-07-29 19:30:51 +00:00
Gabe Black
7b1f05a34c arch-arm,cpu: Simplify the RegClass constructor(s).
Replace the two constructors with one that takes the truly mandantory
parameters, and then a function to derive a new RegClass with some sort
of adjustment, currently by adding custom ops, or setting a non-standard
register size.

Because the constructor and the modifier function are constexpr, they
should fold away and not actually create extra temporary copies of the
RegClass in the modifier functions.

Change-Id: I8acb755eb28fc8474ec453c51ad205a52eed9a8e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/50249
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-07-29 19:30:27 +00:00
Giacomo Travaglini
e3ff57e477 arch-arm: Further clean up the AArch64 MSR/MRS decode
This is just rearranging special cases bringing them together within
read/write switch statements

Change-Id: I170aea2a251167d41070e35bef13b41353de2342
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61690
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
5a65aae091 arch-arm: Simplify AArch64 decode of unimplemented registers
Those registers are now handled through the fault callbacks

Change-Id: Id07c4d113260b749c24a895ed6e05f52c9f0eb9d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61689
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
d18b915008 arch-arm: Remove unimplemented flag from release dependant regs
We are instead just disabling read write permissions at every EL
if a specific release is not implemented

Change-Id: I677649c270a442dcd519339e2f64fb7927bf69cd
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61688
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
b7720a0995 arch-arm: MISCREG_IMPDEF_UNIMPL does not need unimplemented flag
The decode tree is checking for MISCREG_IMPDEF_UNIMPL before the
MISCREG_UNIMPLEMENTED flag

Faulting is handled anyway by the new fault callbacks

Change-Id: I600ac02913c2fd947c3a6b7f1f81111f21bff3f6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61687
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
7c52b0d9af arch-arm: Replace unimplemented+warnNotFail with callback
We are trying to deprecate the use of the MISCREG_IMPLEMENTED
flag.

Rather than using warnNotFail in conjunction with it, we
use the new faulting callback infostructure to deliver
either an Undefined Instruction or a warning with NoFault

Change-Id: Iee80171a6d28c55c9af069653306d6f8085faf78
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61686
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
c7b7314d8b arch-arm: Clear unused WARN_NOT_FAIL flag for AArch64 CMOs
The following AArch64 CMOs were flagged as warnNotFail even
if they are actually implemented and there is no reason
for them to fail:

MISCREG_DC_IVAC_Xt
MISCREG_DC_ZVA_Xt
MISCREG_DC_CVAC_Xt
MISCREG_DC_CVAU_Xt
MISCREG_DC_CIVAC_Xt

This is likely coming from AArch32 (those CMOs are unimplemented in
AArch32).

Please note: this patch is not changing anything behaviorally; the
warnOnFail flag is not considered in AArch64 unless the unimplemented
flag is also set (and this was not the case for those CMOs)

Change-Id: I40396016703b9eb48f69b0eb710d077f8c2b146b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61685
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
ce7448b53e arch-arm: Remove unimplemented flag from AArch64 registers
We don't need to explicitly set the unimplemented flag, we
can just avoid setting any read/write permission and that
will make the register implicitly unimplemented

Change-Id: I10add9f5744a027f893c56c7030cdfb69d79679c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61684
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
ef2573bc95 arch-arm: Convert to the new faulting logic
This patch is moving trapping behaviour modelled in
MiscRegOp64::trap to the MiscRegLUTEntry fault callbacks.

Change-Id: Idfca428e9e6669b747de0255888fc8a85a1f5d07
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61683
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
34f9e3525a arch-arm: Add generateTrap method to MiscRegOp64
Change-Id: I176cdb63284e146ce376344d895fdbf6c42b883d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61682
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
5afff98ee9 arch-arm: Add new trapping bitfields to the HCR register
Change-Id: Ie798594831790ae4ff551f68602b7505f0d4b237
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61681
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
01a0685d75 arch-arm: Use new faulting logic to handle SP_EL0
Change-Id: I518964b3e4d1abe153d2d175c765a6b46157cc3b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61680
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
936f1e8603 arch-arm: Merge checkFaultRead/Write into single checkFaultAccess
Change-Id: I6b4b8a2ced53c3957a9f1d9b3ea51851a9ec7343
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61679
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-29 06:51:11 +00:00
Giacomo Travaglini
1c423ad7e6 arch-arm: Remove MISCREG_INFO E2H flag
These VHE flags are not needed anymore.

They were used to trap EL2 access to VHE only registers (like CPACR_EL12)
when VHE was disabled (hcr.e2h = 0)

With the new faulting logic, we can just introduce VHE specific
callbacks checking for the hcr.e2h bitfield and returning an undefined
instruction if VHE is disabled.

In this way we don't have to add VHE only bits to every system register

Change-Id: I07bf9a9adc7a089bd45e718fb06d88488a2b7ed5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61678
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
9bd4520b13 arch-arm: Use new fault callbacks in canRead/WriteAArch64SysReg
This should be equivalent of checking the lookUpMiscReg[reg].info
bitset. The functions have been renamed to
checkFaultRead/WriteAArch64SysReg as they now return a fault and
not a boolean

Change-Id: I2d7465c368428a7d55eb48b32396315e23bcf0f9
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61677
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
79cbb0a668 arch-arm: Streamline RVBAR_EL1/EL2 access permissions
We don't need to handle RVBAR_EL1 and RVBAR_EL2 separately
every time we read or write a system register.
Instead we can just setup access permissions once at bringup,
based on the highest implemented Exception Level

Change-Id: I19a2cbd783829051766ea45d76a964acc29fe73a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61676
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
5f67c7e54d arch-arm: Add FaultCB callbacks to the MiscRegLUTEntry class
This patch is adding per-EL read/write callbacks to the MiscRegLUTEntry
class.  The goal is to merge access permission and trapping logic into
these unified callbacks

As of now the default callbacks are simply reimplementing the access
permission code, checking for MiscRegLUTEntry flags. This is the default
behaviour for all registers.
Trapping code (from MiscRegOp64::trap) will be moved with a later patch

Change-Id: Ib4bb1b5d95319548de5e77e00258fd65c11d88d7
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61675
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
167cf86375 arch-arm: Move access permission bitset within MiscRegLUTEntry
Rather than having two separate MiscReg metadata vectors, we are
storing the access permission bitset within the MiscRegLUTEntry

Change-Id: I2f5d175617c888f0eb6954d29a4c607e0cbc3611
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61674
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
f118b5755a arch-arm: Move lookUpMiscReg vector out of the ISA class
Our plan is to consolidate the lookUpMiscReg vector with the
miscRegInfo one into a single metadata vector

Change-Id: I07b5a63a8da6d9b48593a904f6912b84a2afdd2c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61673
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
e4ab0bb5cf arch-arm: Add a getter for miscRead member variable
In this way our ISA code can check if a MiscRegOp64 is a MSR or a MRS
and act accordingly

Change-Id: I9ddb9df432b28ce7d20235fc51f3637c41f3256a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61672
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
07b6f4261c arch-arm: Add undefined helper to ArmStaticInst
In this way we can generate an Undefined Instruction fault
from the instruction object without requiring to access its
menmonic or opcode

This is generalizing the existing disabledFault helper

Change-Id: Ib7dec9399f142c35d75057f37ab53cce102fa01e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61671
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
25bdb73b9f arch-arm: Generate MSR/MRS iss within trapping logic
The iss field is only used when the MSR/MRS instruction
gets trapped. Rather than generating it at decode time,
we generate the value within the trap method instead

This avoids the confusion of having a MSR/MRS register
instruction storing an immediate field

Later patches will change this even further by generating the
iss field on the fly ONLY if the instruction gets trapped

Change-Id: I97fdcf54d9643ea79a1f9d052073320ee68109fd
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61670
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
2022-07-28 13:24:02 +00:00
Giacomo Travaglini
6217ac737b arch-arm: Overload decodeAArch64SysReg to accept a MiscRegNum64
Overload decodeAArch64SysReg to directly accept a MiscRegNum64

Change-Id: I43c1dae6c0e382c03612f4ce4fc89aadddf30fd5
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/61669
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-28 13:24:02 +00:00
Gabe Black
654451c2be arch,cpu: Keep a RegClass pointer in RegId instead of a RegClassType.
This makes it easy to get access to the RegClass that goes with a
register without having to look it up in a separate structure.

Change-Id: I4cfff2069d63f3c1c3fb0fea5dee3baf357bd478
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49786
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-27 13:54:32 +00:00
Gabe Black
45cf2e3c34 arch: Minimize use of RegClassType constants and the RegId constructor.
These are global values which prevent making register types ISA
specific.

Change-Id: I513adcae5ad316122c24f25a9e01b9974629510f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49785
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-27 10:59:07 +00:00
Gabe Black
70289e72cd arch,cpu: Store pointers to RegClass-es instead of instances.
This lets us put the actual RegClass-es somewhere else and give them
names.

Change-Id: I51743d6956de632fa6498d3b5ef0a20939849464
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49784
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Boris Shingarov <shingarov@labware.com>
2022-07-26 19:37:59 +00:00
Giacomo Travaglini
ccdec1b11d arch-arm: Do not trap SIMD insts to EL1 if in VHE host
Change-Id: I4ea326eead1aec1e013280b599c57f2202901625
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/60971
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-05 08:45:01 +00:00
Giacomo Travaglini
343f7b7bf6 arch-arm: Do not trap MISCREG_DC_ZVA_Xt to EL1 if in VHE host
Change-Id: I785be01fcb97b78e0b59f8f9a4f8d150208fa88a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/60970
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-05 08:45:01 +00:00
Giacomo Travaglini
ea9620922c arch-arm: Revamp of AArch64 S1 access permission logic
This patch is revamping/simplifying the access permission logic in the
ArmMMU (ArmMMU::s1PermBits64) by matching more closely the Arm
architecture reference manual pseudocode.

It also fixes VHE access permission: previous version was not
considering the EL2&0 translation regime.
Now EL2&0 is handled correctly through the new hasUnprivRegime method

Change-Id: I2689738f36a35c35cc4f2ef8af68ee2a3eef65e8
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/60969
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-07-05 08:45:01 +00:00
Yu-hsin Wang
c1b709e46d fastmodel: handling amba control signals
Change-Id: I7a62bdd4bfdb2bba4f7e186b049491b48782d7d8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/59652
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-07-04 02:59:58 +00:00
Giacomo Travaglini
b0eaecc77b arch-arm: Check if VectorCatch is nullptr
This is needed after [1].
Simulation starts with a call to the reset fault in the
initState stage and therefore checks for the vector catch
object. This happens before the SelfDebug object is properly
initialized.

[1]: https://gem5-review.googlesource.com/c/public/gem5/+/60730

Change-Id: Ic117413611aa30386327bbc13e5489fab32733de
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/60769
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-06-27 23:35:49 +00:00