Commit Graph

18646 Commits

Author SHA1 Message Date
Gabe Black
40b9c0d2bd cpu: Remove the default implementation of (get|set)RegFlat.
This was originally intended to call back into the original readIntReg,
setIntReg, etc, but now that *those* are implemented by calling into
getRegFlat, setRegFlat, etc, that's a circular dependency and makes that
implementation unusable.

Change-Id: I4135f0d8721f5f9d724be590767bed0023a9de20
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49698
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-24 00:10:17 +00:00
Gabe Black
ae10990287 cpu: Use arrays and abstraction to handle regs in SimpleThread.
This gets rid of quite a bit of switch statements and one or two
sequences of performing the same operation on each register file
explicitly.

Change-Id: Ifd343563c87530a022c74ea6e25416be4fb5236f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49697
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-24 00:10:17 +00:00
Gabe Black
64171d4d14 cpu,arch: Attach a debug flag to each RegClass.
This can be used for DPRINTFs related to those registers using DPRINTFV.

Change-Id: I0fccb12b70fdb74e01022fe0d3d9c2f92425a5bf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49696
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-02-24 00:10:17 +00:00
Gabe Black
322f1d8fe7 arm: Use custom RegClassOps for vector and vector pred registers.
Change-Id: Icef429d5c9c036541472c470d5009c8d29a74548
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49695
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-24 00:10:17 +00:00
Gabe Black
6cc3a27e09 arch-x86: Fix some settings installed by the init interrupt.
VMX requires that the present bit of the LDT and the TR are set, and
that the unusable bit of the TR is zero.

Change-Id: I4c4feba38d4fef11ad3b804d41dacb69cc3e6bd5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57051
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-02-23 19:57:13 +00:00
Gabe Black
70ee16a387 arch-x86: Propogate the unusable bit to KVM.
The unusable bit is now used by gem5. Pass that bit through to KVM
instead of a dummy value 0.

Change-Id: I59912b478a3de95684fb0cc65ff5703d201df8cb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57050
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-02-23 19:57:13 +00:00
Gabe Black
0e65df2cf5 arch-x86: Respect LDT and TR bases in long mode.
The LDT and TR bases *are* respected in 64 bit mode, so the base values
need to be set as specified.

Change-Id: Ieb1b58511d9651e6e59be199059b9d2b8c670472
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57049
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
2022-02-23 19:57:13 +00:00
Gabe Black
85b769a68e cpu,arm: Add a method to RegClass-es to print register values.
This further abstracts the properties of registers so they can be
removed from the CPUs.

Change-Id: I2aa1bffe8b095a0301579e60270965c611d6db4e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49694
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-23 09:30:09 +00:00
Gabe Black
ff4a8b15a0 scons: Handle TARGET_GPU_ISA not being set.
If TARGET_GPU_ISA is not set, even if the GPU ISA namespace isn't used
by anything, the logic which figures out what to set it to will fail.
This checks for that condition and sets it to something invalid, but
doesn't crash. If that namespace is actually used, then the build will
still fail.

Change-Id: Iec44255cccbafa4aceaa68bdd8b6a835dc0637a0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56895
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-23 02:31:56 +00:00
Hoa Nguyen
52485bbc38 dev: Make VirtIORng device use gem5's rng instead of C++'s
Currently, VirtIORng uses C++'s RNG. This causes nondeterminism
across simulations using this device. One example is the example RISC-V
board booting Ubuntu,

configs/example/gem5_library/riscv-ubuntu-run.py

JIRA: https://gem5.atlassian.net/browse/GEM5-1193

Change-Id: I299e72eb891819007b4260390f5c2ba94d2dec7b
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56889
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-23 02:21:15 +00:00
Giacomo Travaglini
b4ba4916dd cpu: Handle Request::NO_ACCESS flag in MinorCPU and O3CPU
The Request::NO_ACCESS flag instructs the cpu model to not issue
the request to the memory port.

While Atomic and Timing CPU models properly implement it [1], [2],

* MinorCPU is not looking at the flag
* O3CPU is looking at the flag only in case of a nested transaction
start/commit

This patch is extending NO_ACCESS support to all memory instructions.
This is achieved by using the localAccess callback in the Request object.

Handling of nested hardware transactions in the O3 LSQUnit is moved within
the local accessor callback

[1]: https://github.com/gem5/gem5/blob/v21.1.0.2/\
    src/cpu/simple/timing.cc#L318
[2]: https://github.com/gem5/gem5/blob/v21.1.0.2/\
    src/cpu/simple/atomic.cc#L396

Change-Id: Ifd5b388c53ead4fe358aa35d2197c12f1c5bb4f2
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56591
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: ZHENGRONG WANG <seanyukigeek@gmail.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
2022-02-22 10:09:16 +00:00
Gabe Black
071858595d cpu: In SimpleExecContext, use arrays to map reg classes to stats.
Use arrays to more efficiently look up what stats to increment instead
of using switch statements.

Change-Id: I845d0c01ba5b930d46b36147a3136fd721241ed9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49693
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-19 20:23:51 +00:00
Gabe Black
6d27a3bb50 cpu,arch: Turn the read|set*Operand methods into get/setRegOperand.
This simplifies and generalizes the ExecContext interface significantly.
This does *not* change the "Writeable" accessors for the vec and pred
registers, and it also ignores MiscRegs which have some different
semantics.

Change-Id: I8cb80da890fc8915f03be04e136662a257d06946
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49114
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-19 20:23:51 +00:00
Luming Wang
211c7df045 arch-riscv: fix memory leak problem in page table walker
Valgrind detects memory leak problems in RISC-V's page table
walker(`Walker::WalkerState::stepWalk()`). In some situation,
the response packet is not freed. This patch partially fix
these memory leak problems.

Change-Id: I86d4c69c3c502bd92856a3d8863bfa1722a94512
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56609
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Ayaz Akram <yazakram@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-19 11:49:44 +00:00
Gabe Black
0d59a8417a ext-testlib: Import MutableSet properly.
The MutableSet class used to be part of the collections module directly,
but in 3.3 was moved to collections.abc. Apparently there was still a
version in collections, since we had been importing it from that old
location and it had been working up until now. After a recent update,
this stopped working for me, and may be tied to an update to the local
version of python on my machine.

This change imports MutableSet from collections.abc instead of
collections directly. I found only one place that this class was used in
src or ext, so I don't think it needs to be fixed anywhere else.

Change-Id: I8b2e82160fd433d57af4a7008ec282ee8ad8a422
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56849
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
2022-02-19 01:13:46 +00:00
Kyle Roarty
78451f6685 gpu-compute: Fix register checking and allocation in dyn manager
This patch updates the canAllocate function to account both for
the number of regions of registers that need to be allocated,
and for the fact that the registers aren't one continuous chunk.

The patch also consolidates the registers as much as possible when
a register chunk is freed. This prevents fragmentation from making
it impossible to allocate enough registers

Change-Id: Ic95cfe614d247add475f7139d3703991042f8149
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56909
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
2022-02-18 18:46:33 +00:00
Kyle Roarty
4d2cbefd1e gpu-compute: Set scratch_base, lds_base for gfx902
When updating how scratch_base and lds_base were set, gfx902 was left out.
This adds in gfx902 to the case statement, allowing the apertures to be set
and for simulations using gfx902 to not error out

Change-Id: I0e1adbdf63f7c129186fb835e30adac9cd4b72d0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54663
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matthew Poremba <matthew.poremba@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-17 21:20:16 +00:00
Tiago Mück
f5fc1006c3 cpu: fix issues with ruby's memtest
If the size of the address range is smaller than the maximum number
of outstanding requests allowed downstream, the tester will get stuck
trying to find a unique address. This patch adds a check for this
condition and forces the tester to wait for responses before
trying to generate another request.

Change-Id: Ie894a074cc4f8c7ad3d875dc21e8eb4f04562d72
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56811
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-17 20:43:08 +00:00
Matthew Poremba
48aa4692df configs: Allow for no DMAs in Ruby GPU tester
If there are no DMA devices, we should not create any tester threads,
sequencers, or an IO crossbar.

Change-Id: I5762a70a064df5310e3f30d41bffc7800b53eb0b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56451
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-17 17:03:19 +00:00
Matthew Poremba
5530bd42d5 cpu: Only acquire needed tokens in PTL tester
The tester currently assumes that one token per lane is needed when
checking if an action is ready to be issued. When actually issuing
requests, it is possible that a memory location is not valid for various
reasons. This was not being considered when checking for tokens causing
the tester to acquire more tokens than requests sent. Since tokens are
returned when requests are coalesced, this was causing some tokens never
to be returned, eventually depleting the token pool and causing a
deadlock.

Add a new method which determines the number of tokens needed for an
action. This is called by both the ready check method and the method to
issue the action to ensure they are aligned.

Change-Id: Ic1af72085c3b077539eb3fd129331e776ebdffbc
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56450
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-17 17:03:19 +00:00
Matthew Poremba
1bc23ca966 mem-ruby: Add protocol prints to MOESI_AMD_BASE-dma
Change-Id: I59ed7311a8dc2a06ce1df0027891ba8e24e8a89e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56447
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-17 17:03:19 +00:00
Matthew Poremba
7018c2b34e mem-ruby: Remove DirectoryMemory storage in MOESI_AMD_BASE-dir
This protocol is using an old style where read/writes to memory were
being done by writing to a DataBlock in a DirectoryMemory entry. This
results in having multiple copies of memory, leads to stale copies in at
least one memory (usually DRAM), and require --access-backing-store in
most cases to work properly. This changeset removes all references to
getDirectoryEntry(...).DataBlk and instead forwards those reads and
writes to DRAM always.

This results in new transient states BL_WM, BDW_WM, and B_WM which are
blocked states waiting on memory acks indicating a write request is
complete. The appropriate transitions are updates to move to these new
states and stall states are updated to include them. DMA write ACK is
also moved to when the request is sent to memory, rather than when the
request is received.

Change-Id: Ic5bd6a8a8881d7df782e0f7eed8be9d873610e04
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56446
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-17 17:03:19 +00:00
Matthew Poremba
54fc137945 mem-ruby: Ensure MOESI_AMD_Base-dir has probe destinations
The directory has an assert that this is at least one destination for a
probe when sending an invalidation or shared probe to coherence end
points in the protocol (TCC, LLC). This is not necessarily request and
for certain configurations there will be no probes required and none
will be sent. One such configuration is the GPU protocol tester which
would not require a probe to the CPU if it does not exist.

To fix this we first collect the probe destinations. Then we check if
any destinations exist. If so, we send the probe message. Otherwise we
immediately enqueue a probe complete message to the trigger queue. This
reorganization prevents messages with no destinations from being
enqueued, meeting the criteria for the assertion.

Change-Id: If016f457cb8c9e0277a910ac2c3f315c25b50ce8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55543
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-17 17:03:19 +00:00
Tiago Mück
b354e1a252 mem-ruby: Fix handling of stale CleanUnique
JIRA: https://gem5.atlassian.net/browse/GEM5-1185

Fixed an issue in which a CleanUnique responder would incorrectly
deallocate the cache block when handling an stale CU when the state
is UD_RU or UC_RU (thus incorrectly transitioning to RU).

The fix is to handle stale CUs similarly to stale WBs where we
override the dataValid TBE field to prevent the wrong state
transition.

This patch moves the stale code path to a separate transition
(similarly to stale WBs/Evicts) and moves the dataValid override to
Initiate_Request_Stale so it applies to all stale request types.
Notice now the stale field is also set on stale Comp_UC responses.

Additional minor change: CheckUpgrade_FromRU is the same as
CheckUpgrade_FromStore so it was removed.

Change-Id: I0a2cedcfde1dc30d67aa2c16d71b7470369c2b6e
Signed-off-by: Tiago Mück <tiago.muck@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56810
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: Meatboy 106 <garbage2collector@gmail.com>
2022-02-17 15:21:45 +00:00
Gabe Black
88e12c5d01 scons: Work around a SCons bug in Glob.
The recent change to add an "exclude" pattern to Glob in SCons also
seems to have triggered a bug where SCons has decided directories that
don't exist are files, and then gets upset later when we try to treat
them as directories.

To avoid that bug, and to also make recursive searching for isa parser
.py files work, we can replace the call to Glob with a loop based on
os.walk.

Also, tell the microcode assembler not to generate the parsetab.py file
in the first place. This comes with a minor performance overhead, but
shouldn't matter for us since there are *much* bigger overheads when
processing ISA descriptions.

Change-Id: Ia84e97dab72723ad3f4350798ad70178e231144c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56749
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-02-15 22:55:35 +00:00
Gabe Black
b4c285b3c0 arch-x86: Make sure the TLB checks against CS for fetches.
When instructions perform accesses, they embed the segment being used
into the request flags. When the CPU creates a request instead, for
instance when fetching an instruction, it doesn't know to do that.

This change adds a check in the TLB when makes sure CS is used when
checking a fetch, even if the flags didn't say to.

Change-Id: Ie9da3afc0b10eeb96247353150c64f1829cea41b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55247
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-15 08:54:36 +00:00
Gabe Black
15df63624b arch-x86: Add some DPRINTFs to the TLB.
These DPRINTFs are related to segmentation handling when in 32 bit
protected mode.

Change-Id: I47eb2bc834fc748b5d01d85e02ea8b3f6e03091b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55246
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-15 08:54:11 +00:00
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