Commit Graph

18755 Commits

Author SHA1 Message Date
Gabe Black
4489e37344 arch-x86: Fix writing back 32 bit PTEs in the walker.
The page table walker might need to write back page table entries to set
their accessed bits. It was already checking whether the access was 32
or 64 bit when the PTE was retrieved from the incoming packet, but was
not checking the size when it was written back out, causing an assert to
fail when working with 32 bit legacy PTEs.

Change-Id: I7d02241cad20681e6cac0111edf2454335c466fa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55808
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-14 09:55:32 +00:00
Gabe Black
5180ebc65a arch-x86: Fix a bug in the protected mode IRET.
Fix the direction of the comparison which makes sure the new RIP will
fit within the new CS limit.

Change-Id: I3f3e66c185d0e1fbc430b0ae594d63cdd62b9dfd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55887
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-14 09:54:15 +00:00
Gabe Black
fcfa1d56d3 dev,arch-x86: Change the i8042 to a normal PioDevice.
It was already acting like a normal PioDevice, but was inheriting from
BasicPioDevice and then disabling the additions that came with it.

Change-Id: I95791c200251c555ace6fe0c4297899877a94471
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55804
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-14 05:12:28 +00:00
Gabe Black
4a48b4a1d8 dev,arch-x86: Fix a panic in the i8042 device.
The write case was copied and pasted from the read case but not fully
updated.

Change-Id: I07c281a2dfab8ef957729ae2ca897e0eb91b555c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55803
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-14 05:12:28 +00:00
Gabe Black
9cfd3c8c37 dev: Add a qemu fw config item for a byte array.
This is similar to the string item, except it's easier to set up with
binary data, and harder to set up if the data is a string constant.

Change-Id: I9aa2aa223386e275308377a98bdadaf65e6cb896
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55783
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-14 03:20:47 +00:00
Matthew Poremba
45ad755511 gpu-compute: Fix default MTYPE initialization
The default MTYPE initialization in the emulated GPU driver is currently
doing a bitwise AND on an input integer param with other integers
instead of using a bitmask. Change this to use bitset and test the bit
positions corresponding to the values in the MTYPE enum that were
previously being used as an operand for bitwise AND.

This was causing invalid slicc transitions in some benchmarks for
combinations of request type and mtype that are undefined.

Change-Id: I93fee0eae1fff7141cd14c239c16d1d69925d08d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56367
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-13 21:50:21 +00:00
Matthew Poremba
1cf1f98c1a configs: Make VIPER memory MessageBuffers ordered
The VIPER configuration uses the MOESI_AMD_Base protocol's directory.
This protocol does not wait for memory ACKs. As a result, this can lead
to read requests being pulled out of the MessageBuffer between the
directory and DRAMCtrl before a write request to the same address. This
leads to inconsistent data. To fix this, make the MessageBuffers
ordered. Since these MessageBuffers are essentially just an interface
between SLICC and DRAMCtrl, and DRAMCtrl can reorder requests properly,
this should not cause any large impact on performance due to the
constraint.

Also remove the duplicate instantiation of these MessageBuffers.

Change-Id: I59653717cc79884e733af3958adfc14941703958
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57411
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: 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-03-13 15:31:32 +00:00
Matthew Poremba
20d8b388ad mem-ruby: Enhance MOESI_AMD DmaWrite
This enhances MOESI_AMD_Base-dir DmaWrite to enable partial writes. This
is currently done by assuming a full cache line, invalidating caches,
and transitioning back to unblocked state. The enhanced write supports
partial writes (i.e., smaller than cache line size) by first reading
memory, merging the modified data, and then writing back to memory.
Implementation of this mirrors that of DmaRead in terms of state. This
means for each DmaRead state (BDR_PM, BDR_Pm, and BDR_M) there is a
write analogue (BDW_PM, BDW_Pm, and BDR_M) and the BDR_P state is
removed. Furthermore, this enhanced DmaWrite ... actually writes data to
memory instead of relying on DirectoryEntry / backing store for correct
data.

There are two possible state transitions for DmaWrite now. (1) Memory
data arrives before probe response and (2) probe response arrives before
memory data. In case (1), probe data overwrites memory data and merges
the partial write using the TBE write mask then updates write mask to
'filled' state. In case (2), probe data is merged with the partial data
using the TBE write mask then updates write mask to 'filled' state. The
memory data will then be clobbered by copying the TBE data over the
response since the write mask is now full.

Change-Id: I1eebb882b464c4c5ee5fd60932fd38d271ada4d7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57410
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: 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-03-13 15:31:32 +00:00
Matthew Poremba
bfcab1258f mem-ruby: Remove DataBlk from MOESI_AMD DirectoryEntry
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.

Change-Id: If2e52151789ad82c7b55c8fa2b41c1f4e5b65994
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57409
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-13 15:31:32 +00:00
Gabe Black
3a950f0345 arch-x86,dev: Make the I8259::getVector method protected.
Now that the I8259's vector is reported using a special memory access,
the getVector method doesn't need to be accessible outside of the class.
It's still useful internally though, since it nicely encapsulates what
should happen when an INTA signal is received.

Change-Id: I7da7c1f18fac97ffc62c965978f53fb4c5430de3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55698
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-12 04:22:48 +00:00
Gabe Black
ddfee10218 arch-x86,dev: Use default initializers in the I8259.
There were several uninitialized members in the I8259 class. Set default
initializers for everything, instead of relying on the constructor which
might miss something which isn't immediately obvious.

Change-Id: Ifaf99e81fd64bbf28fc9ed6cd3de54c445435fa1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55697
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-12 04:22:48 +00:00
Gabe Black
e62c0a6df3 arch-x86: Implement the LINT0 pin for the LAPIC.
This pin should be connected to the master I8259 output which is used to
bypass the IOAPIC when it is disabled and the local APIC is in virtual
wire mode. This is how the system is supposed to start, and can later be
switched into symmetric multiprocessing mode later on by an SMP aware OS
(most of them). Only the BSP should have it's LINT0 pin connected to the
I8259, since I8259 type interrupts are only usable by a single CPU at a
time.

Change-Id: I0e3e3338f14d384c26da660cf54779579eb0d641
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55696
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-12 04:22:48 +00:00
Gabe Black
db76b935eb arch-x86,dev: Use INTA to get the vector for the IO APIC.
When receiving an ExtInt at the IO APIC, use an INTA and not a direct
pointer to find the vector to use.

Change-Id: I173f99645c3bbd20de9cbeb17e00b4f91ac66089
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55695
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-12 04:22:48 +00:00
Gabe Black
38bb440383 arch-x86,dev: Add an INTA like transaction for I8259.
In a real system, once a CPU receives an interrupt of type ExtInt, it
will send an INTA message out to the I8259 sytle interrupt controllers
to read the vector for that interrupt. In ye-olden-times, that would
literally mean the I8259 would be in charge of the bus and would write
the eight bit vector for the CPU to read. In more modern systems, the
vector is transported on the system interconnect using a special
message.

To better approximate a real system, and to make the interrupt
controllers more modular and agnostic (so the IO APIC doesn't have a
I8259 pointer within it, for instance), this change adds a new special
address which the I8259 can respond to on reads which will act as if it
received an INTA message, and the read data will be the interrupt
vector.

Only the master controller, or a single device, will respond to this
address, and because of its value and the fact that it's beyond the end
of the 16 bit IO port address space's effective range but still within
it, that address won't be generated by any other activity other than
possibly a bogus address.

Also by putting the special address in the IO port address space, that
will make it easier to ensure that it's within the range of addresses
which are routed towards the I8259 which operates off the IO port bus.

This address is not yet actually used by the IO APIC or local APIC but
will be shortly.

Change-Id: Ib73ab4ee08531028d3540570594c552f39053a40
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55694
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-12 04:22:48 +00:00
Gabe Black
64d1297d86 scons: Move the build of ext/ into the variant dirs.
These are no longer split out and shared in the root build/ directory.
This does result in a small amount of overhead from building redundant
copies of these files, although the overhead is not significant. When
building 7 different variants of gem5, all the ISAs and NULL, the
difference on my machine was:

Before:
real    41m25.372s
user    914m22.266s
sys     41m51.816s

After:
real    42m38.074s
user    921m36.852s
sys     43m2.949s

This is about a 2-3% difference, which is a worse than typical case,
since the overhead scales with the number of variants being built.

The benefit of pulling ext/ into the variant directory is that there can
now be a single config which applies to all files used to build gem5,
and that config is represented by the variant of gem5 being built.

Change-Id: I6f0db97c63a7f3e252e7e351aa862340978e701b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56750
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-03-11 22:54:16 +00:00
Gabe Black
e55ae49e96 arch-x86: Use inline initializers for members of Interrupts.
Use initializers within the body of the Interrupts class, instead of
listing them in the constructor.

Change-Id: Ia33aa77066cedabcc1c3610fefac653ff2f56f6c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55693
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-03-11 22:50:35 +00:00
Gabe Black
a0fcc297e3 arch-x86: Subtract the base from the PC when entering faults.
The PC value is put in t7, but for that to be consistent with the way
microcode usually sees and interacts with the PC, it needs to have the
CS base value subtracted from it first. Otherwise the base could be
added into new PC values twice.

Change-Id: I8a8c5bc1befd9a89e6735981fd2fc69a702fdc68
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55690
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-03-11 22:50:10 +00:00
Gabe Black
0d1bca9e21 arch-x86: Get rid of the soft int Fault class.
This was never instantiated, and not fully implemented.

Change-Id: I2011e49345e48e194ed9f1540446f0f5a699401d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55689
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-03-11 22:49:50 +00:00
Gabe Black
ba82b56193 dev,arch-x86: Create an x86 QEMU fw cfg, and an E820 entry type.
The x86 version is basically just a specialization of the base IO port
version of the QEMU firmware configuration device, with the port
addresses set for x86.

The E820 entry type is x86 specific, and is a way to pass an E820 memory
map to firmware which doesn't have another way to figure out where
memory is. This would be for firmware like SeaBIOS which is itself
responsible for publishing an E820 map, but it needs somewhere to get
that information from in the first place. This mechanism is one it
supports natively.

This entry type reuses the E820Entry SimObjects which were defined a
long time ago for passing to a Linux FS workload. It doesn't use their
ability to write themselves out to guest memory, and just uses them as a
transport for their address, size and type properties.

Change-Id: Ifff214f5fc10bd7d0a2a0acddad4fc00dd65f67d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55628
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-03-11 22:49:28 +00:00
Gabe Black
971ee4aded arch: Update the default "func" value in the ISA parser.
Now that there is a unified (get|set)RegOperand accessor for all
register based operands, that can be used as a reasonable default in the
ISA parser code.

Change-Id: Icef62aa6c16fb8b929ee0fa0d60b23553e0bf515
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49735
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-11 08:39:07 +00:00
Gabe Black
2a525325df arch: Delete now unused operand types.
These have been subsumed into the RegOperand type, and are fronted by
the *RegOperandDesc OperandDesc classes.

Change-Id: If57b683b06f3002004863c2d74f2a645882fbd41
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49734
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-11 08:38:54 +00:00
Gabe Black
ae8e8e2d3c arch: Pass through the actual base class in OperandDesc.
Rather than pass through part of the base class name, we can pass
through the actual base class and remove some unnecessary historical
complexity.

Change-Id: I77edc07b54b264254700fb9c26b8c9b626709779
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57449
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-11 08:38:35 +00:00
Gabe Black
1856bec959 arch: Remove support for lists in def operands.
Change-Id: I4e9f4e0ff215a60443d408c0b8d53f1ff450a784
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49733
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-03-11 08:38:21 +00:00
Gabe Black
7103088310 arch-sparc: Use the OperandDesc classes in the ISA description.
Change-Id: I784ece5697c3b161a94f3eacbc3d175a1434ae2e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49732
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Boris Shingarov <shingarov@labware.com>
2022-03-11 08:38:00 +00:00
Gabe Black
abdf573c53 arch-power: Use the OperandDesc classes in the ISA description.
Change-Id: I7c46d97f581cd114dcdc8061fa555d5ac927aa2c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49730
Reviewed-by: Boris Shingarov <shingarov@labware.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-11 08:37:42 +00:00
Gabe Black
d6905bb6d0 arch-mips: Use the OperandDesc classes in the ISA description.
Change-Id: I79c1246a352125313841f1e3d674374352803af6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49729
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Boris Shingarov <shingarov@labware.com>
2022-03-11 08:37:26 +00:00
Gabe Black
7f525d4690 arch-arm: Use the new OperandDesc classes in the ISA description.
Change-Id: Ifacfdfb69014becae66f7497230cc8333950ddd9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49728
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-10 22:34:30 +00:00
Gabe Black
a118361e46 arch-riscv: Use the OperandDesc classes in the ISA description.
Change-Id: I1316dcc628bb634549a626ca244a62aa9f76638c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49731
Reviewed-by: Luming Wang <wlm199558@126.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-10 21:53:07 +00:00
Gabe Black
988f7573f6 arch: Create a new operand desc type which takes a class as a parameter.
This will be the basis for an operand type which can override its
register class if needed.

Change-Id: I415b70d6d655efc9f6b32102a8482e2cca2fa613
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49727
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-10 21:52:18 +00:00
Gabe Black
9993440a8e arch-x86: Use the new operand desc classes in the ISA description.
Take advantage of the ability to use keyword arguments to clarify the
complex predicated condition code operands.

Change-Id: I7cbbd547c4eadb0b170e473c034c062125301fad
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49726
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-03-10 21:51:53 +00:00
Jui-min Lee
23e6607507 mem: Fix phy mem with shm and multiple abstr mem
Previously, all abstract memory backed by the same physical memory will
use the exact same chunk of shared memory if sharedBackstore is set. It
means that all abstract memories, despite setting to a different range,
will still be map to the same chunk of memory.

As a result, setting the sharedBackstore not only allows our host system
to share gem5 memory, it also enforces multiple gem5 memories to share
the same content. Which will significantly affect the simulation result.

Furthermore, the actual size of the shared memory will be determined by
the last backingStore created. If the last one is unfortunately smaller
than any previous backingStore, this may invalid previous mapped region
and cause a SIGBUS upon access (on linux).

In this CL, we put all backingStores of those abstract memories side by
side instead of stacking them all together. So the behavior of abstract
memories will be kept consistent whether the sharedBackstore is set or
not, yet presist the ability to access those memories from host.

Change-Id: Ic4ec25c99fe72744afaa2dfbb48cd0d65230e9a8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57369
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>
2022-03-10 05:59:56 +00:00
Gabe Black
288e5c47fa mem: Create a SysBridge object to bridge between Systems interconnect.
It's possible to bridge together the memory interconnect of two
systems, either as parallel peers, or one nested inside the other. Each
System will have its own set of RequestorIDs, and using an ID from one
System inside the other can lead to a number of different problems.

This change adds a new SimObject called SysBridge which connects two
Systems interconnect together. The object allocates a requestor ID in
each system, and for all PacketPtrs passing through it, the requestor
ID from the target system is installed in the associated Request. On
the way back, either inline or in a split, delayed response, the
original RequestorID is restored by reinstalling the original Request
object.

Change-Id: I237c668962a04ef6dfc872df16762a884c05ede9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/54743
Reviewed-by: Jesse Pai <jessepai@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-10 04:03:39 +00:00
Bobby R. Bruce
14b60f4c39 stdlib: Cache the resources.json download
"resources.json" is referenced when a resource is requested. The
"resources.json" file may be updated at any time and therefore, the
downloader was engineered to retrieve this file from the gem5-resources
repo on each request. However, this can lead to excessively frequently
pulls over short periods of time which is uncessary given how
infrequently this file changes.

To combat this, this patch caches the "resources.json" file and will
use it for up to an hour after creation before re-retrieving it.

Change-Id: I3b4907cbadce8a54df21d85f8021bf3603ae0f6f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57275
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-09 19:34:38 +00:00
Bobby R. Bruce
02f22d65a7 stdlib: Update the downloader to retry on failure
On occasion HTTP status codes, such as 429, are returned when
downloading the resources and/or the "resources.json" file. In such
cases it makes sense to retry the download.

This patch adds a Truncated Exponential Backoff algorithm to the
downloader to retry downloads, with a default maximum of 6 attempts.
This is done in cases where HTTP status codes 408, 429, and 5xx are
returned.

So this feature is applied to both the retrieval of the resources and
the "resource.json" file, the downloading of the "resources.json" file
has been modified to utilize the `_download` function as is used to
download resources

Change-Id: Ic4444b52f0f71d294fccec9de3140beece5f7576
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57274
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-09 19:34:38 +00:00
Giacomo Travaglini
fc59c6e4e8 arch-arm: Create a magic PendingDvm operand
JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: I38be0becc167d4d9764091aa46245508a0cc1ca4
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56602
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-09 10:47:16 +00:00
Samuel Stark
5b76001b54 arch-arm: Add helper MISCREG to track a pending DVM operation
We are introducing the MISCREG_TLBINEEDSYNC misc register to track
the presence of a pending DVM (TLBI) operation.

It will be used by:

* TLBI instructions: setting up the flag to indicate there
is a pending DVM message

* DSB instruction: clearing the flag indicating the DVM
messgage has been syncronized

Change-Id: I7a599ada5a6ac6f86ed2260caa872f085c889ab5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56601
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-09 10:47:16 +00:00
Samuel Stark
139f635bde cpu: Allow TLB shootdown requests in the o3 cpu
JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: Ie698efd583f592e5564af01c2150fbec969f56a2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56600
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-03-09 10:47:16 +00:00
Samuel Stark
9dfac01243 cpu: Allow TLB shootdown requests in the timing cpu
JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: Ied38e9ed1f02d8e48bc5d62cc34baaec740bf6b8
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56599
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-09 10:47:16 +00:00
Samuel Stark
de9cdc28ce cpu: Rename initiateHtmCmd to be more generic
To prepare for future CHI work, rename ExecContext::initiateHtmCmd to
ExecContext::initiateSpecialMemCmd

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

Change-Id: I7c7aed8ec06a66d9023c14dba37eae42907df222
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56598
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-03-09 10:47:16 +00:00
Gabe Black
a84c987eef arch: Add desc subclasses for the various operand types.
These correspond to the existing operand types like IntRegOperand, or as
it's called in the operand table 'IntReg'. These subclasses
automatically set the base type name ('IntReg' for IntRegOperands),
which results in some mildly more familiar looking syntax, but is still
not that different from what we have today.

Change-Id: Id77c4e5a5e1b93c10aa9ad85e1a615f6c145832a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49725
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-09 02:54:23 +00:00
Gabe Black
4a3a1b92b4 arch: Put operand properties into an object constructed with the list.
Currently, to specify operands for an ISA, you define a dict from
operand names to properties in the ISA description. The properties are
in a list which has well defined positions for each entry, some of which
are optional.

These lists are fairly opaque since they don't have any way to, for
instance, accept keyword arguments. Also, these specifications simply
list as their first element what type of operand they're going to be.

This change is the first step in turning these specifications into
something more robust like a small temporary object. This object can be
constructed from a class which has a proper constructor that can take
keyword arguments, can have defaults, and can be subclassed.

Change-Id: I5f24d0b41f3e30b24a1ddd10157965d700d6c906
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49724
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-08 21:47:33 +00:00
Gabe Black
38e06033fa arch: Consolidate most of the RegVal based operands into a base class.
All the RegVal based operands except MiscRegs are consolidated, and
those classes are almost all consolidated, except for the RegClassType
they use.

Change-Id: I8494c7066e9d19411fd97d7cc5ac2078f799c2ac
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49723
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-08 21:47:11 +00:00
Giacomo Travaglini
650cee911c dev: Fix -Werror=unused-variable in QEMU config device
Same issue as:

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

Change-Id: Id33a1131a70136a2435f733295fa97a44ee70496
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57349
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-07 15:53:58 +00:00
Jui-min Lee
38abefd9d3 systemc: Fix memory leak of sc_event_list
Make SensitivityAnd/OrList class track the sc_event_and/or_list and
delete it when the Sensitivity object itself is deleted.

Bug: 222177290
Test: Run gem5 unittests, presubmits, and systemc unittests
Change-Id: Ib46f8dfb6727f77ad843ba33ce22c7e6d2645ff2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57329
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-07 10:51:47 +00:00
Giacomo Travaglini
2fcb7ae87e configs: Add O3 option in starter_fs.py and ruby_fs.py
Change-Id: I2d59d15cb8acdd7b2675653335af879e35b0d6b3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57273
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Richard Cooper <richard.cooper@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-07 09:06:23 +00:00
Gabe Black
f161c0b6bc dev: Add a base QEMU firmware config device.
This artificial device is provided by QEMU inside their emulated
machines to feed extra configuration information to the system firmware,
or even to the operating system if it chose to use it. The behavior of
this device is explained in the docs/specs/fw_cfg.txt file in the QEMU
source.

This implementation currently supports the traditional interface, and
does not support the DMA based interface, although it probably wouldn't
be that hard to expand it to in the future.

The interface exposes individual entries which can optionally (and
usually) have paths associated with them that you can look up in a
directory type entry which has a fixed index. There are some entries
which are built into the device itself, which are the ID, signature and
directory entries, but the rest can be set up in the config scripts.

To make it easier to add new entries which are not from config scripts,
aka the ones that are hard coded in C++ and built into the device, the
actual entries themselves are not SimObjects, but it's easy to create a
SimObject wrapper which will spit them out for the device to consume.
Other items can be added to the device manually without generating them
with SimObjects.

Entries can have fixed or automatically generated indices. All entries
have a "path" in the sense that they have a name, but as a minor
deviation from what the QEMU documentation says, a "path" which begins
with a "." is not exported in the directory. This is purposefully
reminiscent of the unix style hidden file mechanism, where files or
directories who's names begin with "." are not normally shown by ls.

There are two different styles of this device, one which is IO port
based, and one which is MMIO based. Which to use depends on the
architecture, where x86 currently uses the IO scheme and ARM uses the
MMIO scheme. The documentation doesn't say what other ISAs use, if any
other ones support this interface, but I'd assume the MMIO version.
These are split out because the rules for how they work are subtly
different, but they share a lot of common machinery under the hood.

In most cases where somebody tries to talk to the device in an unusual
way, for instance accessing a register with an incomplete width or at an
offset, the device will just report all zeroes. The behavior in those
cases isn't specified, in many cases doesn't make sense based on the
design of the device, and doesn't seem to be depended on in the limited
use case I looked at.

Change-Id: Ib81ace406f877b298b9b98883d417e7d673916b5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55627
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-03-05 04:40:24 +00:00
Gabe Black
cbc55aeff0 arch-x86: Fix the immediate size for the 0x9a one byte opcode.
This is a far call direct, which has a far pointer (a 16 bit segment
selector and a 16 or 32 bit offset) as an immediate value. The gem5
decoder was expecting no immediate, and so was not gathering one. The
actual microcode for the instruction was taking the junk immediate and
trying to use it which did not work.

This change makes a small update to the table which says how big the
immediate values are for various instructions, changing the entry for
one byte opcode 0x9a from 0 (no immediate) to PO (pointer sized). The
immediate size will be automatically selected by the decoder based on
the PO rule, and the currently active operand size.

Change-Id: Ic290e7bb01dc6165c4eabed214887e4b5adb42da
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55626
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-03-05 04:40:07 +00:00
Gabe Black
e04d40828c arch-x86: Don't decode SIB bytes in 32 bit mode.
There was a comment there saying we shouldn't, but then we still did
anyway.

Change-Id: I4a53cf504d38e00fca5d687818149b91354e640d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55593
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-03-05 04:39:51 +00:00
Gabe Black
94bb3291fa arch-x86: Truncate RIPs properly in the wrip microop.
For all instructions which affect the RIP, they are supposed to
truncate/zero extend the RIP based on the width of the instruction. We
should do that after the target is calculated by adding the two operands
together, but before adding in the segment base address.

Change-Id: I105e58de6a07c7aa3155a9a188d8877c2955651f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55592
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-03-05 04:39:38 +00:00
Gabe Black
911a8762e8 arch-x86: Correct how default segments are handled.
The stack segment is the default for instructions that use rSP or rBP in
their address calculations at all, except if they're used as a base.
Even though the wording in the AMD manual is a bit misleading, the
presence of a displacement does not make the default DS.

Also, allow segment override prefixes even if the default is SS. If an
instruction *must* use SS (like push or pop) it will have explicitly
specified that in the microcode.

Change-Id: I73c6e367440a664c5c7c483337c16d4ab14f0e34
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55589
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
2022-03-05 04:39:17 +00:00