Commit Graph

18689 Commits

Author SHA1 Message Date
Giacomo Travaglini
0d65662218 arch-arm: Reuse MCR15 trapping code in DC instructions
Change-Id: I08fec815400ad572da543660f0136e3d88d4dc65
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56593
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-01 11:57:58 +00:00
Giacomo Travaglini
31c31e1cd8 arch-arm: Replace mcrMrc15TrapToHyp with mcrMrc15Trap
The mcrMrc15TrapToHyp helper is already called within mcrMrc15Trap
This achieves the following:

1) Simplifies ISA code
2) Aligns McrDc to Mcr instruction

Change-Id: I9b6bc621ad89230ad9dcf0563d8985d5757b4ae1
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56592
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Maintainer: Andreas Sandberg <andreas.sandberg@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-01 11:57:58 +00:00
Gabe Black
412ae3f8df cpu,sim: Don't tie ThreadContext contextId to the CPU ID.
The contextId is generally treated as (and should be) an opaque index
into the System objects threadContext array. When forcing it to
particular values, that introduces gaps in the threadContext array which
trips up other code which is expecting the array to have only valid
entries.

Change-Id: I4997e989b436a3008f65f348722dfb843b2f110a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57089
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Yu-hsin Wang <yuhsingw@google.com>
2022-03-01 02:55:20 +00:00
Gabe Black
e7f1acc0dc scons: Add a "mold" value to the --linker option.
This new and improved linker approximately halves link time for
build/X86/gem5.opt for me compared to lld, the previously fastest
linker. The -fuse-ld=mold option is supported by current versions of
clang, and will be supported in gcc 12.

To use the mold linker with gcc prior to version 12, you need to set
the LINKFLAGS_EXTRA scons variable to pass in a -B option as described
on this page:

https://github.com/rui314/mold

Change-Id: Ic5ad0e532fac078d384a0aebb3e04a4b04ce4880
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57173
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Earl Ou <shunhsingou@google.com>
2022-03-01 02:02:27 +00:00
Gabe Black
76c0466557 cpu-o3: Use an array to hold rename maps in UnifiedRenameMap.
Change-Id: I3ae1d6ecb103d2b877aba36050cd7b148742b503
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49715
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-01 01:36:07 +00:00
Gabe Black
39d25eebd0 cpu-o3: Make canRename extract register counts locally.
This avoids having an argument for each register type, which prevents
building in an assumption about what register types exist.

Change-Id: I81473db51d930c757f4e0b24e6f3017a4965a721
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49714
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-01 01:36:07 +00:00
Gabe Black
a5ab19d3ef arch,cpu: Replace num${Type}DestReg accessors with numDestReg(type).
Change-Id: I32be58cce831c8c7d5b9e3d3f49f428a06c722a2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49713
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-01 01:36:07 +00:00
Gabe Black
967bada8db arch,cpu: Replace StaticInst::_num${TYPE}DestRegs members with an array.
The array is indexed using the register class.

Change-Id: I6cfd9735afa03e386e01e9e255fd6e55b7ba7272
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49712
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-03-01 01:36:07 +00:00
Gabe Black
2d012222c2 arch: Get rid of the unused numAccessNeeded variable.
This was defined in a few operand classes makeConstructor methods, but
never used for anything.

Change-Id: If2f62ff0a29a26ae7067728651440f864999fc67
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49718
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-02-28 22:05:25 +00:00
Gabe Black
ec4d6c0daf cpu,arch-arm: Use a sentry class valid for invalid RegIds.
The default constructor for RegId would initialize it with the
IntRegClass and register index 0. This is arbitrary and
indistinguishable from a real ID to the first integer register.

Instead, add a new class type constant InvalidRegClass, and use that to
initialize an otherwise uninitialized RegId.

Also, fill out some enums that needed to handle that value to silence
compiler warnings.

Change-Id: I3b58559f41adc1da5f661121225dbd389230e3af
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49710
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-28 22:04:27 +00:00
Daecheol You
092d33f3f5 configs: Modify createAddrRanges to support NUMA configuration
When system is configured for NUMA, it has multiple memory ranges,
and each memory range is mapped to a corresponding NUMA node.
For this, the change enables createAddrRanges to map address ranges to
only a given HNFs.

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

Change-Id: If4a8f3ba9aac9f74125970f63410883d2ad32f01
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56610
Reviewed-by: Tiago Muck <tiago.muck@arm.com>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-28 00:19:30 +00:00
Hoa Nguyen
0fefc76fe6 mem-cache: Fix unit inconsistencies in base cache stats
Most latency stats are described to have Cycle unit in the comments.
However, most of them are calculated from Tick.

Also, the unit of `demandAvgMissLatency` is incorrect.

Change-Id: Ib1b9b7c6fa4404cecb3982b3799753df19774623
Signed-off-by: Hoa Nguyen <hoanguyen@ucdavis.edu>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56989
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-27 23:01:03 +00:00
Gabe Black
f32130e26f arch-x86: Implement interrupts in real mode.
Software interrupts had been implemented earlier. This implements
hardware interrupt vectoring for real mode.

Change-Id: I92397514cdf64c3218175dd6cffd5931cc85d95b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55692
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 20:03:02 +00:00
Matthew Poremba
6a9dfcef52 mem-ruby: Revert 7018c2b34
This reverts commit 7018c2b34e. This
commit needs more work which will take a while. Meanwhile the nightly
tests are broken because of this.

Change-Id: I11d01d50ab3a2d8fd649f1a825911e14815b1ca6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57109
Reviewed-by: Bobby Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 15:19:51 +00:00
Gabe Black
97bc68e6f4 arch-x86: Fix how flags registers are handled in IRET_REAL.
There was a problem in how the data size worked, which could let data
leak through from the old value of a microcode register and affect the
new value of RFLAGS.

Change-Id: I2325bc3583b3c796c586c2ea4f6ba3cc56725077
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55691
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 13:19:30 +00:00
Gabe Black
7dfca8531d cpu: Remove an unused variable from one of the branch predictors.
The variable upsets clang and breaks the build.

Change-Id: Ia2315e1753b6e9e701bf18eadf8cf448643577b4
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57172
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 13:06:07 +00:00
Gabe Black
293cfab778 arch-x86: Mark a variable as [[maybe_unused]].
This variable is used to hold a new value for the FSW register, and is
only actually installed if the flag version of the PremFp microop is
used. Mark it as [[maybe_unused]] so clang doesn't complain.

Change-Id: Ied0e267a1b89884b369cc5f7f043c96ae86d973b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57171
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 13:06:07 +00:00
Gabe Black
001e17890c misc: Use the new bufval helpers in RegClass and Packet.
Those makes generally useful mechanisms are now available to any code
that wants to use it, and are covered by a unit test.

Change-Id: If918eba3b81443019c5789ab132de45c65f93072
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57150
Reviewed-by: Jason Lowe-Power <power.jg@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <power.jg@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 09:56:26 +00:00
Gabe Black
9df4159456 sim: Add some helpers for working with values in buffers.
This change adds helpers to get and set values from byte buffers of
variable size, and to print them. It also provides a helper to print a
buffer of bytes.

Change-Id: I23210505f99488a901bed244ffc70ef4736470d0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57149
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 09:56:26 +00:00
Gabe Black
7f9f145174 arch-x86: Implement the real mode far return that takes an immediate.
The immediate value tells the return instruction how much to adjust the
stack by after returning to the previous RIP.

Change-Id: If9bd935c4b1c73dfcf709cce02bcfa3738637c6c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55625
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 07:47:59 +00:00
Gabe Black
2a424850d5 arch-x86: Don't load past the end of the far pointer in real mode jmp.
When loading the segment selector from the far pointer, only load two
bytes to avoid unnecessarily going beyond a boundary where accesses may
not be allowed.

Change-Id: I4fc31e3f87815a19232390966c25d156be6a7e92
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55624
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 07:47:45 +00:00
Gabe Black
d73ce0f593 arch-x86: Implement real mode far call.
Change-Id: I720a0b0e4aa227171c59804d899baba64b8d320b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55623
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 07:47:23 +00:00
Gabe Black
7468d4169c arch-x86: Straighten out the segment and selector for real far jumps.
These had been partially transposed in the microcode for this
instruction.

Change-Id: Ida31e74d5096c6b8cf77dc49b9a0f480c1358009
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55591
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 07:47:03 +00:00
Gabe Black
802f14bb52 arch-x86: Implement popping into a stack selector in real mode.
Segmentation is relatively easy to deal with in real mode, vs. protected
mode.

Change-Id: I4b93a7e321d5debb7240b002bb42fdecaafbfdfe
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55590
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 07:30:24 +00:00
Gabe Black
c2c10dc647 arch-x86: Implement the real mode versions of LDS, LES, etc.
Change-Id: I8956d9871c8819acd4669423b3b59fa615ac2a7c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55588
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 07:30:06 +00:00
Gabe Black
aa4b6047e5 cpu-simple: Ignore writes to the "zero" register.
Rather than constantly overwriting the "zero" register to return its
value to zero, just ignore writes to it.

We assume here that the "zero" register is a standard RegVal type
register (ie not bigger than 64 bits) and is accessed as such.

Change-Id: I06029b78103019c668647569c6037ca64a4d9c76
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49709
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-26 05:02:35 +00:00
Gabe Black
f12c330f40 arch-x86: Use different tables for 64 bit prefixes in the decoder.
There are instructions in 64 bit mode which have been turned into the
REX and VEX prefixes, and which should no longer behave as instructions.
When not in 64 bit mode however, those instructions still need to behave
properly.

We were handling that for the REX prefixes by explicitly checking if the
prefix we found was one of those, and then whether we were in 64 bit
mode or not. We were not handling the VEX prefixes at all, so those were
always acting as prefixes, even when not in 64 bit mode.

This change replaces the REX check and possible VEX check by having two
prefix tables, one for 64 bit mode, and one for otherwise. The REX and
VEX prefixes are simply left out of the non 64b it mode table, making an
explicit check for them unnecessary.

Change-Id: Ia2fc17074015e074d1f156177bd499d67da5411d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55587
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-02-26 02:00:06 +00:00
Gabe Black
7a408e35fd dev,arch-x86: Add an x86/compatibility IDE controller.
This is essentially the same as the normal one, except it sets its
ProgIF bits to show that it works in compatibility mode only, with fixed
IO ports and fixed IRQs that it operates with which are outside of the
scope of the normal PCI mechanisms.

Change-Id: I69d04f5c9444e7e227588b96b7dd4123b2850e23
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55586
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-02-26 01:59:50 +00:00
Gabe Black
2bbcee7723 dev: Fix an assert in the I8259 interrupt controller.
If an *index* is equal to or greater than the size of the thing it's
indexing, then that's an error. Another count, on the other hand, must
be strictly greater for that to be a problem.

Change-Id: I9c891b37482fe72b6436850fc8c3c2fcef6f0476
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55585
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-02-26 01:59:30 +00:00
Gabe Black
72a455f9c9 dev: Don't implement the ATAPI_IDENTIFY_DEVICE command.
This command is one of two that should be implemented by ATAPI devices.
An ATAPI device are essentially optical devices which use SCSI commands
which are transported over ATA using two special commands, a PACKET
command which actually sends the SCSI commands, and an IDENTIFY command
which is basically the same as the ATA IDENTIFY command but which is
only implemented on ATAPI devices. In order to determine if the device
connected to an IDE controller is an optical drive or a regular ATA hard
drive, software can send the ATAPI_IDENTIFY_DEVICE command and see if
gets an appropriate response.

In gem5, this command was originally not implemented by the IDE disk
model. If a driver attempted to send it, the gem5 model would panic and
kill the simulation. To fix that problem, that command was added to the
list of supported commands and just made a synonym for the ATA IDENTIFY
command since they have essentially the same response.

Unfortunately, this makes all ATA devices look like ATAPI devices, which
is not what we have implemented.

Instead, when we get this command, what we *should* do, as far as I can
tell by reading this:

http://users.utcluj.ro/~baruch/media/siee/labor/ATA-Interface.pdf

is to set the ERR bit in the status register, and then set the ABRT bit
in the error register to indicate that the command was not implemented.

I've attempted to implement that into the model with this change by
setting those bits as described, and then setting the "action" member to
be ACT_CMD_ERROR. I think that action is there primarily to support
cancelled transfers, but it seems like it has the desired effect(?).

Since the error bits are not really explicitly set or managed by the
model in most cases, this change also adds a little bit of code at the
top of startCommand which clears them to zero. These bits are supposed
to "contain the status of the last command executed", and if we're
starting a new command, the error bits no longer apply.

I'm confident that conceptually this is how the ATAPI_IDENTIFY_DEVICE
command should behave in our model, at least unless we decide to
implement real ATAPI models which actually accept SCSI commands, etc.
I'm less confident that I've modified the model to actually implement
that behavior, but as far as I can tell it doesn't seem to have broken
anything, and now SeaBIOS no longer things our disk model is a CDROM
drive.

Change-Id: I2c0840e279e9caa89c21a4e7cbdbcaf6bccd92ac
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55523
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-02-26 01:59:13 +00:00
Gabe Black
5df52e0dca arch-x86: Overhaul how address size is handled, particularly for stack.
The stack size is something that applies to addresses when performing
accesses as part of some instructions. This was handled inconsistently
or incompletely or simply incorrectly in a few ways.

First, when pushing or popping from the stack, the *address size* should
be set to the stack size. The data size is generally the operand size.
When the stack pointer is incremented/decremented, it should be changed
by the data size. When a stack pointer is manipulated, the data size
for those calculations should be the stack size. Importantly that does
not change the value of the increment/decrement, which is the operand
size still. This usage has been fixed throughout.

The TLB generally needs to know what the address size was in order to
figure out what segment offset was used so that it can do limit checks.
There is some inherent inaccuracy in doing things in reverse like this,
but that's how it works currently. To find that size, the TLB tried to
start from first principles to figure out what the default address size
was, and then whether there was an override was passed in through the
request flags.

This is *very* inaccurate for a few reasons. First, the override doesn't
always apply. Second, the address size used by a particular instruction
doesn't have to be based on any particular size, whether that is the
default or alternate address size, the stack size, etc.

Instead, the instructions now pass the actual size being used in as a 2
bit value (0 -> 1 byte, 1 -> 2 bytes, 2 -> 4 bytes, 3 -> 8 bytes),
avoiding most of the inaccuracy and approximation.

Because the CPU won't embed any size information into fetches, we'll
just assume those have no wrap around within the address size.

Finally, there were microops that had been added which overrode the
address size to be the stack size internally, and try to help the TLB
figure out what to do to figure out the address size. Because both of
those things are now handled in a different way, those microops are no
longer needed or used and have been deleted.

Change-Id: I2b1bdf1acf1540bf643fac6d49fe1a5a576ba5c1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/55443
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
2022-02-26 01:58:23 +00:00
Gabe Black
375236082d scons: Use env and not main in SConscripts.
"env" is the environment for the current variant, where "main" is the
environment that was derived from.

Change-Id: I71e30684aa82a297241820502f204400c89c80cf
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56890
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
2022-02-25 09:32:14 +00:00
Gabe Black
e5281da388 sim: Fix style in insttracer.hh.
Change-Id: Iddf032ae03ef20d6220c298424779dad726f5179
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49706
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-25 08:08:32 +00:00
Gabe Black
3e846d20ed cpu: Remove VecRegContainer from ThreadContext::compare.
Change-Id: I5a0f9d30fe56806d46fb54d62e1e58d02a319879
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49708
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 23:22:24 +00:00
Gabe Black
b5edb3b0e4 cpu-o3: Print vec and vec pred reg values with valString.
Remove the need for the VecRegContainer and VecPredRegContainer types.

Change-Id: If230449d7f43a5a9b7c3e00b2692cc35ce971c63
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49705
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 23:21:45 +00:00
Gabe Black
9950d58e16 cpu-o3: Remove some unused accessors on the PhysRegFile.
Change-Id: I2d3d4845ae1a7e4329985a1d8bc011e2f5cf83d1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49704
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 23:21:30 +00:00
ksco
0eff31e564 arch-riscv: Fix a typo in fsgnjn_s decoder
Negating the register value before unboxing to float32 will
generally result in a canonical 32-bit NaN (without the sign
bit set) so the result was incorrect in many cases.

Change-Id: I0c1bb3aadfca135ab0cc5ba1b58fc83d71fd300c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/57069
Reviewed-by: Alex Richardson <alexrichardson@google.com>
Reviewed-by: Gabe Black <gabe.black@gmail.com>
Maintainer: Gabe Black <gabe.black@gmail.com>
Reviewed-by: Luming Wang <wlm199558@126.com>
Tested-by: kokoro <noreply+kokoro@google.com>
2022-02-24 12:30:11 +00:00
Gabe Black
3ba623d673 arch: Stop using TheISA:: in the ISA parser.
The ISA description provides us with a namespace to use, so we can use
that instead of TheISA.

Change-Id: If1a13c39a09ab22c7cab1138220fa0162fc2effa
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49707
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-02-24 09:10:26 +00:00
Gabe Black
d53f75c1eb cpu: Eliminate the (read|set)VecPredReg helpers from ThreadContext.
Change-Id: I9f220ba4f28d6a63e4f037388b0431dfe123a8a9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49703
Maintainer: Gabe Black <gabe.black@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
2022-02-24 00:10:17 +00:00
Gabe Black
5c3a6a4e13 cpu,arm: Eliminate the now unused helpers (read|set)VecPredReg.
Change-Id: I27533d7ff97cb7a08db6234c0dd73d5327cf06b2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49702
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
eefe075d3b arm: Replace readVecPredReg with getReg in the tarmac tracer.
Change-Id: Id290b4b63ca0cf9982327e1451d12917e9d99272
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49701
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
22eeeaff86 cpu: Remove readVecPredReg from ThreadContext::compare.
Use the generic getReg method to avoid having to use the
TheISA::VecPredRegContainer type.

Change-Id: I8240dd85f2db2f8125d7944135c4361866fba057
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49700
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
973d9c82c0 arm: Collapse (set|read)VecPredReg in htm.cc.
Replace these helpers with calls to the underlying setReg and getReg.

Change-Id: I1b811f5dab2d23aafc2f373f743126a54b8c3d73
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/49699
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
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