gem5.git
4 years agoarch-arm: Fix clang warnings
Jui-min Lee [Thu, 19 Dec 2019 08:10:20 +0000 (16:10 +0800)]
arch-arm: Fix clang warnings

Fix some warnings reported by clang.

* missing override in {freebsd,linux}/process.hh

Change-Id: I67c36a0785ac90614211d640fd58d3ffe187c17e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23863
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix decoding of LDFF1x scalar plus scalar
AdriĆ  Armejach [Wed, 18 Dec 2019 14:40:17 +0000 (15:40 +0100)]
arch-arm: Fix decoding of LDFF1x scalar plus scalar

First-faulting loads do allow Rm == 0x1f.

Change-Id: Ib9bcb55e126653813fdbb7c29970af23a2471ebb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23803
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Semihosting, fix SYS_FLEN
Adrian Herrera [Fri, 15 Nov 2019 11:42:23 +0000 (11:42 +0000)]
arch-arm: Semihosting, fix SYS_FLEN

SYS_FLEN was incorrectly handled as SYS_ISTTY. This patch fixes this
behaviour.

Change-Id: I66e0b97d8b44d2cb78e0b1bb940fd6f4b52c658f
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23752
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: kernelExtras optional load addresses
Adrian Herrera [Thu, 14 Nov 2019 20:41:50 +0000 (20:41 +0000)]
sim: kernelExtras optional load addresses

This patch provides a new "System" parameter named "kernel_extras_addrs".
This allows to optionally specify fixed load addresses for the
additional kernel objects. This is useful to load arbitrary blobs into
memory.

Change-Id: I4725763b86c29f72282d1c184d4284d90f9d3016
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23566
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agopython: fix "fatal" usage in fdthelper
Adrian Herrera [Thu, 28 Nov 2019 17:04:34 +0000 (17:04 +0000)]
python: fix "fatal" usage in fdthelper

"fatal" was not correctly imported in the fdthelper module,
which caused a crash when reporting errors.

Change-Id: I7ee9dcde1f0288e11e56dba67ead4aa2d6d67e02
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23753
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Secure EL2 checking
Adrian Herrera [Wed, 6 Nov 2019 13:07:28 +0000 (13:07 +0000)]
arch-arm: Secure EL2 checking

This patch adds Armv8.4-SecEL2 checking. Helpers implementing
EL2Enabled, IsSecureEL2Enabled and HaveSecureEL2Ext following
the architecture pseudocode are provided. These are intended
to be used for checking register access permissions.

Change-Id: I3d06d0127cf165c1eeaf3302830742d610cef719
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23766
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: AArch64 trap check, arbitrary ECs/Imms
Adrian Herrera [Wed, 6 Nov 2019 13:30:15 +0000 (13:30 +0000)]
arch-arm: AArch64 trap check, arbitrary ECs/Imms

This patch generalises trap checking when accessing system registers
in AArch64. Depending on the accessed register, a different Exception
Class (EC) and immediate value may be set.
Previously this only took SIMD traps into account.

Change-Id: I30717676a210c770531e39e4c6a6e1fbfdfdc583
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23765
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agox86: Fix some bugs with KVM in SE mode on Intel machines.
Gabe Black [Wed, 4 Dec 2019 04:35:22 +0000 (20:35 -0800)]
x86: Fix some bugs with KVM in SE mode on Intel machines.

The granularity bit should be set since the segment limit should be
interpreted as a number of pages, not bytes.

A comment indicates that NX support is enabled, but the bit wasn't
being set. That's now set to be consistent with FS mode.

The SVME bit is now turned off, since Intel CPUs don't have SVME, and
enabling it apparently makes them upset.

Also disable CR4 bits which enable features neither gem5 nor apparently
my workstation support.

Change-Id: I72d5a07871dede8763b0dd188a52fe5eb6bde6ea
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23361
Reviewed-by: Ayaz Akram <yazakram@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Include some required headers in the syscall debug macros header.
Gabe Black [Sun, 8 Dec 2019 09:29:52 +0000 (01:29 -0800)]
sim: Include some required headers in the syscall debug macros header.

Everything that includes syscall_debug_macros.hh and uses the macro in
it will need these headers, so they should be included through
syscall_debug_macros.hh. The consumer shouldn't have to know what the
macros use internally and to include extra headers to support them.

Change-Id: I9bfa932368daec0772d552357ecad8790b4cfead
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23459
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agofastmodel: Tell fast model not to shutdown when time stops.
Gabe Black [Tue, 22 Oct 2019 01:01:31 +0000 (18:01 -0700)]
fastmodel: Tell fast model not to shutdown when time stops.

Change-Id: I000e7809a2c8850eb31e5615caf1d88b537fea8d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22121
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Chun-Chen TK Hsu <chunchenhsu@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Implement port proxies.
Gabe Black [Sat, 19 Oct 2019 00:49:45 +0000 (17:49 -0700)]
fastmodel: Implement port proxies.

This plumbing is simple and largely copied from other implementations
within gem5. This mechanism should be refactored so that the
duplication is unnecessary.

Change-Id: Ibcdf759b7fba1d574e8e2ba04249afdd92c6560c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22120
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Chun-Chen TK Hsu <chunchenhsu@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Create a TLB model which uses IRIS to do translations.
Gabe Black [Sat, 19 Oct 2019 00:11:30 +0000 (17:11 -0700)]
fastmodel: Create a TLB model which uses IRIS to do translations.

Change-Id: I806dc8cdacce57e6ec31d2421b9e6b9733c7da02
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22119
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

4 years agofastmodel: Add an address translation mechanism to the ThreadContext.
Gabe Black [Sat, 19 Oct 2019 00:08:03 +0000 (17:08 -0700)]
fastmodel: Add an address translation mechanism to the ThreadContext.

This will be used by the TLB to do the actual translation.
Unfortunately there isn't a great way to tell what translation type to
use, so we just go through all of them for now. The ARM subclass might
specialize and figure out which address spaces to use based on control
register state.

Change-Id: Id1fcad66554acf9d69af683917b3c2834f825da0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22118
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: Add Giacomo Travaglini to PMC
Jason Lowe-Power [Mon, 16 Dec 2019 16:32:46 +0000 (08:32 -0800)]
misc: Add Giacomo Travaglini to PMC

Change-Id: I025a4bcde558187d02a7e13c6d644555f7148676
Signed-off-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23723
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase: Fix AddrRange::isSubset() check
Nikos Nikoleris [Fri, 13 Dec 2019 16:25:49 +0000 (16:25 +0000)]
base: Fix AddrRange::isSubset() check

Making _end non-inclusive, introduced a bug in isSubset() which was
checking if _end is included in the input address range. This CL
changes the behavior and now we test if _end - 1 is in the range.

Change-Id: Ib8822472b7c266e10d55f3d5cf22a46aa45c1fc7
Signed-off-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23663
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Setup Kokoro to run the GTest suite.
Bobby R. Bruce [Mon, 16 Dec 2019 22:07:22 +0000 (14:07 -0800)]
tests: Setup Kokoro to run the GTest suite.

Change-Id: If700eed24b2902d04a9b0ee72b72e9e6a3472ef5
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23724
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Added channel_addr.cc dependency to channel_addr GTest
Bobby R. Bruce [Wed, 11 Dec 2019 23:47:36 +0000 (15:47 -0800)]
scons: Added channel_addr.cc dependency to channel_addr GTest

In some circumstances not including channel_addr.cc as a dependency for
the channel_addr.test compilation resulted in a build failure (this was
observed in gem5's Kokoro CI system). This commit fixes this problem.

Change-Id: Ic38a104a1e6bf655fc64158b556e6227d5ac3981
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23603
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Add a header for IRIS MSN constants.
Gabe Black [Fri, 13 Dec 2019 08:24:43 +0000 (00:24 -0800)]
fastmodel: Add a header for IRIS MSN constants.

Change-Id: I06a7d7db95ec1ce65945c9e09f812f0b69aaa8e6
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23643
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfig: Default the indirect branch predictor to "None".
Gabe Black [Wed, 4 Dec 2019 04:33:28 +0000 (20:33 -0800)]
config: Default the indirect branch predictor to "None".

Other scripts (like se.py) blindly try to apply the indirect predictor
if one is set. Because this option defaults to something, there's no
way (as far as I know) to purposefully select nothing, and so the
simulator crashes. Users shouldn't have to proactively prevent gem5
from killing itself regardless, so the default was changed to "None".

Change-Id: Ic3382b8065442d6705b1c6a656646598d9d5c322
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23360
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: kernelExtras if no kernel provided
Adrian Herrera [Thu, 14 Nov 2019 09:57:13 +0000 (09:57 +0000)]
sim: kernelExtras if no kernel provided

kernelExtras facilitates a way for users to provide additional
blobs to load into memory. As of now, the creation of the extra
images is done independently of the kernel being provided, but
the loading is only done if the kernel is present.

This patch refactors the loading of extra images to be committed
if no kernel is present.

Change-Id: I900542e1034ade8d757d01823cfd4a30f0b36734
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22850
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agodev-virtio,configs: expose 9p diod virtio on ARM
Ciro Santilli [Thu, 24 Oct 2019 16:45:43 +0000 (17:45 +0100)]
dev-virtio,configs: expose 9p diod virtio on ARM

9p allows the guest Linux kernel to mount a host directory into the guest.

This allows to very easily modify test programs after a run at the end of
boot, without the need to re-insert the changes into a disk image.

It is enabled on both fs.py and fs_bigLITTLE.py with the --vio-9p
option.

Adapted from code originally present on the wiki: http://gem5.org/WA-gem5

As documented in the CLI option help, the current setup requires the guest
to know the full path to the host share, which is annoying, but overcoming
that would require actually parsing a bit of the protocol rather than just
forwarding everything to diod.

Change-Id: Iaeb1ed185dccfa8332fe6657a54e7550f64230eb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22831
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-virtio: VIO9P turns on diod verbose output with -d 1
Ciro Santilli [Thu, 24 Oct 2019 16:26:59 +0000 (17:26 +0100)]
dev-virtio: VIO9P turns on diod verbose output with -d 1

Change-Id: I97e5762f4aca384068b87e22902e071fa3014ceb
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22829
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

4 years agodev-virtio: don't set the 9p default root
Ciro Santilli [Thu, 24 Oct 2019 16:19:06 +0000 (17:19 +0100)]
dev-virtio: don't set the 9p default root

It is better to force users to explicitly set this argument, since
it is unlikely that we will find one safe option for all users.

Change-Id: I612520a44efd205a029a40cd13402584d16e1d88
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22828
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agodev-virtio: use diod basename as the default 9p path
Ciro Santilli [Thu, 24 Oct 2019 16:17:25 +0000 (17:17 +0100)]
dev-virtio: use diod basename as the default 9p path

This allows diod to be present anywhere in the PATH by default,
which works because we are already using execlp.

Change-Id: I9d0b6c9a75f32cf0cb5d8f52bb00c465e4d43e1b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22827
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agomem: Encapsulate mapping gem5 to host address space
Daniel R. Carvalho [Wed, 16 Oct 2019 12:38:04 +0000 (14:38 +0200)]
mem: Encapsulate mapping gem5 to host address space

Create a function to encapsulate mapping an address in gem5's
address space to the host's address space. The returned value can
be used to access the contents of the given address.

As a side effect, make the local variable hostAddr use snake_case
to comply with gem5's coding style.

Change-Id: I2445d3ab4c7ce5746182b307c26cbafc68aa139c
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22610
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Move unused prefetches counter update
Daniel R. Carvalho [Mon, 4 Feb 2019 12:57:25 +0000 (13:57 +0100)]
mem-cache: Move unused prefetches counter update

The number of unused prefetches should be updated every time
a block is invalidated, therefore we move the update to within
the corresponding function.

Change-Id: If3ac2ea43611525bd3c36d628d88382042fcb7dc
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18908
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>

4 years agopython: Convert terminal escape sequences to strings.
Gabe Black [Tue, 3 Dec 2019 01:53:26 +0000 (17:53 -0800)]
python: Convert terminal escape sequences to strings.

In python 3, the curses escape sequences are bytes objects and not
strings, making them unsuitable to concatenate to strings which are
being print()-ed. This uses the decode() method to turn them from bytes
objects into string objects, assuming they represent UTF-8. In python
2, bytes objects and strings are treated interchangeably, and so this
isn't necessary.

Change-Id: Ifc5d788e1c62751090a350d3a064e89f434559e8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23265
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Always initialize SVE memData
Giacomo Travaglini [Mon, 9 Dec 2019 13:59:23 +0000 (13:59 +0000)]
arch-arm: Always initialize SVE memData

Some compilers will produce a warning when using an uninitialized
memData.

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

Change-Id: I19e197b15729a03da546a0188917a9b3e7bf31b7
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23525
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Avoid creating an empty byteEnable vector
Giacomo Travaglini [Mon, 9 Dec 2019 16:57:58 +0000 (16:57 +0000)]
arch-arm: Avoid creating an empty byteEnable vector

This behaviour will be forbidden in following patches.
Instead, create an all true vector.

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

Change-Id: I61d2852610281f2d7c7a669dcb4d2728be194f52
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23524
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Replace empty byteEnable check with Request::isMasked
Giacomo Travaglini [Tue, 10 Dec 2019 14:59:38 +0000 (14:59 +0000)]
cpu: Replace empty byteEnable check with Request::isMasked

This should be the interface to be used to check if the request
has some masked bytes.

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

Change-Id: I1ab5fd266c7b63a928aada32ae6d4f7fa915f2b6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23523
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: Fix coding style (byteEnable->byte_enable)
Giacomo Travaglini [Wed, 27 Nov 2019 15:48:22 +0000 (15:48 +0000)]
cpu: Fix coding style (byteEnable->byte_enable)

Change-Id: I2206559c6c2a6e6a0452e9c7d9964792afa9f358
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23282
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
4 years agocpu: Add byteEnable assertions to readMem and initateMemRead
Giacomo Travaglini [Wed, 27 Nov 2019 15:45:57 +0000 (15:45 +0000)]
cpu: Add byteEnable assertions to readMem and initateMemRead

Those are already present in writeMem; looking for consistency

Change-Id: Ib85e0db228bc73e3ac64155d1290444cf6864a8c
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23281
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>

4 years agosim,arch: Collapse the ISA specific versions of m5Syscall.
Gabe Black [Mon, 25 Nov 2019 10:26:51 +0000 (02:26 -0800)]
sim,arch: Collapse the ISA specific versions of m5Syscall.

The x86 version doesn't do anything x86 specific, and so can be used
generically in sim/pseudo_inst.(hh|cc)

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

Change-Id: I46c2a7d326bd7a95daa8611888051c180e92e446
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23177
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agoarch,cpu,sim: Push syscall number determination up to processes.
Gabe Black [Mon, 25 Nov 2019 09:07:41 +0000 (01:07 -0800)]
arch,cpu,sim: Push syscall number determination up to processes.

The logic that determines which syscall to call was built into the
implementation of faults/exceptions or even into the instruction
decoder, but that logic can depend on what OS is being used, and
sometimes even what version, for example 32bit vs. 64bit.

This change pushes that logic up into the Process objects since those
already handle a lot of the aspects of emulating the guest OS. Instead,
the ISA or fault implementations just notify the rest of the system
that a nebulous syscall has happened, and that gets propogated upward
until the process does something with it. That's very analogous to how
a system call would work on a real machine.

When a system call happens, the low level component which detects that
should call tc->syscall(&fault), where tc is the relevant thread (or
execution) context, and fault is a Fault which can ultimately be set
by the system call implementation.

The TC implementor (probably a CPU) will then have a chance to do
whatever it needs to to handle a system call. Currently only O3 does
anything special here. That implementor will end up calling the
Process's syscall() method.

Once in Process::syscall, the process object will use it's contextual
knowledge to determine what system call is being requested. It then
calls Process::doSyscall with the right syscall number, where doSyscall
centralizes the common mechanism for actually retrieving and calling
into the system call implementation.

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

Change-Id: I937ec1ef0576142c2a182ff33ca508d77ad0e7a1
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23176
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
4 years agox86: Stop manually clearing RFLAGS.RF after a system call.
Gabe Black [Mon, 25 Nov 2019 07:43:10 +0000 (23:43 -0800)]
x86: Stop manually clearing RFLAGS.RF after a system call.

The system call stub KVM uses in SE mode to call the system call
pseudo instruction which ultimately calls m5Syscall already uses
sysret, and the implementation of sysret clears both the RF and VM bits
itself. There's no reason to do that again explicitly here.

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

Change-Id: Id7b5417564e3f3492ba6efb8ed36fab2f4c38e09
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23175
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agoarch: Get rid of the now unused setSyscallArg.
Gabe Black [Mon, 25 Nov 2019 07:25:40 +0000 (23:25 -0800)]
arch: Get rid of the now unused setSyscallArg.

Setting syscall args isn't really something we need to do in gem5,
since that will be taken care of by the code actually calling the
syscall. We just need to be able to retrieve the value it put there.

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

Change-Id: I0bb6d5d0207a7892414a722b3788cb70ee509582
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23174
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agoarch: Stop using setSyscallArg to set argc and argv.
Gabe Black [Mon, 25 Nov 2019 07:17:58 +0000 (23:17 -0800)]
arch: Stop using setSyscallArg to set argc and argv.

In Alpha and MIPS, the argc and argv values should be in what happens
to be the first and second syscall argument registers, but that's not
by definition. The process objects of both those ISAs know what
registers to use intrinsically, so there's also no reason to call out
to a helper method which acts as a part of the Process's interface to
the rest of gem5.

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

Change-Id: Id8fa38ab1fc2ac6436e94ad41303439973fded10
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23173
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agosim: Add a wrapper/subclass for SyscallDesc which uses GuestABI.
Gabe Black [Sat, 23 Nov 2019 02:05:23 +0000 (18:05 -0800)]
sim: Add a wrapper/subclass for SyscallDesc which uses GuestABI.

This will let system call implementations take arguments naturally,
and centrally defined, potentially complex, and ISA/context specific
mechanisms will automatically gather the arguments and store any
result.

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

Change-Id: I68d265e0bab5de372ba975e4c7e9bb2d968c80af
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23172
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agosim: Add a mechanism to translate ABIs to call host funcs from a TC.
Gabe Black [Sat, 23 Nov 2019 02:00:36 +0000 (18:00 -0800)]
sim: Add a mechanism to translate ABIs to call host funcs from a TC.

The guest ABI is specified as a template parameter. This makes it
possible for host simcall handlers to be called through different ABIs
which might be from different ISAs, or might be from different contexts
within the same ISA (32 vs 64 bit, syscall vs. function vs.
pseudo instrunction vs. semihosting call).

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

Change-Id: I66a0f558e9c1f70a142b69b0dd95bd71e41d898b
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23171
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agosim: Get rid of the now unused SyscallDesc flags and methods.
Gabe Black [Sat, 23 Nov 2019 00:01:38 +0000 (16:01 -0800)]
sim: Get rid of the now unused SyscallDesc flags and methods.

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

Change-Id: Icee18a4bd77a346d7f82ef4988651b753392d51e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23170
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agoarch: Use ignoreWarnOnceFunc instead of the WarnOnce flag.
Gabe Black [Sat, 23 Nov 2019 00:00:51 +0000 (16:00 -0800)]
arch: Use ignoreWarnOnceFunc instead of the WarnOnce flag.

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

Change-Id: I9bbffcc74ec4f3df4effa5c50f0a4a688c5b6016
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23169
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agosim: Reintroduce the ignoreWarnOnceFunc syscall handler.
Gabe Black [Fri, 22 Nov 2019 23:59:07 +0000 (15:59 -0800)]
sim: Reintroduce the ignoreWarnOnceFunc syscall handler.

Instead of just using warn_once, we'll gate each warning on a bool
which is associated with the syscall desc pointer. To avoid having to
keep warn once bookkeeping in every syscall desc, we put it in a map
which is looked up at runtime.

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

Change-Id: I1dcce48de91b8a635f9f3df3bfc0ed6ba1291c4f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23168
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
4 years agosim: Make the syscalls use the SyscallReturn suppression mechanism.
Gabe Black [Fri, 22 Nov 2019 23:40:58 +0000 (15:40 -0800)]
sim: Make the syscalls use the SyscallReturn suppression mechanism.

This, among other things, prevents them from needing to toggle global
flags in the syscall desc table to control local behavior.

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

Change-Id: Idcef23766084f10d5205721b54a6768a850f7eb9
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23167
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
4 years agodev-arm: GenericTimer, configurable base and low freqs
Adrian Herrera [Mon, 28 Oct 2019 20:28:51 +0000 (20:28 +0000)]
dev-arm: GenericTimer, configurable base and low freqs

Architecture states the system counter has a fixed base frequency
provided in the first entry of the frequency modes table. Optionally,
other lower frequencies may be specified in consecutive entries.

This patch adds configurable frequencies to the GenericTimer model.
The default base frequency is kept as the one that was previously
hardcoded for backwards compatibility.

The table is not recommended to be updated once the system is running.

Change-Id: Icba0b340a0eb1cbb47dfe7d7e03b547af4570c60
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22425
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: GenericTimer, freq as 32-bit value
Adrian Herrera [Mon, 28 Oct 2019 19:38:06 +0000 (19:38 +0000)]
dev-arm: GenericTimer, freq as 32-bit value

The System Counter frequency is now a 32-bit value. This is consistent
with CNTFRQ and CNTFRQ_EL0 register sizes.

Change-Id: I39886a3767adbe9c58887b8b6d5f30ebc6035bcc
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22424
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Disambuiguate NumFloatV7ArchRegs usage
Giacomo Travaglini [Tue, 19 Nov 2019 11:45:03 +0000 (11:45 +0000)]
arch-arm: Disambuiguate NumFloatV7ArchRegs usage

Sometimes NumFloatV7ArchRegs is used to specify the maximum number of
AArch32 floating point registers. Sometimes it is just used for indexing
a free register storage to be used by microcode.  In that scenario,
VecSpecialElem should be used, which is a index to the first available
non architectural register for floating point.

Change-Id: I4e84740701f0e7041cf1acad2afed471361c423a
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23107
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Unify VLdmStm behaviour when reg out of index
Giacomo Travaglini [Tue, 19 Nov 2019 11:29:39 +0000 (11:29 +0000)]
arch-arm: Unify VLdmStm behaviour when reg out of index

The generic VLdmStm class (modelling A32 VLDM/VSTM) is handling a wrong
register list in a inconsistent way. Some instructions are opting
for being decoded as Unknown, while others handle it inside the
macro instruction constructor by manually adjusting the reglist.

Those are two valid implementation of the CONSTRAINT UNPREDICTABLE
behaviour (1 and 3):

"If regs > 16 || (d+regs) > 32 , then one of the following behaviors must
occur:
1) The instruction is UNDEFINED .
2) The instruction executes as NOP .
3)  One or more of the SIMD and floating-point registers are UNKNOWN . If
the instruction specifies writeback, the base register becomes UNKNOWN .
This behavior does not affect any general-purpose registers."

This patch unfies the behaviour by always opting for option 1) over 3)

Change-Id: I4f98409243d5a2ec64113fe9c87e961a391abe94
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23106
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Fix NumVecV7ArchRegs value (64->16)
Giacomo Travaglini [Mon, 18 Nov 2019 13:50:02 +0000 (13:50 +0000)]
arch-arm: Fix NumVecV7ArchRegs value (64->16)

In armv7 there are 16 only quadword (vector) registers which are usable
by SIMD instructions (Q0-Q15). Those completely overlap with the 32
double word registers (D0-D31).

NumVecV7ArchRegs  = 16; // Q0-Q15

Change-Id: Id8fee1064d60dcfa54f273fa7d579a20c0087835
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23105
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Reorder arch/arm/registers.hh constants
Giacomo Travaglini [Mon, 18 Nov 2019 14:36:57 +0000 (14:36 +0000)]
arch-arm: Reorder arch/arm/registers.hh constants

This is putting some order in the constants definition, respecting
the description which divides:

* Constants Related to the number of registers
 (example: const int NumFloatRegs = 0)

from:

* Semantically meaningful register indices (to indicate special
  registers)
 (example: const int INTRLVREG0 = NumVecV8ArchRegs + NumVecSpecialRegs)

Change-Id: I1760b7f786b6f6becbe8ab445e65fc3fa17206cb
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23104
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Replace NumFloatV8ArchRegs with NumVecV8ArchRegs
Giacomo Travaglini [Mon, 18 Nov 2019 13:19:49 +0000 (13:19 +0000)]
arch-arm: Replace NumFloatV8ArchRegs with NumVecV8ArchRegs

gem5-ARM is not using floatRegs anymore and moved towards the
vecRegs register file (which is used for SIMD&FP + SVE instructions)

Change-Id: I41cfbe10565e4e0db838f98626310a5b14edadb9
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23103
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: AArch64 Linux as quick regressions (instead of AArch32)
Giacomo Travaglini [Fri, 8 Nov 2019 17:28:43 +0000 (17:28 +0000)]
tests: AArch64 Linux as quick regressions (instead of AArch32)

NOTE: Following the discussion on the current patch review, some
regressions have been moved to the long list (realview64-simple-atomic
and realview64-simple-timing) in order to reduce computation time. These
should be moved back to the quick list as soon as we get more computing
power.

Change-Id: I07b98c968ad35bf4c7b3646cb72d870e6b07b0d6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22686
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
4 years agomem: Add Request::isMasked to check for byte strobing
Giacomo Travaglini [Wed, 27 Nov 2019 19:16:26 +0000 (19:16 +0000)]
mem: Add Request::isMasked to check for byte strobing

This is trying to overcome the following problem: At the moment a memory
request with a non empty byteEnable mask will be considered masking even
if all elements in the vector are true.

Change-Id: I16ae2c0ea8c3f3370e397bab9d79d6d60c3784bd
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23284
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem: Add byteEnable copy to Request copy constructor
Giacomo Travaglini [Thu, 28 Nov 2019 13:52:52 +0000 (13:52 +0000)]
mem: Add byteEnable copy to Request copy constructor

Change-Id: Ie97543e62524bb244ae65eef096411af4605c175
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23283
Maintainer: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agotests: Increase jenkins test timeout to 4 hours.
Rahul Thakur [Mon, 9 Dec 2019 05:43:39 +0000 (21:43 -0800)]
tests: Increase jenkins test timeout to 4 hours.

Change-Id: I11d36a429254df01a46040325baff5b7d18e22b3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23463
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv: set MaxMiscDestRegs to 2
Alec Roelke [Fri, 29 Nov 2019 20:41:19 +0000 (15:41 -0500)]
arch-riscv: set MaxMiscDestRegs to 2

In an earlier patch, the FCSR was split into its two components, FRM and
FFLAGS, causing explicit writes to FCSR to incur two CSR writes. With
the O3 CPU model, which defers them both to later, this creates a bug
where an assertion that the number of CSR writes must be less than
MaxMiscDestRegs fails because that constant is 1. This patch sets it to
2 so the O3 CPU is compatible with this scheme.

Change-Id: Ic3413738c4eebe9f127980d0d0af5033d18468e7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23220
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Set the partial linking group for EXTRAS dirs.
Gabe Black [Tue, 3 Dec 2019 01:59:51 +0000 (17:59 -0800)]
scons: Set the partial linking group for EXTRAS dirs.

Partial linking heuristically links together files in the same
directory by setting a special automatic tag. That tag needs to also
be maintained when scanning EXTRAS dirs so that they don't all get
lumped in with the last normal directory that was processed.

Change-Id: I2408ea0a1eeffcf6d9994c36415a35760b225b17
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23300
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoscons: Fixes to improve python 3 support.
Gabe Black [Tue, 3 Dec 2019 01:52:44 +0000 (17:52 -0800)]
scons: Fixes to improve python 3 support.

Some simple fixes to improve python 3 compatability in scons.

Change-Id: I89aba6ed9d73ee733307c57e033c636029d9cb7a
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23264
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoutil: Add a git commit-msg hook
Daniel R. Carvalho [Sun, 29 Sep 2019 12:06:04 +0000 (14:06 +0200)]
util: Add a git commit-msg hook

Add a git commit-msg hook that verifies that commit messages follow
gem5 guidelines.

Commit messages must contain the following components:
    <gem5_tags>: <title>

    <description>
    <patch_tags>

<gem5_tags> are comma separated keywords (found in MAINTAINERS) that
describe which sections of gem5 are being modified by the patch.
Two special keywords can also be used to imply that the author is
looking for feedback on the way their commit was implemented (RFC),
and to inform that the commit is a work in progress (WIP).

<title> A short and concise description of the commit without trailing
whitespaces

<description> is an optional (yet highly recommended) detailed
description of the objective of the commit.

<patch_tags> describe the metadata of the commit, and most of them
are automatically added by Gerrit.

Change-Id: Ib6fb6edf6d1417bfda23729b35c5b8ed44d2cf51
Signed-off-by: Daniel R. Carvalho <odanrc@yahoo.com.br>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/21739
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Bobby R. Bruce <bbruce@ucdavis.edu>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agokvm,arm: Update the KVM ARM v8 CPU to use vector regs.
Gabe Black [Thu, 5 Dec 2019 06:02:30 +0000 (22:02 -0800)]
kvm,arm: Update the KVM ARM v8 CPU to use vector regs.

The exact mapping of the KVM registers and the gem5 registers is direct and
may not actually be correct.

Change-Id: Idb0981105c002e65755f8dfc315dbb95ea9370df
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23402
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv: fix asmtest concurrent issues.
Xin Ouyang [Sun, 17 Nov 2019 01:58:19 +0000 (09:58 +0800)]
arch-riscv: fix asmtest concurrent issues.

riscv asmtest uses multiprocessing.Pool to run multiple gem5
processes concurrently.

By using gem5 default options, processes will fail because:
 - accessing to the same m5out directory
 - listening too many remote gdb ports at the same time

This will set independent m5out directories and disable remote gdb
ports for asmtest gem5 processes.

Change-Id: Ie4c81232210568cd1945adc2b99eebc019d705b6
Signed-off-by: Xin Ouyang <xin.ouyang@streamcomputing.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22863
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-x86: missing override specifier
Andrea Mondelli [Wed, 4 Dec 2019 16:31:24 +0000 (11:31 -0500)]
arch-x86: missing override specifier

Change-Id: I5a6db4632ec5b670cbfeb7d52190a7545c0b985f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23380
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-x86: Adding LDDQU instruction
marjanfariborz [Mon, 2 Dec 2019 23:03:02 +0000 (15:03 -0800)]
arch-x86: Adding LDDQU instruction

Tested with simple c binaries.

Signed-off-by: marjanfariborz <mfariborz@ucdavis.edu>
Change-Id: I2f0852b136f966381d29af523e8ffdbca795afcd
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23262
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Add a suppression mechanism to the SyscallReturn class.
Gabe Black [Fri, 22 Nov 2019 23:38:30 +0000 (15:38 -0800)]
sim: Add a suppression mechanism to the SyscallReturn class.

It makes more sense to specify whether something should be returned
based on the return, not intrinsically on the syscall. This is
especially true in cases like execve where the expected behavior
is not constant.

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

Change-Id: I95b53b6d69445c7a04c0049fbb0f439238d971e8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23166
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Small style fixes in sim/syscall_return.hh.
Gabe Black [Fri, 22 Nov 2019 23:35:28 +0000 (15:35 -0800)]
sim: Small style fixes in sim/syscall_return.hh.

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

Change-Id: I485004843393c2e10c1ff4dbd84fc30ca4fd490c
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23165
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: Change the syscall executor to a std::function.
Gabe Black [Fri, 22 Nov 2019 08:27:52 +0000 (00:27 -0800)]
sim: Change the syscall executor to a std::function.

This will enable using other types of callable like a lambda.

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

Change-Id: If9f7176205492830824b5fe3c00f2c7710f57f70
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23164
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosparc: Fix the getresuidFunc prototype.
Gabe Black [Tue, 3 Dec 2019 10:43:33 +0000 (02:43 -0800)]
sparc: Fix the getresuidFunc prototype.

When the syscall signature was changed to not take a Process pointer,
the prototype for getresuidFunc was not updated.

Change-Id: I887cc3e3aa8483fc608df9963876a0ac6fa2251d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23320
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosparc: Fix the predecoder's moreBytes method.
Gabe Black [Mon, 25 Nov 2019 10:13:58 +0000 (02:13 -0800)]
sparc: Fix the predecoder's moreBytes method.

Endianness transformation was moved from the CPU into this method,
making the "inst" parameter guest endian instead of host endian. The
emi member of the decoder was set using the betoh method, ensuring that
it was still stored in host order. Unfortunately, the "inst" parameter
was used in some places when setting up the rest of emi.

This change replaces those uses of inst with emi.

Change-Id: I0c7f9a1833db4b64fc1a5015cf10f6ba3f7c26a0
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23163
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystemc: Purposefully *expose* bind in the initiator socket.
Gabe Black [Tue, 3 Dec 2019 14:05:08 +0000 (06:05 -0800)]
systemc: Purposefully *expose* bind in the initiator socket.

Apparently the base version of bind actually *is* supposed to be
accessible, so expose it with using instead of hiding it.

Change-Id: Ie762c35d6322e744696ed597189b7773ea68c3b7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23322
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Switch the diagnostic pragmas to GCC from clang.
Gabe Black [Tue, 3 Dec 2019 14:04:15 +0000 (06:04 -0800)]
fastmodel: Switch the diagnostic pragmas to GCC from clang.

Clang can handle both, and GCC throws a fit if it sees pragmas for
clang.

Change-Id: Ie9f2789f45706223b11ed5acdf8b371de6e7ee24
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23321
Reviewed-by: Gabe Black <gabeblack@google.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomisc: CONTRIBUTING.md to advise linking Jira Issues in commits
Bobby R. Bruce [Mon, 2 Dec 2019 20:26:11 +0000 (12:26 -0800)]
misc: CONTRIBUTING.md to advise linking Jira Issues in commits

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

Change-Id: I9fa1471627aed139c0ff207e35a32d9faa82eeb8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23261
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu,sim-se: move error checks in syscall methods
Brandon Potter [Sun, 1 Dec 2019 19:23:22 +0000 (14:23 -0500)]
cpu,sim-se: move error checks in syscall methods

There is a check on a global flag denoting that the simulator
has been configured to run in fullsystem mode. The check is
conducted at runtime during calls to syscall methods.

The high-level models are checking the flag when the check
could be conducted further down the call chain (nearer to the
actual Process invocation). Moving the checks should result
in less copy-pasta as new models are developed. It might be
argued that the checks should stay in place since an error
would detected earlier; that may be true, but the error
would be the same and the simulation should fail in either
case. This arrangement requires fewer lines of code.

The changeset also changes the check into a fatal error
instead of a panic since usage (in fs mode) should result
in immediate corruption.

Change-Id: If387e27f166ac1374f3fe8b7befe3546e69adba7
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23240
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystemc,fastmodel: Use the gem5_scons error and warning functions.
Gabe Black [Tue, 3 Dec 2019 01:50:38 +0000 (17:50 -0800)]
systemc,fastmodel: Use the gem5_scons error and warning functions.

Use them in place of messing with termcap directly.

Change-Id: I093efa95e6b6ea7af198dc1395dce05ca6d6575f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23263
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystemc: Suppress a spurious clang warning in the systemc headers.
Gabe Black [Wed, 27 Nov 2019 12:12:40 +0000 (04:12 -0800)]
systemc: Suppress a spurious clang warning in the systemc headers.

Change-Id: Ife2251d370133383debda9b0439cb84eca80978d
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23126
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystemc: Fix up some lingering Accellera specific code in TLM v1.
Gabe Black [Wed, 27 Nov 2019 12:14:06 +0000 (04:14 -0800)]
systemc: Fix up some lingering Accellera specific code in TLM v1.

This was missed initially, but clang complained about it.

Change-Id: Ie6d240447a74f96faf9da87bd2f1134c1d82be8e
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23128
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>

4 years agobase: add the FmtStackTrace debug option
Ciro Santilli [Mon, 14 Oct 2019 10:42:54 +0000 (11:42 +0100)]
base: add the FmtStackTrace debug option

If given, a stack trace is printed after every debug message.

This helps to localize where debug messages are being called from,
which is often the critical information needed to debug certain
problems.

Change-Id: I82b8990c0d286393d5bdab05f718be3e89eadc40
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22003
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim-se: Avoid function overloading for syscall implementation
Giacomo Travaglini [Mon, 2 Dec 2019 12:39:26 +0000 (12:39 +0000)]
sim-se: Avoid function overloading for syscall implementation

This patch is aligning the readlink and access syscalls to the open one,
which is not overloading the openFunc, but it is factoring the
implementation into a openImpl, which is used by both open and openat.

This is needed if passing them to std::function, whose constructor is
not able to handle overloaded functions.

Change-Id: I50a8aacdfd675181b6fe9a2696220ee29cc5bc4b
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23260
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosystemc: Add a bunch of missing overrides to the systemc headers.
Gabe Black [Wed, 27 Nov 2019 12:11:52 +0000 (04:11 -0800)]
systemc: Add a bunch of missing overrides to the systemc headers.

Change-Id: I664d7b5e7c3b4dd6128d261c95fabaa3d1a97d88
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23125
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agofastmodel: Suppress a spurious warning on clang for amba_pv.h.
Gabe Black [Wed, 27 Nov 2019 12:09:04 +0000 (04:09 -0800)]
fastmodel: Suppress a spurious warning on clang for amba_pv.h.

This header comes from the fast model distribution and so we can't
(easily) disable the warning locally.

Change-Id: I2c1eee48f8970bb17466f0759f0077a5d45e76af
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23123
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv: Fix disassembling of immediate for c.lui instruction
Ian Jiang [Tue, 26 Nov 2019 03:35:07 +0000 (11:35 +0800)]
arch-riscv: Fix disassembling of immediate for c.lui instruction

For compressed instruction c.lui, the 6-bit immediate is left-shifted by 12
bits in decoding. While the original Gem5 gives the left-shifted value
directly in disassembly.
This patch fixes the problem by adding a new template CILuiExecute to
resume the immediate before outputting it in disassembly.
Note: The immediate is sign-extended to 20-bit to be compatible with GCC.

Change-Id: If73f72d3e8f85a8b10ce7a323379d8ad6c4c3085
Signed-off-by: Ian Jiang <ianjiang.ict@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22567
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agodev-arm: Automatically assign PCI device ids in attachPciDevice
Ciro Santilli [Thu, 24 Oct 2019 16:35:13 +0000 (17:35 +0100)]
dev-arm: Automatically assign PCI device ids in attachPciDevice

Simulation scripts currently need to assign PCI device addresses when
adding new devices. This change moves this responsibility to the
VExpress_GEM5_BASE::attachPciDevice method.

Change-Id: I6d62af8a8f9176d964cc011dd8fb9744154bbb87
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22830
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

4 years agodev-arm: device name in AmbaFake accesses
Adrian Herrera [Wed, 16 Oct 2019 09:32:36 +0000 (10:32 +0100)]
dev-arm: device name in AmbaFake accesses

This patch prints the name of the AmbaFake device being accessed.
This is useful for identifying the device triggering the warning.

Change-Id: I69ca06d5d9bce73d918b8c8b46bb43e92597933b
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22847
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Avoid hiding a virtual method in the dictionary compressor.
Gabe Black [Wed, 27 Nov 2019 12:13:11 +0000 (04:13 -0800)]
mem-cache: Avoid hiding a virtual method in the dictionary compressor.

The non-virtual version is later used in overrides of the virtual
version whcih takes more arguments.

Change-Id: I102d1185c7a616337c2a0429daa998706189292f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23127
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agomem-cache: Remove a std::move clang says is unnecessary.
Gabe Black [Wed, 27 Nov 2019 12:10:29 +0000 (04:10 -0800)]
mem-cache: Remove a std::move clang says is unnecessary.

It also says it prevents an optimization.

Change-Id: I9c21dc1a0c53cf70cefd1400564de07d1e845a75
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23124
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarm: Make sure not to shift off of the end of a uint32_t in KVM.
Gabe Black [Wed, 27 Nov 2019 12:55:13 +0000 (04:55 -0800)]
arm: Make sure not to shift off of the end of a uint32_t in KVM.

The methods which set or get an attribute from the virtual GIC use a
shift constant which is 32, but they store their result in a 32 bit
variable and, according to clang, are used to shift 32 bit inputs. This
is undefined behavior in terms of the shift, and will truncate off the
value regardless.

Change-Id: Ie9543ab9e6e1d5f86317a9210d220928b23ffaf8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23129
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>

4 years agobase, python: Allow dirname selection for the interpreter
Giacomo Travaglini [Mon, 25 Nov 2019 14:03:46 +0000 (14:03 +0000)]
base, python: Allow dirname selection for the interpreter

This is the second step towards being able to run dynamically linked
applications when the guest ISA != than host ISA.

Once the guest interpreter is loaded to memory, we are able to redirect
shared object loads through the redirectPath interface.
How do we load the guest interpreter?
The elf file is for example asking for the /lib/ld-linux-aarch64.so
interpreter.
That would point to a valid dynamic linker/loader if guest ISA == host
ISA, but if we are running on X86 we should point to the guest
(aarch64 in the example) toolchain wherever it is installed.

This patch is adding the --interp-dir option to point to the parent
folder of the guest /lib in the host fs.

Change-Id: Id27b97c060008d2e847776a49323d45c8809a27f
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23066
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: Add --redirects for syscall emulation
Giacomo Travaglini [Thu, 21 Nov 2019 09:52:15 +0000 (09:52 +0000)]
configs: Add --redirects for syscall emulation

This is the first step towards being able to run dynamically linked
applications when the guest ISA != than host ISA.

(Like running a arm application on x86)

By using the --redirects command line option it is possible to specify
via CLI a set of path redirections to be used in SE mode.

This is needed when running a dynamically linked binary in
SE mode in a guest ISA different than the host. The linker will look
for SOs (e.g. libc.so) in /lib/, but will only find the host libraries.
With this option we can redirect to the guest toolchain/file system.

Usage:

gem5.opt [example script]
    --redirects /dir1=/path/to/host/dir1 \
    --redirects /dir2=/path/to/host/dir2

Change-Id: I558838be2ad6802891707e9a1cc454786859db15
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23065
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase: Fix DPRINTF_UNCONDITIONAL on gem5.fast
Giacomo Travaglini [Wed, 27 Nov 2019 10:19:21 +0000 (10:19 +0000)]
base: Fix DPRINTF_UNCONDITIONAL on gem5.fast

Change-Id: I1e559f9c5daae1e9af307cd352791c1b1ac9bbdb
Reviewed-by: Ciro Santilli <ciro.santilli@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23108
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: Add root redirect path in SE mode only when set
Giacomo Travaglini [Thu, 21 Nov 2019 09:29:36 +0000 (09:29 +0000)]
configs: Add root redirect path in SE mode only when set

As it is now, the default behaviour, if chroot is not specified, is to
add a redirect path which is simply mappping "/" in guest to "/" in
host.  This patch avoids this unnecessary mapping, and adds a redirect
path to root only if chroot is specified.

Change-Id: Icbe863887330d7071e0005333b408ffc8cad41d6
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23064
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim-se: Check Path redirection when mmapping
Giacomo Travaglini [Fri, 22 Nov 2019 14:12:50 +0000 (14:12 +0000)]
sim-se: Check Path redirection when mmapping

Every syscall file access should go through the redirection process

Change-Id: I1ba2063b5a254e11f47392bdad0bf0887ba73d3d
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23063
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoconfigs: Fix baremetal platform
Giacomo Travaglini [Tue, 26 Nov 2019 16:19:11 +0000 (16:19 +0000)]
configs: Fix baremetal platform

With 224da08be767b51e8148e5f3e6e0da2e2ea77add some MemConfig
functionalities have been moved to the ObjectList module

Change-Id: Iab073b6f8be5a5ea0e49e8974960d7734a5640ba
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/23083
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Daniel Carvalho <odanrc@yahoo.com.br>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agosim: prefix --debug-flags Event logs with the flag name
Ciro Santilli [Fri, 11 Oct 2019 16:03:05 +0000 (17:03 +0100)]
sim: prefix --debug-flags Event logs with the flag name

Sample output of FmtFlag,ExecAll,Event:

   0: Event: Event_70: generic event rescheduled @ 18446744073709551615
   0: ExecEnable: system.cpu: A0 T0 : @asm_main_after_prologue
   0: Event: AtomicSimpleCPU tick.wrapped_function_event
 500: ExecEnable: system.cpu: A0 T0 : @asm_main_after_prologue+4
 500: Event: AtomicSimpleCPU tick.wrapped_function_event
1000: ExecEnable: system.cpu: A0 T0 : @asm_main_after_prologue+8
1000: Event: AtomicSimpleCPU tick.wrapped_function_event
1500: ExecEnable: system.cpu: A0 T0 : @asm_main_after_prologue+12
1500: Event: AtomicSimpleCPU tick.wrapped_function_event

Change-Id: I7f252b57d7778a15a3dda40d909bdb4425557a40
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22009
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agocpu: prefix ExecEnable to the native trace to match DPRINTF
Ciro Santilli [Tue, 8 Oct 2019 13:52:03 +0000 (14:52 +0100)]
cpu: prefix ExecEnable to the native trace to match DPRINTF

The trace mechanism appears to be the only debug flag that does not
go through DPRINTF, presumably for performance reasons.

This patch manually adds that to make things uniform with other debug
flags, e.g. with FmtFlag,ExecAll,SyscallBase a sample output looks like
(truncated to fit into commit message lengths):

   0: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue
 500: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+4
1000: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+8
1500: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+12
2000: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+16
2500: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+20
3000: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+24
3500: ExecEnable: system.cpu : A0 T0 : @asm_main_after_prologue+28

Change-Id: Ic371ebc8b0827656f1b78fcfd3f28505a5100274
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22007
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase: generalize ExecTicks to all messages with FmtTicksOff
Ciro Santilli [Fri, 11 Oct 2019 16:57:14 +0000 (17:57 +0100)]
base: generalize ExecTicks to all messages with FmtTicksOff

If FmtTicksOff is given, ticks are disabled for all log messages.

The original motivation of this is to bring the implementation of native
traces closer to that of other traces to help refactoring done in future
patches.

One additional advantage of this is that sometimes we want to compare
traces of a given program under different conditions, so the start of the
ROI is different, and the different initial timestamp makes a diff
useless by showing differences on every line.

Change-Id: Idd6cb105d301b3b9b064996043f4ca75ddafe0af
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22006
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agobase: create DPRINTF_UNCONDITIONAL
Ciro Santilli [Fri, 11 Oct 2019 16:01:24 +0000 (17:01 +0100)]
base: create DPRINTF_UNCONDITIONAL

This is similar to DPRINTFN, but it also prints a given flag to allow
communicating to users which flag enabled a given log.

This is useful for logs which are enabled with DTRACE instead of directly
with DPRINTF.

Change-Id: Ife2d2ea88aede1cdcb713f143340a8788a755b01
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22005
Tested-by: kokoro <noreply+kokoro@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Reviewed-by: Bobby R. Bruce <bbruce@ucdavis.edu>
Maintainer: Jason Lowe-Power <jason@lowepower.com>

4 years agobase: add the --debug-flag to DPRINTF output with FmtFlag
Ciro Santilli [Tue, 8 Oct 2019 13:31:47 +0000 (14:31 +0100)]
base: add the --debug-flag to DPRINTF output with FmtFlag

This makes it easier to determine which messages come from which
flags when enabling multiple flags at once.

This commit covers the bulk of the debug messages, which use the DPRINTF*
family of macros. There however macros that use DTRACE to check for
enable, those will be covered in future patches.

Change-Id: I6738b18f08ccfd1e11f2874b426c1827b42e82a2
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22004
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-arm: Make the Tarmac parsed registers case insensitive
Giacomo Travaglini [Tue, 8 Oct 2019 16:16:59 +0000 (17:16 +0100)]
arch-arm: Make the Tarmac parsed registers case insensitive

This will make parsing more robust, considering the tarmac
format changes between AA32 and AA64.

Change-Id: I0e4905d70e2e494104706a4c6c75b8169deaecf9
Signed-off-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Andreas Sandberg <andreas.sandberg@arm.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22845
Reviewed-by: Nikos Nikoleris <nikos.nikoleris@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv: Fix immediate decoding for integer shift immediate instructions
Ian Jiang [Mon, 25 Nov 2019 03:30:41 +0000 (11:30 +0800)]
arch-riscv: Fix immediate decoding for integer shift immediate instructions

The "shamt" in integer shift immediate instructions is an unsigned
immediate encoded in bits[25:20]. While the original Gem5 uses bits[31:20]
as an int64_t. This patch fixes the problem by:
- Adding a new parameter "imm_code" for format IOp and use the correct
bitfields SHAMT5 or SHAMT6 to assign "imm_code" for each instruction.
- Use uint64_t instead of default int64_t to assign parameter "imm_type"
of format IOp.

The instructions affected include:
- Shift Left Logical Immediate, slli
- Shift Right Logical Immediate, srli
- Shift Right Arithmetic Immediate, srai
- Shift Left Logical Word Immediate, slliw
- Shift Right Logical Word Immediate, srliw
- Shift Right Arithmetic Word Immediate, sraiw

Change-Id: Iad34ccd036c11630409f84f6de2b939224e100e6
Signed-off-by: Ian Jiang <ianjiang.ict@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22563
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch-riscv: Fix disassembling for fence and fence.i
Ian Jiang [Thu, 14 Nov 2019 08:41:25 +0000 (16:41 +0800)]
arch-riscv: Fix disassembling for fence and fence.i

The original Gem5 does not give correct disassembly for instruction fence
and fence.i. This patch fixes the problem by adding two bitfields PRED and
SUCC and a new format FenceOp and a template FenceExecute, in which
operands are generated based on PRED and SUCC in the disassembling
function.

Change-Id: I78dbf125fef86ce40785c498a318ffb1569da46c
Signed-off-by: Ian Jiang <ianjiang.ict@gmail.com>
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22569
Reviewed-by: Alec Roelke <alec.roelke@gmail.com>
Maintainer: Alec Roelke <alec.roelke@gmail.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarch,cpu: Get rid of ISA_HAS_CC_REGS and its associated ifdefs.
Gabe Black [Tue, 5 Nov 2019 00:27:34 +0000 (16:27 -0800)]
arch,cpu: Get rid of ISA_HAS_CC_REGS and its associated ifdefs.

This conditional compilation was unnecessary and makes gem5 more
brittle and harder to understand.

Change-Id: I63abaf2668252c988cdd4626ff6a462eb6f54b04
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22544
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Gabe Black <gabeblack@google.com>
Tested-by: kokoro <noreply+kokoro@google.com>
4 years agoarm: Stop serializing ISA values wihch are cached from the system.
Gabe Black [Mon, 4 Nov 2019 23:48:52 +0000 (15:48 -0800)]
arm: Stop serializing ISA values wihch are cached from the system.

These values are not really part of the ISA state and could be
retrieved from the system during execution. Also these values are
already being set in the ISA constructor.

Change-Id: Iea5f9bbb27add4ecebc6391da6c1c1e49e76508f
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/22543
Reviewed-by: Giacomo Travaglini <giacomo.travaglini@arm.com>
Maintainer: Giacomo Travaglini <giacomo.travaglini@arm.com>
Tested-by: kokoro <noreply+kokoro@google.com>