Commit Graph

18803 Commits

Author SHA1 Message Date
Matt Sinclair
a8aa175c7f configs, gpu-compute: change default GPU reg allocator to dynamic
The current default GPU register allocator is the "simple" policy,
which only allows 1 wavefront to run at a time on each CU.  This is
not very realistic and also means the tester (when not specifically
choosing the dynamic policy) is less rigorous in terms of validating
correctness.

To resolve this, this commit changes the default to the "dynamic"
register allocator, which runs as many waves per CU as there are
space in terms of registers and other resources -- thus it is more
realistic and does a better job of ensuring test coverage.

Change-Id: Ifca915130bb4f44da6a9ef896336138542b4e93e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57537
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-03-19 05:25:05 +00:00
Matthew Poremba
f64f05eff6 arch-vega: Mark global instructions executed as global
The executed_as field is currently not set for global memory
instructions. This results in the default of SC_NONE, causing the status
vector to be all zeros. The GM pipe sees this and completes the
instruction immediately rather than issuing memory requests. This is
fixed by marking the instruction as executed as SC_GLOBAL always. Flat
instructions use resolvedFlatSegment for this, however since global
instructions are known to be global we can set this field directly. This
results in the expected issuing of memory requests to GPU memory.

Change-Id: Ic23102853ccd49a41e2f083b7bb24f033dfed18a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57829
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 22:44:28 +00:00
Gabe Black
72d67e6426 arch-vega: Replace deprecated Stats namespace recently reintroduced.
The deprecated "Stats" namespace was recently reintroduced to the vega
TLB code. Replace it with the new statistics namespace.

Change-Id: Ie5daf288176ce7e8aadd27b84a70baf4cbc72dff
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57949
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Matthew Poremba <matthew.poremba@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 20:19:37 +00:00
Bobby R. Bruce
cfcb63d768 tests: Add KVM Tests to the nightly run
Unfortunately due to restrictions with Docker, we cannot run KVM tests
within a Docker container. As such we have elected to run them on the
host system in this instance.

Change-Id: I751903512eaba9d0e51732228a0706725e82295e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56831
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-03-18 18:16:09 +00:00
Bobby R. Bruce
78a9e772ca tests,ext: Fix so ex/include regex are applied after defaults
The seldom used '--include-tags' and '--exclude-tags' flags allows a
testing user to remove and include tags from the search used by TestLib
to select tests. For example, by default the 'quick' tag is included as
part of the search of tests to run. The '--exclude-tags' flag could then
be used to remove the 'quick' tags from the search.

The TestLib framework was applying the regex these flags input before
the default flags. This meant if the user wished to remove a flag, it
was impossible. This is now applied after.

Change-Id: I569e0f8d6093ff5e5cdc76faff89c15e75ff297a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56830
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-18 18:16:09 +00:00
Bobby R. Bruce
2f48aa9e5c tests: Add 'kvm' tag to tests
Some of our tests require KVM. Tagging these tests as such allow us to
filter them in or out during testing.

Change-Id: I3f188d3e268409535043cc32b64d99e4657638cd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56829
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 18:16:09 +00:00
Giacomo Travaglini
d7854cce3b arch-arm: Implement DSB Shareable as a DVM op
JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: I52c965817dd9d70feca31d1ec2981ad3a090e6a3
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56607
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 12:01:23 +00:00
Giacomo Travaglini
d2910d68c1 arch-arm: Implement TLBI Shareable as a DVM op
JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: Ie0a374abce41997af600773cc270a47cdf2c1338
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56606
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 12:01:00 +00:00
Giacomo Travaglini
dbc91308c7 arch-arm: Add warning when DVM is enabled in the decoder
DVM Ops instructions are micro-architecturally modelled as loads. This
will tamper the effective number of loads stat, so a user should
be careful when interpreting stat results

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

Change-Id: I526cd542ef804111cf6919359c1ce02df6d4710d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56605
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 12:00:08 +00:00
Giacomo Travaglini
8a505bb615 arch-arm: Add DVM ISA templates
These will be used by DVM instructions:

* TLBI Shareable
* DSB Shareable

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

Change-Id: I32f83e08360ceb7ba324d07c72fe6addeb4bbbca
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56604
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 11:59:18 +00:00
Yu-hsin Wang
cf52f99d9c fastmodel: Upgrade to FastModel 11.17
The first big change is gcc-6.4 is no longer supported in FastModel
11.17. We switch to gcc-7.3. Next, TARGET_MAXVIEW is
replaced by TARGET_SYSTEMC_MAXVIEW. The default value of
TARGET_SYSTEMC_MAXVIEW is zero. So we can simply remove TARGET_MAXVIEW.
Finally, I fixed an undefined exception in the build script.

Change-Id: I5ec70112056513c253e6127ed5f8abacf191431f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57549
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 02:22:29 +00:00
Yu-hsin Wang
6730d60fd1 fastmodel: CortexA76 fix missing registers for FastModel 11.17
Change-Id: I1f6e2e92b91d0fe361a5ea88542a1e095a9f357b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57629
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 02:22:29 +00:00
Earl Ou
75f7bbe904 fastmodel: CortexA76 fix missing registers for FastModel 11.16
Change-Id: Id6bfa1c374e9c9e65f2c234654f87567d2b29c09
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/52543
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-18 02:22:29 +00:00
Gabe Black
218d6b239d arch: Add some indirection for Operand RegId generation.
That introduces a place to hook in to override what actual register
index is passed to the rest of gem5.

Change-Id: I77d778849410ee5d32bab669bba411e80603a002
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49739
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-17 20:50:19 +00:00
Gabe Black
93b7c8c321 arch: Consolidate "op_idx" generating code.
Change-Id: I6c715d8931b7943c798674c19a1e7307d0e182be
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49738
Maintainer: Gabe Black <gabe.black@gmail.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-17 20:49:47 +00:00
Matthew Poremba
7337b7611d dev-hsa: Update HSA queue tracking for FS mode
In FS mode offsets for HSA queues are determined by the driver and
cannot be linearly assigned as they are in SE mode. Add plumbing to pass
the offset of a queue to the HSA packet processor and then to HW
scheduler.

A mapping to/from queue ID <-> doorbell offset are also needed to be
able to unmap queues. ROCm 4.2 is fairly aggressive about context
switching queues, which results in queues being constantly mapped and
unmapped.

Another result of remapping queues is the read index is not preserved in
gem5. The PM4 packet processor will write the currenty read index value
to the MQD before the queue is unmapped. The MQD is written back to
memory on unmap and re-read on mapping to obtain the previous value.
Some helper functions are added to be able to restore the read index
from a non-zero value.

Change-Id: I0153ff53765daccc1de23ea3f4b69fd2fa5a275f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/53076
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-17 14:35:35 +00:00
Jui-min Lee
667308ae7f mem: Add option to remove shared memory at the end
Add a new option `auto_unlink_shared_backstore` to System so it will
remove the shared backstore used in physical memories when the System is
getting destructed. This will prevent unintended memory leak.

If the shared memory is designed to live through multiple round of
simulations, you may set the option to false to prevent the removal.

Test: Run a simulation with shared_backstore set, and see whether there
    is anything left in /dev/shm/ after simulation ends.
Change-Id: I0267b643bd24e62cb7571674fe98f831c13a586d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57469
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-17 01:29:54 +00:00
Matthew Poremba
539a2e2bcd arch-vega: Add VEGA page tables and TLB
Add the page table walker, page table format, TLB, TLB coalescer, and
associated support in the AMDGPUDevice. This page table format used the
hardware format for dGPU and is very different from APU/GCN3 which use
the X86 page table format.

In order to support either format for the GPU model, a common
TranslationState called GpuTranslation state is created which holds the
combined fields of both the APU and Vega translation state. Similarly
the TlbEntry is cast at runtime by the corresponding arch files as they
are the only files which touch the internals of the TlbEntry. The GPU
model only checks if a TlbEntry is non-null and thus does not need to
cast to peek inside the data structure.

Change-Id: I4484c66239b48df5224d61caa6e968e56eea38a5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51848
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-17 00:11:14 +00:00
Matthew Poremba
7cfe88df74 mem: Add system request flag for dGPUs
dGPUs can translate a virtual address and will not know if the address
resides in system/host memory or device/dGPU memory until the
translation is complete. In order to mark requests as going to either
system memory or device memory we add a field to the Request class.

Change-Id: Ib1e80e8d03ecdfeb11c24d979ccc4b912ce07f91
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/51852
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Maintainer: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
2022-03-17 00:11:14 +00:00
Giacomo Travaglini
5cca0bbe8a arch-arm: Fix setup of ESR.IL field
The ESR.IL field (Instruction Lenght) is set to 0 if the exception
has been triggered by a 16-bit instruction (Thumb) and 1 otherwise.

Current implementation has been implemented more or less correctly
for AArch32 but not for AArch64; by doing:

if (to64) {
    esr.il = 1;
} ... [AArch32]

We are directly setting ESR.IL to 1 in case the exception is taken in
AArch64 mode. This is not covering the case of a thumb instruction
faulting to AArch64.

We are fixing this by defining a virtual method returning the ESR.IL
bitfield depending on the exception cause/type. This is following
the Arm Architectural Reference Manual, which states ESR.IL bit should
be set to 1 for 32-bit instructions and for cases where the fault
doesn't really depend on the instruction:

* SError interrupt
* Instruction Abort exception
* PC alignment exception
* SP alignment exception
* Data Abort exception for which the value of the ISV bit is 0.
* Illegal Execution state exception.
* Debug exception except for Breakpoint instruction exceptions
* Exception reported using EC value 0b000000.

Change-Id: I79c9ba8397248c526490e2ed83088fe968029b0e
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57570
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 22:47:25 +00:00
Giacomo Travaglini
6a6045b7f5 arch-arm: Fix coding tyle of faults.{cc,hh}
Change-Id: Iaf7858ab08fc858b7c2f932240e24657dc48bbe4
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57569
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 22:47:25 +00:00
Giacomo Travaglini
01eebd2aad arch-arm: Define ESR.ISS field as a SubBitUnion
This will make it easier for an ArmFault to setup the ISS
field of the syndrome register

Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Change-Id: I970dfea474f2de0a696bef27712bc42daed9f1a0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57489
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 22:47:25 +00:00
Gabe Black
8618dd8ae7 scons: Turn all global sticky variables into variant ones.
Saved option files are processed twice, once to load the value of the
EXTRAS variable, and then again once variables have been set up by
SConsopts.

Change-Id: Id8d49051c8fe684142a68259c470ed7c86bdab53
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56753
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 21:11:48 +00:00
Gabe Black
274042a362 arch: Add an "as" template to dummy vec regs.
Keep the unit tests compiling until the generic dummy vec and vec pred
regs are unnecessary and are eliminated.

Change-Id: I65d99cd3f4c41e89834b71a8af90872d8d5a4590
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57749
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-03-16 15:02:44 +00:00
Gabe Black
1dad34a403 arch: Eliminate the "func" parameter to build(Read|Write)Code.
The correct accessor is well known by the code providing a template for
buildReadCode/buildWriteCode, and so can be simply inserted without the
indirection. This makes the code a little easier to read, and those
templating functions simpler and easier to understand.

Change-Id: I403c6e4c291708f8b58cce08bfa32ee2a930c296
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49737
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 08:58:38 +00:00
Gabe Black
543035e90d arch: Disable unused read/write code overrides in the ISA parser.
Some operand types had read/write code overrides, I think largely by
pattern matching other operand types, and not because that code was
actually expected to be used or to work. Instead, we should just assert
that that code isn't used and remove the implementation. This method of
affecting reading and writing code is going away anyway, and if this is
needed in the future it can be replaced in the new system.

Change-Id: Idae886153aa343570109069cbe54e2c1699a34e5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49736
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 08:58:22 +00:00
Hoa Nguyen
2bd99f141e util-docker: Add docker container for building riscv target
This container comes with LLVM/Clang riscv cross-compiler
with linker, libraries, and libc headers from
riscv-gnu-toolchain[1].

Adapted from [2].

[1] https://github.com/lowRISC/riscv-llvm
[2] https://github.com/sifive/riscv-llvm/blob/dev/README.md

Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Change-Id: I0bc310e1ae3ca9257fbde95a864c2b48009cd897
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57609
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-16 02:12:05 +00:00
Samuel Stark
e41323fb93 mem: Add TlbiExtSync packet type
JIRA: https://gem5.atlassian.net/browse/GEM5-1097

Change-Id: I45435326daca599ac973c747777ecac52bf7fd33
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57290
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-15 16:20:49 +00:00
Samuel Stark
d64a2ba541 mem: Add external TLBI flags to the Request object
* TLBI_EXT_SYNC: This flag tells the CPU model that a
remote TLBI Sync has been requested

* TLBI_EXT_SYNC_COMP: This flag tells the interconnect that a
remote TLBI Sync request has completed

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

Change-Id: I459d22f112038cc1427e24999904ba74c1c08cfb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57289
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-15 16:20:26 +00:00
Giacomo Travaglini
ee8279b719 arch-arm: Add DVM enabled flag in the Decoder class
This is needed as the decoder needs to choose whether to
instantiate a DVM (treated as IsLoad) instruction when
decoding a TLBI/DSB Shareable, or to issue a simple system
instruction in case DVM messages are not modelled in the
simulated system.

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

Change-Id: I9f46304dee63851caec809a5c6b8e796d684cc05
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56603
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-15 16:19:10 +00:00
Gabe Black
0eef985373 arch-x86: Specialize some instructions for virtual 8086 mode.
Some instructions behave in special ways in virtual 8086 mode. In some
cases, that means that they behave like they do in real mode, even
though the CPU has protected mode enabled. In other cases, it means that
there are extra checks, or even very different behaviors, which help
virtualize the system for the 8086 programs.

Change-Id: I70723b38ea0a7625c4a557bf4dd8f044e5715172
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55809
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-15 07:03:48 +00:00
Gabe Black
cc07c6d2f3 dev: Implement PS/2 keyboard echo and set scan code commands.
Don't actually let anyone set a scan code set other than 2, since that's
all our converter knows about. It's probably all anyone will want
anyway.

Change-Id: Ief2f35448adc80e30e8fdf13ef9d64d6f19447eb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55807
Reviewed-by: Matthew Poremba <matthew.poremba@amd.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-15 06:54:31 +00:00
Gabe Black
06117275fa scons: Make all sticky variables automatically exported.
All sticky vars are exported, but not all exported vars are sticky. The
vars which are exported but not sticky are (at least in general) found
with Configure() style measurement.

Change-Id: Idebf17e44c2eeca745cdfdd9f42eddcfdb0cf9ed
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56891
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-03-15 00:45:30 +00:00
Gabe Black
443067253c ext,scons: Make kconfiglib available for use in SCons.
Change-Id: Ie9c902819ed0750a04f8318911fa914701c2a0fe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56755
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
2022-03-15 00:30:39 +00:00
Gabe Black
f847b4a5e9 arch: Make the DummyVec... types the same size as RegVal.
This makes RegClass-es which don't specify a size work with the Dummy
types of VecRegContainer and VecPredRegContainer, and avoids having to
set up extra plumbing in ISAs that don't need it.

Change-Id: I059306a54b2a9cf7a22258a01e0821e370f0590a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56929
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-03-14 23:54:16 +00:00
Gabe Black
da290e9e2e arch-x86: Fix the SAHF and LAHF instructions.
These had been transposed with each other, and had other problems having
to do with data truncation and old bits leaking through into other
registers.

Change-Id: Ib46eaa201d4b8273a683ebcb0060e8d49c447d96
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55824
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 23:44:18 +00:00
Gabe Black
9d3cd97920 scons: Turn a lot of compiler flag vars into env vars.
These are used to adapt gem5 to the system it's being built on, and so
should be attached to the host via the environment rather than gem5's
configuration.

Change-Id: I2adfe1af484dcdeae32a48097d9aa87752a7ed2a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56752
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-03-14 21:06:46 +00:00
Gabe Black
a8602e3b63 scons: Process the SConsopts files for each variant.
The SConsopts files that need to be processed is affected by the EXTRAS
setting, and if all settings are going to be local to the variants, that
means each variant can have a different set of SConsopts files to use.

This does result in Configure type output showing up repeatedly when
building multiple variants, but that's uncommon for users, and will
hopefully become unnecessary for developers over time.

Change-Id: I7df287c37fc32e91576dced80d0a9e56806c4581
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56751
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
2022-03-14 21:06:46 +00:00
Gabe Black
ccb5f8f8b3 dev,arch-x86: Implement some self test 8042 commands.
The self test in particular is used by bare metal software to ensure
that the keyboard controller is reset and ready to use.

Change-Id: I53c2a80c181b9d19617c75657637e06951c94433
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55806
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 16:53:14 +00:00
Gabe Black
e1e261c1d1 dev,arch-x86: Make the I8042 reset settings more realistic.
When powered on, the "passed self test" bit should not be set. It should
only be set once the I8042 has actually been told to do a self test.
Also the mouse and keyboard should be disabled. With them disabled their
interrupts won't matter, but we might as well leave those disabled as
well.

Change-Id: Ief1ab30365a0a8ea0a116e52c16dcccf441515ec
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55805
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 16:53:14 +00:00
Bobby R. Bruce
2ed57352cb util: Remove util/cloudbuild
The "util/cloudbuild" directory was used to build Docker images on
the Google Cloud Build infrastructure. The gem5 project no longer uses
this service to build Docker images and, as such, this directory (and
its contents) are no longer required.

Change-Id: I724c50ec6045ab95f6b94533f2fd54980230789c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57431
Reviewed-by: Gabe Black <gabe.black@gmail.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-03-14 16:02:07 +00:00
Bobby R. Bruce
febbb1bf1c tests,util-docker: Add clang-12 to the compiler tests
Change-Id: I07f37df42b370677f4a5f4cd948b7680d551a5ab
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57430
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-14 16:02:07 +00:00
Bobby R. Bruce
7e65231abe util-docker: Adding docker-compose.yaml
"docker-compose.yaml" is used by the docker-compose utility to define
Docker image builds. In the case the "docker-compose.yaml" file defines
the building of all Docker images used in the gem5 project. These can be
built locally using `docker-compose build`.

Change-Id: I2544ec43e3a1743884e5aa243905704cb263d7d9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57429
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-14 16:02:07 +00:00
Matthew Poremba
130cb26f7c sim-se: Initialize shared page table base upon clone
When the clone syscall is called, a new process is created which
allocates a new page table. If clone was called with CLONE_THREAD, the
page table of that new process is then marked as shared. Next, initState
is called on the process which calls the page table's initState. For the
multi level page table, initState only sets the base pointer if shared
is false. This means that in this order the base pointer of the new page
table is not currently initialized causing spurious errors.

To fix this, the page table is explicitly initialized after the new
process and new page table are created but before the page table is
marked as shared. The process initState continues as normal and the new
page table's base pointer is not modified by further calls to initState
as it is already marked shared.

Change-Id: I4a533e13565fa572fb9153a926f70958bc7488b7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56366
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-14 15:30:50 +00:00
Gabe Black
dea2a73554 arch-x86: Make the flags microops handle reserved bits better.
These microops should report bits which are RAZ as zero and RAO as one,
and not let those bits get overwritten with anything else.

Change-Id: I8e867b311b485234ac457bf58fad1673892dfa6a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55823
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:57:12 +00:00
Gabe Black
a746d8d619 arch-x86: Use the right bits in the page table walker.
In the section of the page table walker which processes a non-PAE,
non-PSE page directory entry, use the right bits of the virtual address
to figure out what to load next.

Change-Id: I7be3339c24253aa5594f564087eb9a234c370325
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55812
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:56:50 +00:00
Gabe Black
145a6c3ef4 arch-x86: Tidy up the page table walker stepWalk method.
Use the mbits function to avoid ugly manual masking and shifting. Also
remove some unnecessary casts when DPRINTF-ing PTEs.

Change-Id: I1cf7307760b2534e90bea1276110ecb005ec6471
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55811
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:56:28 +00:00
Gabe Black
ea6a659adc arch-x86: Detect when entering virtual 8086 mode.
If we're entering virtual 8086 mode, panic. Some aspects of that mode
may actually work, but since it's essentially untested, lets be extra
cautious.

Change-Id: I78bbfcb75db8370f4271c75caabc0ec53f75a884
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55810
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:56:09 +00:00
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