Commit Graph

18619 Commits

Author SHA1 Message Date
Zhengrong Wang
c71058cfa5 configs: Call createThreads() for FutureCPUs.
When using fast forwarding, createThreads() is not
called upon FutureCPUs. This causes segment fault
as the decoder is initialized in createThreads() and
needed when instantiating CPUs.

This commit basically fixes this by invoking
createThreads() on FutureCPUs after they are created.

Change-Id: I812d18f06878f9fc3fa2183a2c8a64d316413398
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56812
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Luming Wang <wlm199558@126.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-15 05:07:38 +00:00
Gabe Black
a19bb5f5ab arch,cpu: Turn (read|set)*Reg into inline helpers.
Eliminate readFloatRegFlat and setFloatRegFlat for the Fast Model
ThreadContext since ARM doesn't use those register types, and those
methods are no longer required by the ThreadContext interface.

Change-Id: Ic149c64e2fbf1d313066fefe480c435eef6d66e5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49113
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-14 21:48:37 +00:00
Gabe Black
a9ef634fa8 arch-x86: Use the seg unusable bit and not a null selector in the TLB.
When dealing with segmentation in x86, it is *usually* illegal to
attempt to access a segment which has a null selector when in protected
mode and not in 64 bit mode. While this is *almost* true, it is not
actually technically true.

What actually *is* true is that if you *set up* a segment using a null
selector in those circumstances, that segment becomes unusable, and then
tryint to use it causes a fault.

When in real mode, it is perfectly legal to use a null selector to
access memory, since that is just a selector with numerical value 0.
When you then transition into protected mode, the selector would still
be 0 (a null selector), but the segment itself would still be set up
properly and usuable using the base value, limit, and other attributes
it carried over from real mode.

Rather than check if a segment has a null selector while handling
segmentation, it's more correct for us to keep track of whether the
segment is currently usable and check that in the TLB.

Change-Id: Ic2c09e1cfa05afcb03900213b72733545c8f0f4c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55245
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2022-02-14 21:42:05 +00:00
Gabe Black
0ad4a0b774 arch-x86: Fix immediate based IN instructions.
These were loading the immediate into a temporary microcode register
which would then be used to calculate the address to actually send to
the memory system. Unfortunately this was using a data size equal to the
address size, which would mean that the immediate would be merged into
that temporary, leaving previously set bits intact. The data size
*should* have been set to 8, and was already in other similar
instructions. That forces the limm microop to overwrite the temporary
entirely.

Change-Id: I87c82b4677db768ccb6401a3dbda61317c014152
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55286
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2022-02-14 21:41:39 +00:00
Bobby R. Bruce
557ee3f74c python: Update gem5 url output by the simulator
This patch:
- Replaces 'http' with 'https'.
- Adds 'www'.

Change-Id: I6500a39171eb79c98754f517ff1fdd0cf60d83d0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56649
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-14 21:14:26 +00:00
Bobby R. Bruce
4e4f8f1347 tests: Add o3 classic init x86 boot tests
These have been included to ensure the o3 CPU is tested sufficiently.

Change-Id: Ifa7564171be4a3bc94301ccfdbd85b72568d7c77
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56203
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-11 17:58:39 +00:00
Luming Wang
8cd70b7da1 arch-riscv,sim-se: correct the spelling of sendto
The system call "sendto" is incorrectly written as "sendo".
This patch fixes this spelling error and adds support for `sendto`.

Change-Id: I21851fe7679509161b09d335a5df9640c8334430
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56689
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-11 03:33:02 +00:00
Gabe Black
65f5f61ca8 fastmodel: Adopt the default implementations of TC *Reg funcs.
The ThreadContext methods for the fast model are not on the critical
path and so aren't performance sensitive, and this will avoid having to
reorganize the readIntReg, etc, functions to use the new scheme. That
can be done down the line.

Change-Id: Icb9196815ce5a07edae333f19d2ea120015aaf1a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49112
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-02-10 23:58:45 +00:00
Gabe Black
17c7f33fdb cpu: Implement (get|set)Reg(Flat|) for the checker CPU.
These are very simple, since they just delegate to other TCs.

Change-Id: I08fd8de09c90c74548987d537e282edc297ac4e8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49111
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-02-10 23:56:37 +00:00
Gabe Black
5c9b4c096f cpu: Implement (get|set)Reg(Flat|) for SimpleThread.
Change-Id: Iddda31746606865d746df98e9e6d5adfa7266745
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49110
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-10 23:56:37 +00:00
Gabe Black
3ca13734ac cpu: Implement getReg and setReg for O3.
Change-Id: I3f0bf1e75a5191be98c79fede5aad854a920e9c9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49109
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-02-10 23:56:37 +00:00
Gabe Black
772b2ab8ba ext: Update ply to version 3.11.
We had been using version 3.2 from 2009, which does not have support for
t_eof().

Change-Id: Id5610a272fe2cecd586991f4c59f3ec77184164e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56342
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-10 16:57:10 +00:00
Gabe Black
00221a68bd scons: Exclude parsetab.py when collecting python deps.
Because we don't have a good way to actually figure out what python
files we depend on, we have to use Glob and wildcard matching to depend
on all potential python files. Unfortunately that will pick up the
parsetab.py file that ply generates, which is a cached intermediate file
and not an input.

Change-Id: Id3dc0083e97c145deca04939182157623d6b780f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56341
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-02-10 16:56:49 +00:00
Giacomo Travaglini
9e62fcf2bd dev-arm: Add a KVM Gicv3 model to VExpress_GEM5_Foundation
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: Ic5cfeeec59630253acb3ccc451553eb4eb7907e2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55615
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-10 08:59:25 +00:00
Giacomo Travaglini
6cf0e0bcc2 arch-arm, kvm: Handle vcpu2 if more than 256 vCPUs are in use
According to KVM Docs [1]:

"When KVM_CAP_ARM_IRQ_LINE_LAYOUT_2 is supported, the target vcpu is
identified as (256 * vcpu2_index + vcpu_index). Otherwise, vcpu2_index
must be zero."

The vcpu parameter from the setIntState method is populated with
the gem5 context identifier (ContextID) of a specific PE.
It is not contrained by the 256 vcpu limit, so it can already specify
more than 256 vcpus. We therefore just need to translate/unpack the
value in two indices (vcpu and vcpu2) which will be forwarded to KVM
when raising an IRQ from userspace.

We guard the vcpu2 retrieval with a hash define as this is a late
addition and some older kernels do not define this capability (4.15 as
an example).

[1]: https://www.kernel.org/doc/html/latest/virt/kvm/api.html

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: If0c475dc4a573337edd053020920e9b109d13991
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55964
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-10 08:59:25 +00:00
Giacomo Travaglini
469d90cbbe arch-arm: Add a KvmKernelGicV3 model
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I7b0db0b8b436a6b2ca47444e4e1f8a2a20bd7c25
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55614
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-10 08:59:17 +00:00
Bobby R. Bruce
a315df2dd8 tests: Add x86 mutlicore boot tests for timing CPUs
Due to a spin lock error affecting multicore timing cores,
https://gem5.atlassian.net/browse/GEM5-1105, gem5 only supported
single-core timing setups. As this has now been fixed, we support it.
This patch expands the boot tests to include tests for multicore timing
CPU systems.

Change-Id: I89b7f1bed077373dae5e9b8eb6818129da915fee
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55744
Reviewed-by: Austin Harris <mail@austin-harris.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-09 21:36:18 +00:00
Daniel R. Carvalho
43df899229 mem-cache,tests: Add unit test for ReplaceableEntry
Add a unit test for ReplacementPolicy::ReplaceableEntry.

Change-Id: Iaa0c0cfdf1745b7b4d9efbe8ccab8f002a1bcee8
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44110
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-09 21:16:35 +00:00
Daniel R. Carvalho
f65e370e39 sim,tests: Add a tag for drain-related files
This tag can be used to determine which files are needed
when sim/drain.hh is included in a header file. For
example, when declaring a unit test, this tag makes
the SConscript declaration much simpler.

Change-Id: Ie8a44291a0408090ffbb5b078582d3c5c8d1fd55
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44108
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-09 10:24:54 +00:00
Daniel R. Carvalho
0ea570c8a1 sim,tests: Add a tag for gem5 events
This tag can be used to determine which files are needed
when sim/eventq.hh is included in a header file. For
example, when declaring a unit test, this tag makes
the SConscript declaration much simpler.

Change-Id: If68ddf94975dbe9f7121fefb6051a8bbaca19c4b
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/44107
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-09 10:24:54 +00:00
Daniel R. Carvalho
a4195d3ed1 sim,tests: Add unit test for Globals
Add a unit test for sim/globals.

Change-Id: Ia47e750df4cbdb91a0ab0498819f4e3451d74830
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/43593
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-09 10:24:54 +00:00
Gabe Black
8767fca212 scons: Remove a blanket USE_KVM disable check from SConstruct.
Whether to honor the USE_KVM setting can be handled in a more targeted
way down at individual consumers. They will know what ISA the host needs
to be for their particular model to make sense, where the SConstruct has
to enable or disable it for the entire build of gem5.

Change-Id: I9e82e232203834f6fe56d0ce5cf696809a0970bc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56188
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-09 02:36:49 +00:00
Erhu
1924be92ea arch-riscv: Fix the pmp check for pagetable walker
During the page table walking,
MMU will perform the PMP check for each page table page.
However, in the current implementation,
the param:mode used by pmp_Check() is equal to the MMU mode,
which means the page table page has an executable mode
if the target page is executable (during pmp_Check).
As the page table page will never be executable,
the mode for the page table page is either read or write.

Jira Issue: https://gem5.atlassian.net/browse/GEM5-1143

Change-Id: I105f52ef58fe1fbbf7d84c6563e8a8c22cea9ccb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55063
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ayaz Akram <yazakram@ucdavis.edu>
2022-02-08 23:45:54 +00:00
Majid Jalili
714b9b2356 mem-cache: adding round-robin aribitration to multiprefetchers
To find a candidate in cache base.cc, function getPacket
is called. In case of multi-prefetchers, we alyways start
from the first prefetcher. Given the default value for "latency"
is 1, there is always a candidate ready for prefech by prefetcher 0.
Hence, we need an arbitration mechansim to cycle through
all prefechers. To make this fair, we added a variable to save what
prefetcher first used to get a packet from, and in the next round,
 we start from the next prefetcher to give every prefetcher a chance
to be the first one in a round-robin fashion.

JIRA Ticket: https://gem5.atlassian.net/browse/GEM5-1169

Change-Id: I1c6a267b2bf71764559a080371c1d7f8be95ac71
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56265
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-08 16:51:46 +00:00
Giacomo Travaglini
c6df79628c arch-arm: Generate a decode map for AArch32 MiscRegs
This is aligning with what has already been implemented for
AArch64 [1]

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

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: If1a34221ede0c733e2819c9db799ab8ef48e6d25
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56428
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-08 09:15:55 +00:00
Jui-min Lee
9d63b391d2 base: Fix ListenSocket binding logic
The original implementation does not cleanup the socket after it failed
to listen. However, the API doesn't give our user a way to bypass the
bind part and the next try will always break at the bind call.
Furthermore, the next failure will be EINVAL instead of EADDRINUSE so
gem5 will just abort without giving any meaningful message.

In this CL we cleanup the socket if we failed to invoke listen, so the
user can retry with a clean state and even retry on another port.

Test: Try to launch two gem5 that both bind to gdb port (7000) and
    repeat it for 100 times.
Change-Id: I7272ea3c3b6ab56e4b904f3a3a45ed389d00dd05
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55943
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nathanael Premillieu <nathanael.premillieu@huawei.com>
2022-02-08 00:01:47 +00:00
Gabe Black
06d455ec4e cpu: Add generalized register accessors setReg and getReg.
These will read registers of any type, as described by a RegId. These
currently have default implementations which just delegate to the
existing, register type specific accessors.

Change-Id: I980ca15b3acd9a5a796c977276201d64c69398b8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49107
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-07 09:59:00 +00:00
Gabe Black
d0b7de0f87 cpu: Store raw byte vectors for register files.
Individual register files, like the ones for scalar integer, floating
point, or condition code registers, are now declared as vectors of their
actual type. Accessing them is simple, since the register you want can
be accessed simply by indexing into the vector.

Unfortunately, that means the code that sets up that storage has to know
what that underlying type is, and that means knowing (and hard coding)
information about the ISA being built.

Instead, this change makes the SimpleThread and O3 PhysRegFile classes
store registers as vectors of bytes, and offsets into those vectors
using computed offsets. Because the elements of the register files are
forced to be offset by powers of 2, computing the offsets can be done
with a shift rather than a multiplication.

The accessors which actually pull values in and out of these vectors are
still specific to each register type and need to know what the
underlying type is, but this change pulls that one level out of the CPUs
towards their peripheral APIs. Later changes will factor these uses out
as well.

Change-Id: I5e19d359a0e83e5827ae263d369999f90c7aa63d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49105
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-02-07 09:58:38 +00:00
Giacomo Travaglini
886339e927 arch-arm: Fix typo in SDCR name
SDRC -> SDCR

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: Ib7fce528dbfcb7de2cac73b134cf05e78a186762
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56427
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-07 09:45:50 +00:00
Giacomo Travaglini
24893f090d arch-arm: Replace MISCREG_CP14/15_UNIMPL with MISCREG_UNKNOWN
MISCREG_UNKNOWN is the MiscRegIdx of an invalid AArch64 system
register.  There is no need to define extra ids for AArch32 CP14/CP15
registers.

We are therefore removing them in favour of MISCREG_UNKNOWN instead

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: Ib41813dfcb6a9cad84b7cef9603bc530cf4b593d
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56426
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-07 09:45:50 +00:00
Gabe Black
c419207b82 arch-x86: Filter out the NMI masking bit from the CMOS offset.
A (another) weird/terrible quirk of the architecture of the PC is that
the the highest order bit of the value which selects a register to read
from the CMOS NVRAM/RTC is stolen and repurposed to enable/disable NMIs
since the 286, if the internet is to be believed.

Fortunately We don't currently attempt to generate an NMI anywhere, and so
this bit won't do anything in gem5 currently.

Unfortunately if we treat this value as the real offset without masking
off this bit, if software attempts to disable NMIs with it, it will
trigger an out of bounds assert in the CMOS device.

This change makes the CMOS device slightly smarter and has it maintain
but ignore the NMI disabling bit.

Change-Id: I8d7d0f1b0aadcca2060bf6a27931035859d66ca7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55244
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-04 18:19:34 +00:00
Gabe Black
10b8bc95d3 python: Remove the m5.config and options.py mechanism.
It appears that there is a mechanism where you could either have a .m5
directory in your home directory, or set an M5_CONFIG environment
variable to some other directory, where you could put an options.py
file. That file would then be passed the options dict which gem5's main
had extracted from its args, which it could modify as it liked.

First, I suspect that this mechanism was basically unknown and was just
a dark corner of gem5 people had forgotten about. Getting rid of it
will help clear out old cruft.

Second, this sort of file reaching in and fiddling with gem5's internal
data structures is dangerous and fragile, and could in almost any case
be replaced with a wrapper script or shell alias.

Change-Id: Ic828716979ea6379f60de796d23281ab075b38ec
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56387
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-04 18:18:58 +00:00
Gabe Black
e7f2d17338 scons: Make CC, CXX and PROTOC no longer sticky.
These variables will always be imported from the environment, and never
from previous builds. For SCons to actually use these values, they need
to not only be in the environment variables external commands SCons runs
sees, they also have to be promoted to actual SCons construction
variables.

Change-Id: I54035442d70972396f1788bd0773877222d7a7c5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56386
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-04 18:18:58 +00:00
Gabe Black
ab73158c1d arch-x86: Use operand size consistently pushing for near calls.
The near call instruction first attempts to store the return address on
the stack (the part of the instruction that could fail), and then if
that succeeds it decrements the stack pointer to point at the newly
stored data.

Unfortunately, the microcode was not using the same offset between
those two steps. Specifically it was using the effective operand size
when storing the return address, but then incorrectly using the
effective stack size when adjusting the stack pointer.

This change updates the microcode to use the effective operand size in
both places.

Change-Id: Ic4211a96900fee5d10c2fa0e038070383fefaac3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55250
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-02-04 12:14:42 +00:00
Gabe Black
97d5120982 cpu,arch-arm: Track register size in RegClassInfo.
By default, registers are the size of RegVal, the type often used to
store them. For some types of registers, like vector or vector predicate
registers, the size of each individual register is larger, and can't fit
in a primitive type.

To help facilitate storing even these outliers in a generalized way,
this change adds two fields to RegClassInfo to track the size of
individual registers. One tracks the raw size of the registers
themselves, and the other tracks the minimal shift necessary to find the
offset of a register in a contiguous(ish) array of bytes. By forcing
each register to be aligned to a power of two boundary, we avoid having
to do a multiplication to find their address even if the registers are
oddly sized. We can instead do a shift with a precomputed shift amount
which should be faster.

Change-Id: I035f1b4cb00ece4e8306d7953ea358af75a0d1de
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49104
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-04 12:12:37 +00:00
Gabe Black
a0e36759a1 cpu: rename RegClass::size to RegClass::numRegs.
This will make the coming addition of a regBytes method less ambiguous.

Change-Id: If4b9369dbe484154eec7bf651642cb1d820283e4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56303
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-04 12:11:59 +00:00
Gabe Black
9c7576d8e7 cpu-kvm,sim: Reverse the relationship between System and KvmVM.
The KvmVM will declare itself to the System object, instead of the other
way around. This way the System object can just keep an opaque KvmVM
pointer which does not depend on the KvmVM code even being compiled into
gem5. If there is a KvmVM object, that can more safely assume there is a
corresponding System object to attach itself to.

Also move use of the KvmVM pointer out of constructors, since the VM may
not have registered itself with the System object yet. Those uses can
happen in the init() method instead.

Change-Id: Ia0842612b101315bc1af0232d7f5ae2b55a15922
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56187
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-04 12:11:32 +00:00
Giacomo Travaglini
45a07f1eeb dev-arm: Gicv3 implementation of the Gicv3Registers interface
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: Iba23604cc6f7d5a1de91c287b4546154fcb20535
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55612
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-03 16:36:29 +00:00
Giacomo Travaglini
03176aa025 arch-arm: Define an Affinity type
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I42461de26886b1ba9e4db5b23a9fb970d3a1efd7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55705
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-03 16:36:29 +00:00
Giacomo Travaglini
342ad01168 dev-arm: Use ArmISA::getAffinity in GICv3 redistributor
The GICv3 redistributor was reading the MPIDR value and manually
extracting the affinity numbers from it. This is not necessary as there
is already a getAffinity helper function

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I6ef150937b51bb065575ed2f432f4f5f0bc38b07
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55704
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-03 16:36:11 +00:00
Giacomo Travaglini
c28feb20f2 arch-arm: Templatize MuxingKvmGic to support flexible hierarchy
By templatizing the MuxingKvmGic we decouple it from the GicV2
class, unlocking non GICv2 (e.g. GICv3) KVM and guest implementations

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I26838903fa7c9f8b9de40678021329cb3390cc74
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55611
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-03 16:36:11 +00:00
Giacomo Travaglini
0865772b28 arch-arm, dev-arm: Remove generic BaseGicRegisters interface
The GICv3 register interface is different from the GICv2 one: from
the presence of redistributor registers up to the system register
implementation of the cpu-interface

We therefore make the current BaseGicRegisters interface GICv2 specific.
We will define a different Gic3Registers interface for GICv3 state
transfer

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I42f15f48cab6e26aaf519e13c2ce70f661801117
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55703
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-03 16:36:11 +00:00
Giacomo Travaglini
3e3799dab9 arch-arm: Fix gem5 build on aarch64 host
vm is not a member variable of MuxingKvmGic. This was broken
by:

https://gem5-review.googlesource.com/c/public/gem5/+/56263

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: Iee8a3424eb28cfe2bc20df088dc0af05e9e8a7de
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56346
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-03 16:36:11 +00:00
Gabe Black
7399bbc5b6 dev: Rework how IDE controllers, channels and disks relate.
Disks now track the channel they're attached to so that that doesn't
have to be rediscovered by comparing points, channels know if they're
primary or secondary, and interrupts will now set the interrupt bit of
the channel they're associated with instead of always the primary.

Also the interrupt mechanism was adjusted slightly so that it's
implemented by a virtual function which knows whether the interrupt came
from the primary or secondary channel. That will make it possible to
implement separate interrupts, as required by the compatibility mode
which can be used with x86.

Change-Id: Ic5527c238ef7409153e80e4ab843a50be6e452c5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55584
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-03 07:46:32 +00:00
Gabe Black
0e0ca633a2 cpu: Get rid of the unused o3::ThreadContext::readReg.
Change-Id: I5c654240d7ccb09f983b4e87dde15e317fb7d953
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49106
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-02-03 00:42:53 +00:00
Giacomo Travaglini
6bbeba8f94 arch-arm, kvm: Define a base KvmKernelGic
This patch is defining a base KvmKernelGic class to be
subclassed by post Gicv2 (e.g. Gicv3) implementations.

Change-Id: I1b79d4813208f78f7a0fc311bdc362414e4a3dcc
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55610
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-02-02 13:05:42 +00:00
Gabe Black
ac5f79af28 cpu-kvm: Move the validKvmEnvironment method into KvmVM.
This makes the generic System class consistent whether you have KVM
enabled or not.

Change-Id: Ie6928961200943d1d4e3bd129a4e4269e9f12950
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56263
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-02 01:45:58 +00:00
Gabe Black
5e1fdf7586 arch: Remove TheISA::VecElem from arch/vecregs.hh.
Also remove unnecessary includes from the x86 version, and fix up
transitive includes from other x86 files.

Change-Id: I9f7d330f287c9ed52eed1544c47251b4354cfab3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49166
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-01 18:48:55 +00:00
Gabe Black
f4ee1a9536 arch: Get rid of the TheISA::NumVecElemPerVecReg variable.
Remove it from the arch/vecregs.hh interface. It's used internally by
ARM, where it will remain.

Change-Id: Ic319b404cbd77875c780faee66d5abdd7bfc0608
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49165
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-01 18:48:18 +00:00
Gabe Black
a00a6f953f cpu: Stop using NumVecElemPerVecReg.
Use the register classes regName method, or if necessary, the ratio
between the size of the vector register file and the vector element
register file.

Change-Id: Ibf63ce2b3cc3e3cc3261e5a9b8dcbfdc0af5035b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49164
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-02-01 18:47:17 +00:00