gem5.git
9 years agox86: Clean up style in process.cc.
Gabe Black [Wed, 3 Dec 2014 06:01:51 +0000 (22:01 -0800)]
x86: Clean up style in process.cc.

9 years agosim: Make it possible to override the breakpoint length check.
Gabe Black [Wed, 3 Dec 2014 11:27:19 +0000 (03:27 -0800)]
sim: Make it possible to override the breakpoint length check.

The check which makes sure the length of the breakpoint being written is the
same as a MachInst is only correct on fixed instruction width ISAs. Instead of
incorrectly applying that check to all ISAs, this change makes that the
default check and lets ISA specific GDB classes override it.

9 years agoconfig: Get rid of some extra spaces around default arguments.
Gabe Black [Wed, 3 Dec 2014 11:11:00 +0000 (03:11 -0800)]
config: Get rid of some extra spaces around default arguments.

9 years agoide: Accept the IDLE (0xe3) ATA command.
Gabe Black [Wed, 3 Dec 2014 11:07:35 +0000 (03:07 -0800)]
ide: Accept the IDLE (0xe3) ATA command.

This command is supposed to set up a timer which will put the drive into a
standby mode if it isn't sent a command within a given time out. Since most of
the timeouts are generally significantly longer than a simulation would run
anyway, and we don't have an implementation for standby mode to begin with,
we can accept the command, do nothing, and report success.

9 years agodev: Support translating left and right ALT keys.
Gabe Black [Wed, 3 Dec 2014 11:06:03 +0000 (03:06 -0800)]
dev: Support translating left and right ALT keys.

This is used primarily for VNC.

9 years agostats: Bump stats for fixes, mostly TLB and WriteInvalidate
Andreas Hansson [Tue, 2 Dec 2014 11:08:25 +0000 (06:08 -0500)]
stats: Bump stats for fixes, mostly TLB and WriteInvalidate

9 years agoscons: Ensure dictionary iteration is sorted by key
Andreas Hansson [Tue, 2 Dec 2014 11:08:22 +0000 (06:08 -0500)]
scons: Ensure dictionary iteration is sorted by key

This patch adds sorting based on the SimObject name or parameter name
for all situations where we iterate over dictionaries. This should
ensure a deterministic and consistent order across the host systems
and hopefully avoid regression results differing across python
versions.

9 years agomem: Support WriteInvalidate (again)
Curtis Dunham [Tue, 2 Dec 2014 11:08:19 +0000 (06:08 -0500)]
mem: Support WriteInvalidate (again)

This patch takes a clean-slate approach to providing WriteInvalidate
(write streaming, full cache line writes without first reading)
support.

Unlike the prior attempt, which took an aggressive approach of directly
writing into the cache before handling the coherence actions, this
approach follows the existing cache flows as closely as possible.

9 years agomem: Remove WriteInvalidate support
Curtis Dunham [Tue, 2 Dec 2014 11:08:17 +0000 (06:08 -0500)]
mem: Remove WriteInvalidate support

Prepare for a different implementation following in the next patch

9 years agocpu: Fix retries on barrier/store in Minor's store buffer
Andrew Bardsley [Tue, 2 Dec 2014 11:08:15 +0000 (06:08 -0500)]
cpu: Fix retries on barrier/store in Minor's store buffer

This patch fixes a case where a store in Minor's store buffer never
leaves the store buffer as it is pre-maturely counted as having been
issued, leading to the store buffer idling.

LSQ::StoreBuffer::numUnissuedAccesses should count the number of accesses
either in memory, or still in the store buffer after being completed.

For stores which are also barriers, the store will stay in the store
buffer for a cycle after it is completed and will be cleaned up by the
barrier clearing code (to ensure that barriers are completed in-order).
To acheive this, numUnissuedAccesses is not decremented when a store-barrier
is issued to memory, but when its barrier effect is cleared.

Without this patch, the correct behaviour happens when a memory transaction
is immediately accepted, but not if it needs a retry.

9 years agocpu: Fix memoryIssueLimit checking in Minor
Andrew Bardsley [Tue, 2 Dec 2014 11:08:13 +0000 (06:08 -0500)]
cpu: Fix memoryIssueLimit checking in Minor

This patch fixes the checking of the number of memory instructions issued
per cycles in the Minor CPU.

9 years agoarm: Fix TLB ignoring faults when table walking
Andrew Bardsley [Tue, 2 Dec 2014 11:08:11 +0000 (06:08 -0500)]
arm: Fix TLB ignoring faults when table walking

This patch fixes a case where the Minor CPU can deadlock due to the lack
of a response to TLB request because of a bug in fault handling in the ARM
table walker.

TableWalker::processWalkWrapper is the scheduler-called wrapper which
handles deferred walks which calls to TableWalker::wait cannot immediately
process.  The handling of faults generated by processWalk{AArch64,LPAE,}
calls in those two functions is is different.  processWalkWrapper ignores
fault returns from processWalk... which can lead to ::finish not being
called on a translation.

This fix provides fault handling in processWalkWrapper similar to that
found in the leaf functions which BaseTLB::Translation::finish.

9 years agoconfig: Fix to SystemC example's event handling
Andrew Bardsley [Tue, 2 Dec 2014 11:08:09 +0000 (06:08 -0500)]
config: Fix to SystemC example's event handling

This patch fixes checkpoint restore in the SystemC hosting example by handling
early PollEvent events correctly before any EventQueue events are posted.

The SystemC event queue handler (SCEventQueue) reports an error if the event
loop is entered with no Events posted.  It is possible for this to happen
after instantiate due to PollEvent events.  This patch separates out
`external' events into a different handler in sc_module.cc to prevent the
error from occurring.

This fix also improves the event handling of asynchronous events by:

    1) Making asynchronous events 'catch up' gem5 time to SystemC
        time to avoid the appearance that events have been lost
        while servicing an asynchronous event that schedules an
        event loop exit event

    2) Add an in_simulate data member to Module to allow the event
        loop to check whether events should be processed or deferred
        until the next time Module::simulate is entered

    3) Cancel pending events around the entry/exit of the event loop
        in Module::simulate

    4) Moving the state initialisation of the example entirely into
        run to correct a problem with early events in checkpoint
        restore.

It is still possible to schedule asynchronous events (and talk PollQueue
actions) while simulate is not running.  This behaviour may stil cause
some problems.

9 years agoconfig: SystemC Gem5Control top level additions
Andrew Bardsley [Tue, 2 Dec 2014 11:08:06 +0000 (06:08 -0500)]
config: SystemC Gem5Control top level additions

This patch cleans up a few style issues and adds a few capabilities to the
SystemC top level 'Gem5Control/Gem5System' mechanism.  These include:

    1) A space to store/retrieve a version string for a model
    2) A mechanism for registering functions to be called at the end of
        elaboration to perform simulation setup tasks in SystemC
    3) Adding setGDBRemotePort to the Gem5Control
    4) Changing the sc_set_time_resolution behaviour to instead check that
        the SystemC time resolution is already acceptable

9 years agostats: Bump stats for o3 LSQ changes
Andreas Hansson [Tue, 2 Dec 2014 11:08:05 +0000 (06:08 -0500)]
stats: Bump stats for o3 LSQ changes

9 years agocpu, o3: Ignored invalidate causing same-address load reordering
Marco Elver [Tue, 2 Dec 2014 11:08:03 +0000 (06:08 -0500)]
cpu, o3: Ignored invalidate causing same-address load reordering

In case the memory subsystem sends a combined response with invalidate
(e.g.  ReadRespWithInvalidate), we cannot ignore the invalidate part
of the response.

If we were to ignore the invalidate part, under certain circumstances
this effectively leads to reordering of loads to the same address
which is not permitted under any memory consistency model implemented
in gem5.

Consider the case where a later load's address is computed before an
earlier load in program order, and is therefore sent to the memory
subsystem first. At some point the earlier load's address is computed
and in doing so correctly marks the later load as a
possibleLoadViolation. In the meantime some other node writes and
sends invalidations to all other nodes. The invalidation races with
the later load's ReadResp, and arrives before ReadResp and is
deferred.  Upon receipt of the ReadResp, the response is changed to
ReadRespWithInvalidate, and sent to the CPU. If we ignore the
invalidate part of the packet, we let the later load read the old
value of the address.  Eventually the earlier load's ReadResp arrives,
but with new data. As there was no invalidate snoop (sunk into the
ReadRespWithInvalidate), and if we did not process the invalidate of
the ReadRespWithInvalidate, we obtain a load reordering.

A similar scenario can be constructed where the earlier load's address
is computed after ReadRespWithInvalidate arrives for the younger
load. In this case hitExternalSnoop needs to be set to true on the
ReadRespWithInvalidate, so that upon knowing the address of the
earlier load, checkViolations will cause the later load to be
squashed.

Finally we must account for the case where both loads are sent to the
memory subsystem (reordered), a snoop invalidate arrives and correctly
sets the later loads fault to ReExec. However, before the CPU
processes the fault, the later load's ReadResp arrives and the
writeback discards the outstanding fault. We must add a check to
ensure that we do not skip any unprocessed faults.

9 years agocpu: Always mask the snoop address when performing lock check
Andreas Hansson [Tue, 2 Dec 2014 11:08:00 +0000 (06:08 -0500)]
cpu: Always mask the snoop address when performing lock check

Ensure the snoop address check is always using a cache-block aligned
address. This patch updates Alpha and Mips to match the other ISAs.

9 years agocpu: Move packet deallocation to recvTimingResp in the O3 CPU
Stephan Diestelhorst [Tue, 2 Dec 2014 11:07:58 +0000 (06:07 -0500)]
cpu: Move packet deallocation to recvTimingResp in the O3 CPU

Move the packet deallocations in the O3 CPU so that the completeDataAccess
deals only with the LSQ specific parts and the generic recvTimingResp frees the
packet in all other cases.

9 years agomem: Relax packet src/dest check and shift onus to crossbar
Andreas Hansson [Tue, 2 Dec 2014 11:07:56 +0000 (06:07 -0500)]
mem: Relax packet src/dest check and shift onus to crossbar

This patch allows objects to get the src/dest of a packet even if it
is not set to a valid port id. This simplifies (ab)using the bridge as
a buffer and latency adapter in situations where the neighbouring
MemObjects are not crossbars.

The checks that were done in the packet are now shifted to the
crossbar where the fields are used to index into the port
arrays. Thus, the carrier of the information is not burdened with
checking, and the crossbar can check not only that the destination is
set, but also that the port index is within limits.

9 years agomem: Clean up packet data allocation
Andreas Hansson [Tue, 2 Dec 2014 11:07:54 +0000 (06:07 -0500)]
mem: Clean up packet data allocation

This patch attempts to make the rules for data allocation in the
packet explicit, understandable, and easy to verify. The constructor
that copies a packet is extended with an additional flag "alloc_data"
to enable the call site to explicitly say whether the newly created
packet is short-lived (a zero-time snoop), or has an unknown life-time
and therefore should allocate its own data (or copy a static pointer
in the case of static data).

The tricky case is the static data. In essence this is a
copy-avoidance scheme where the original source of the request (DMA,
CPU etc) does not ask the memory system to return data as part of the
packet, but instead provides a pointer, and then the memory system
carries this pointer around, and copies the appropriate data to the
location itself. Thus any derived packet actually never copies any
data. As the original source does not copy any data from the response
packet when arriving back at the source, we must maintain the copy of
the original pointer to not break the system. We might want to revisit
this one day and pay the price for a few extra memcpy invocations.

All in all this patch should make it easier to grok what is going on
in the memory system and how data is actually copied (or not).

9 years agomem: Cleanup Packet::checkFunctional and hasData usage
Andreas Hansson [Tue, 2 Dec 2014 11:07:52 +0000 (06:07 -0500)]
mem: Cleanup Packet::checkFunctional and hasData usage

This patch cleans up the use of hasData and checkFunctional in the
packet. The hasData function is unfortunately suggesting that it
checks if the packet has a valid data pointer, when it does in fact
only check if the specific packet type is specified to have a data
payload. The confusion led to a bug in checkFunctional. The latter
function is also tidied up to avoid name overloading.

9 years agomem: Make the requests carried by packets const
Andreas Hansson [Tue, 2 Dec 2014 11:07:50 +0000 (06:07 -0500)]
mem: Make the requests carried by packets const

This adds a basic level of sanity checking to the packet by ensuring
that a request is not modified once the packet is created. The only
issue that had to be worked around is the relaying of
software-prefetches in the cache. The specific situation is now solved
by first copying the request, and then creating a new packet
accordingly.

9 years agomem: Make Request getters const
Andreas Hansson [Tue, 2 Dec 2014 11:07:48 +0000 (06:07 -0500)]
mem: Make Request getters const

This patch tidies up the Request class, making all getters const. The
odd one out is incAccessDepth which is called by the memory system as
packets carry the request around. This is also const to enable the
packet to hold on to a const Request.

9 years agomem: Add checks and explanation for assertMemInhibit usage
Andreas Hansson [Tue, 2 Dec 2014 11:07:46 +0000 (06:07 -0500)]
mem: Add checks and explanation for assertMemInhibit usage

9 years agomem: Assume all dynamic packet data is array allocated
Andreas Hansson [Tue, 2 Dec 2014 11:07:43 +0000 (06:07 -0500)]
mem: Assume all dynamic packet data is array allocated

This patch simplifies how we deal with dynamically allocated data in
the packet, always assuming that it is array allocated, and hence
should be array deallocated (delete[] as opposed to delete). The only
uses of dataDynamic was in the Ruby testers.

The ARRAY_DATA flag in the packet is removed accordingly. No
defragmentation of the flags is done at this point, leaving a gap in
the bit masks.

As the last part the patch, it renames dataDynamicArray to dataDynamic.

9 years agomem: Remove redundant Packet::allocate calls
Andreas Hansson [Tue, 2 Dec 2014 11:07:41 +0000 (06:07 -0500)]
mem: Remove redundant Packet::allocate calls

This patch cleans up the packet memory allocation confusion. The data
is always allocated at the requesting side, when a packet is created
(or copied), and there is never a need for any device to allocate any
space if it is merely responding to a paket. This behaviour is in line
with how SystemC and TLM works as well, thus increasing
interoperability, and matching established conventions.

The redundant calls to Packet::allocate are removed, and the checks in
the function are tightened up to make sure data is only ever allocated
once. There are still some oddities in the packet copy constructor
where we copy the data pointer if it is static (without ownership),
and allocate new space if the data is dynamic (with ownership). The
latter is being worked on further in a follow-on patch.

9 years agomem: Use const pointers for port proxy write functions
Andreas Hansson [Tue, 2 Dec 2014 11:07:38 +0000 (06:07 -0500)]
mem: Use const pointers for port proxy write functions

This patch changes the various write functions in the port proxies
to use const pointers for all sources (similar to how memcpy works).

The one unfortunate aspect is the need for a const_cast in the packet,
to avoid having to juggle a const and a non-const data pointer. This
design decision can always be re-evaluated at a later stage.

9 years agomem: Add const getters for write packet data
Andreas Hansson [Tue, 2 Dec 2014 11:07:36 +0000 (06:07 -0500)]
mem: Add const getters for write packet data

This patch takes a first step in tightening up how we use the data
pointer in write packets. A const getter is added for the pointer
itself (getConstPtr), and a number of member functions are also made
const accordingly. In a range of places throughout the memory system
the new member is used.

The patch also removes the unused isReadWrite function.

9 years agomem: Remove null-check bypassing in Packet::getPtr
Andreas Hansson [Tue, 2 Dec 2014 11:07:34 +0000 (06:07 -0500)]
mem: Remove null-check bypassing in Packet::getPtr

This patch removes the parameter that enables bypassing the null check
in the Packet::getPtr method. A number of call sites assume the value
to be non-null.

The one odd case is the RubyTester, which issues zero-sized
prefetches(!), and despite being reads they had no valid data
pointer. This is now fixed, but the size oddity remains (unless anyone
object or has any good suggestions).

Finally, in the Ruby Sequencer, appropriate checks are made for flush
packets as they have no valid data pointer.

9 years agomem: Add a GDDR5 DRAM config
Omar Naji [Tue, 2 Dec 2014 11:07:32 +0000 (06:07 -0500)]
mem: Add a GDDR5 DRAM config

This patch adds a first cut GDDR5 config to accommodate the users
combining gem5 and GPUSim. The config is based on a SK Hynix
datasheet, and the Nvidia GTX580 specification. Someone from the
GPUSim user-camp should tweak the default page-policy and static
frontend and backend latencies.

9 years agostats: Bump stats after static analysis fixes
Andreas Hansson [Mon, 24 Nov 2014 14:03:39 +0000 (09:03 -0500)]
stats: Bump stats after static analysis fixes

Fixing up the uninitialised values changes two of the x86 Linux boot
regressions slightly.

9 years agomisc: Another round of static analysis fixups
Andreas Hansson [Mon, 24 Nov 2014 14:03:38 +0000 (09:03 -0500)]
misc: Another round of static analysis fixups

Mostly addressing uninitialised members.

9 years agomem: Page Table map api modification
Alexandru Dutu [Mon, 24 Nov 2014 02:01:09 +0000 (18:01 -0800)]
mem: Page Table map api modification

This patch adds uncacheable/cacheable and read-only/read-write attributes to
the map method of PageTableBase. It also modifies the constructor of TlbEntry
structs for all architectures to consider the new attributes.

9 years agomem: Multi Level Page Table bug fix
Alexandru Dutu [Mon, 24 Nov 2014 02:01:09 +0000 (18:01 -0800)]
mem: Multi Level Page Table bug fix

The multi level page table was giving false positives for already mapped
translations. This patch fixes the bogus behavior.

9 years agomem: Page Table long lines
Alexandru Dutu [Mon, 24 Nov 2014 02:01:09 +0000 (18:01 -0800)]
mem: Page Table long lines

Trimmed down all the lines greater than 78 characters.

9 years agoconfig, kvm: Enabling KvmCPU in SE mode
Alexandru Dutu [Mon, 24 Nov 2014 02:01:08 +0000 (18:01 -0800)]
config, kvm: Enabling KvmCPU in SE mode
This patch modifies se.py such that it can now use kvm cpu model.

9 years agox86: Segment initialization to support KvmCPU in SE
Alexandru Dutu [Mon, 24 Nov 2014 02:01:08 +0000 (18:01 -0800)]
x86: Segment initialization to support KvmCPU in SE
This patch sets up low and high privilege code and data segments and places them
in the following order: cs low, ds low, ds, cs, in the GDT. Additionally, a
syscall and page fault handler for KvmCPU in SE mode are defined. The order of
the segment selectors in GDT is required in this manner for interrupt handling
to work properly. Segment initialization is done for all the thread
contexts.

9 years agokvm, x86: Adding support for SE mode execution
Alexandru Dutu [Mon, 24 Nov 2014 02:01:08 +0000 (18:01 -0800)]
kvm, x86: Adding support for SE mode execution
This patch adds methods in KvmCPU model to handle KVM exits caused by syscall
instructions and page faults. These types of exits will be encountered if
KvmCPU is run in SE mode.

9 years agocpuid, x86: Enabling more features in CPUid
Alexandru Dutu [Mon, 24 Nov 2014 02:01:08 +0000 (18:01 -0800)]
cpuid, x86: Enabling more features in CPUid
Adding more features in the CPUid with the purpose of supporting running the
KvmCPU in SE mode.

9 years agoBacked out prior changeset f9fb64a72259
Steve Reinhardt [Mon, 24 Nov 2014 02:00:47 +0000 (18:00 -0800)]
Backed out prior changeset f9fb64a72259

Back out use of importlib to avoid implicitly creating
dependency on Python 2.7.

9 years agoconfig: ruby: Get rid of an "eval" and an "exec" operating on generated code.
Gabe Black [Sun, 23 Nov 2014 13:55:26 +0000 (05:55 -0800)]
config: ruby: Get rid of an "eval" and an "exec" operating on generated code.

We can get the same result using importlib.

9 years agox86: Update stats for the new Linux delay port.
Gabe Black [Sat, 22 Nov 2014 01:22:19 +0000 (17:22 -0800)]
x86: Update stats for the new Linux delay port.

9 years agox86: pc: Put a stub IO device at port 0xed which the kernel can use for delays.
Gabe Black [Sat, 22 Nov 2014 01:22:02 +0000 (17:22 -0800)]
x86: pc: Put a stub IO device at port 0xed which the kernel can use for delays.

There was already a stub device at 0x80, the port traditionally used for an IO
delay. 0x80 is also the port used for POST codes sent by firmware, and that
may have prompted adding this port as a second option.

9 years agoconfigs: small fix to ruby portion of fs.py and se.py
Nilay Vaish [Wed, 19 Nov 2014 01:17:29 +0000 (19:17 -0600)]
configs: small fix to ruby portion of fs.py and se.py
In fs.py the io port controller was being attached to the iobus multiple
times.  This should be done only once.  In se.py, the the option use_map
was being set which no longer exists.

9 years agodev: Use fixed size member variables to describe fixed size PL111 registers.
Gabe Black [Tue, 18 Nov 2014 10:38:23 +0000 (02:38 -0800)]
dev: Use fixed size member variables to describe fixed size PL111 registers.

9 years agovnc: Add a conversion function for bgr888.
Gabe Black [Mon, 17 Nov 2014 09:45:42 +0000 (01:45 -0800)]
vnc: Add a conversion function for bgr888.

9 years agox86: Fix setting segment bases in real mode.
Gabe Black [Mon, 17 Nov 2014 09:00:53 +0000 (01:00 -0800)]
x86: Fix setting segment bases in real mode.

The data size used for actually writing the base value for the segment was the
default size, but really it should set the entire value without any possible
truncation.

9 years agox86: Fix some bugs in the real mode far jmp instruction.
Gabe Black [Mon, 17 Nov 2014 08:20:01 +0000 (00:20 -0800)]
x86: Fix some bugs in the real mode far jmp instruction.

The far pointer should be shifted right to get the selector value, not left.
Also, when calculating the width of the offset, the wrong register was used in
one spot.

9 years agox86: APIC: Only set deliveryStatus if our IPI is going somewhere.
Gabe Black [Mon, 17 Nov 2014 08:19:07 +0000 (00:19 -0800)]
x86: APIC: Only set deliveryStatus if our IPI is going somewhere.

Otherwise the IPI which isn't sent will never arrive, and the deliveryStatus
bit will never be cleared.

9 years agox86: APIC: Fix the getRegArrayBit function.
Gabe Black [Mon, 17 Nov 2014 08:17:06 +0000 (00:17 -0800)]
x86: APIC: Fix the getRegArrayBit function.

The getRegArrayBit function extracts a bit from a series of registers which
are treated as a single large bit array. A previous change had modified the
logic which figured out which bit to extract from ">> 5" to "% 5" which seems
wrong, especially when other, similar functions were changed to use "% 32".

9 years agox86: Update the stats for the x86 FS o3 boot test.
Gabe Black [Mon, 17 Nov 2014 08:16:36 +0000 (00:16 -0800)]
x86: Update the stats for the x86 FS o3 boot test.

9 years agox86: Fix the CPUID Long Mode Address Size function.
Gabe Black [Mon, 17 Nov 2014 07:12:42 +0000 (23:12 -0800)]
x86: Fix the CPUID Long Mode Address Size function.

The value in EAX has an 8 bit field for the linear address size and one for
the physical address size when calling that function. A recent change
implemented it but returned 0xff for both of those fields. That implies that
linear and physical addresses are 255 bits wide which is wrong. When using the
KVM CPU model this causes an error, presumably because some of those bits are
actually reserved, or the CPU or kernel realizes 255 bits is a bad value.

This change makes those values 48.

9 years agoconfig: Fix checkpoint restore in C++ config example
Andrew Bardsley [Fri, 14 Nov 2014 08:54:02 +0000 (03:54 -0500)]
config: Fix checkpoint restore in C++ config example

This patch fixes the checkpoint restore option in the example of C++
configuration (util/cxx_config).

The fix introduces a call to config_manager->startup() (which calls startup
on all SimObjects managed by that manager) to replicate the loop of
SimObject::startup calls in src/python/m5/simulate.py::simulate guarded by
need_startup.  As util/cxx_config/main.cc is a C++ analogue of
src/python/mt/simulate.py, it should make a similar set of calls.

9 years agoarm: Fixes based on UBSan and static analysis
Andreas Hansson [Fri, 14 Nov 2014 08:53:51 +0000 (03:53 -0500)]
arm: Fixes based on UBSan and static analysis

Another churn to clean up undefined behaviour, mostly ARM, but some
parts also touching the generic part of the code base.

Most of the fixes are simply ensuring that proper intialisation. One
of the more subtle changes is the return type of the sign-extension,
which is changed to uint64_t. This is to avoid shifting negative
values (undefined behaviour) in the ISA code.

9 years agomem: Clarify unit of DRAM controller buffer size
Andreas Hansson [Fri, 14 Nov 2014 08:53:48 +0000 (03:53 -0500)]
mem: Clarify unit of DRAM controller buffer size

9 years agostats: Bump regressions to match latest changes
Andreas Hansson [Wed, 12 Nov 2014 14:05:25 +0000 (09:05 -0500)]
stats: Bump regressions to match latest changes

Updates after timezone hick-up and sorting of dictionary items in the
SimObject.

9 years agomem: Delete unused variable in Garnet NetworkLink
Mitch Hayenga [Wed, 12 Nov 2014 14:05:23 +0000 (09:05 -0500)]
mem: Delete unused variable in Garnet NetworkLink

With recent changes OSX clang compilation fails due to an unused variable.

9 years agoarm: Fix timing wakeup with LLSC
Ali Saidi [Wed, 12 Nov 2014 14:05:22 +0000 (09:05 -0500)]
arm: Fix timing wakeup with LLSC

9 years agosim: Sort SimObject descendants and ports
Andreas Hansson [Wed, 12 Nov 2014 14:05:21 +0000 (09:05 -0500)]
sim: Sort SimObject descendants and ports

This patch fixes a number of occurences where the sorting order of the
objects was implementation defined.

9 years agobase: Revert 9277177eccff and use getenv/setenv for UTC time
Andreas Hansson [Wed, 12 Nov 2014 14:05:20 +0000 (09:05 -0500)]
base: Revert 9277177eccff and use getenv/setenv for UTC time

This patch reverts changeset 9277177eccff which does not do what it
was intended to do. In essence, we go back to implementing mkutctime
much like the non-standard timegm extension.

9 years agostats: changes to x86 o3 fs and sparc fs regression tests.
Nilay Vaish [Tue, 11 Nov 2014 20:17:10 +0000 (14:17 -0600)]
stats: changes to x86 o3 fs and sparc fs regression tests.

9 years agox86 isa: This patch attempts an implementation at mwait.
Marc Orr [Thu, 6 Nov 2014 11:42:22 +0000 (05:42 -0600)]
x86 isa: This patch attempts an implementation at mwait.

Mwait works as follows:
1. A cpu monitors an address of interest (monitor instruction)
2. A cpu calls mwait - this loads the cache line into that cpu's cache.
3. The cpu goes to sleep.
4. When another processor requests write permission for the line, it is
   evicted from the sleeping cpu's cache. This eviction is forwarded to the
   sleeping cpu, which then wakes up.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

9 years agotests: A test program for the new mwait implementation.
Marc Orr [Thu, 6 Nov 2014 11:42:21 +0000 (05:42 -0600)]
tests: A test program for the new mwait implementation.

This is a simple test program for the new mwait implemenation. It is uses
m5threads to create to threads of execution in syscall emulation mode that
interact using the mwait instruction.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

9 years agocpu: Minor Draining Bug
Andrew Lukefahr [Thu, 6 Nov 2014 11:42:21 +0000 (05:42 -0600)]
cpu: Minor Draining Bug

Fixes a bug where Minor drains in the midst of committing a
conditional store.

While committing a conditional store, lastCommitWasEndOfMacroop is true
(from the previous instruction) as we still haven't finished the conditional
store. If a drain occurs before the cache response, Minor would check just
lastCommitWasEndOfMacroop, which was true, and set drainState=DrainHaltFetch,
which increases the streamSeqNum.  This caused the conditional store to be
squashed when the memory responded and it completed.  However, to the memory
the store succeeded, while to the instruction sequence it never occurred.

In the case of an LLSC, the instruction sequence will replay the squashed
STREX, which will fail as the cache is no longer in LLSC.  Then the
instruction sequence will loop back to a LDREX, which receives the updated
(incorrect) value.

Committed by: Nilay Vaish <nilay@cs.wisc.edu>

9 years agostats: updates due to changes to ruby
Nilay Vaish [Thu, 6 Nov 2014 11:42:21 +0000 (05:42 -0600)]
stats: updates due to changes to ruby

9 years agoruby: provide a backing store
Nilay Vaish [Thu, 6 Nov 2014 11:42:21 +0000 (05:42 -0600)]
ruby: provide a backing store
Ruby's functional accesses are not guaranteed to succeed as of now.  While
this is not a problem for the protocols that are currently in the mainline
repo, it seems that coherence protocols for gpus rely on a backing store to
supply the correct data.  The aim of this patch is to make this backing store
configurable i.e. it comes into play only when a particular option:
--access-backing-store is invoked.

The backing store has been there since M5 and GEMS were integrated.  The only
difference is that earlier the system used to maintain the backing store and
ruby's copy was write-only.  Sometime last year, we moved to data being
supplied supplied by ruby in SE mode simulations.  And now we have patches on
the reviewboard, which remove ruby's copy of memory altogether and rely
completely on the system's memory to supply data.  This patch adds back a
SimpleMemory member to RubySystem.  This member is used only if the option:
access-backing-store is set to true.  By default, the memory would not be
accessed.

9 years agoruby: interface with classic memory controller
Nilay Vaish [Thu, 6 Nov 2014 11:42:21 +0000 (05:42 -0600)]
ruby: interface with classic memory controller
This patch is the final in the series.  The whole series and this patch in
particular were written with the aim of interfacing ruby's directory controller
with the memory controller in the classic memory system.  This is being done
since ruby's memory controller has not being kept up to date with the changes
going on in DRAMs.  Classic's memory controller is more up to date and
supports multiple different types of DRAM.  This also brings classic and
ruby ever more close.  The patch also changes ruby's memory controller to
expose the same interface.

9 years agoruby: remove the function functionalReadBuffers()
Nilay Vaish [Thu, 6 Nov 2014 11:42:20 +0000 (05:42 -0600)]
ruby: remove the function functionalReadBuffers()
This function was added when I had incorrectly arrived at the conclusion
that such a function can improve the chances of a functional read succeeding.
As was later realized, this is not possible in the current setup.  While the
code using this function was dropped long back, this function was not.  Hence
the patch.

9 years agoruby: coherence protocols: remove data block from dirctory entry
Nilay Vaish [Thu, 6 Nov 2014 11:42:20 +0000 (05:42 -0600)]
ruby: coherence protocols: remove data block from dirctory entry
This patch removes the data block present in the directory entry structure
of each protocol in gem5's mainline.  Firstly, this is required for moving
towards common set of memory controllers for classic and ruby memory systems.
Secondly, the data block was being misused in several places.  It was being
used for having free access to the physical memory instead of calling on the
memory controller.

From now on, the directory controller will not have a direct visibility into
the physical memory.  The Memory Vector object now resides in the
Memory Controller class.  This also means that some significant changes are
being made to the functional accesses in ruby.

9 years agoruby: slicc: allow adding a bool to an int, like C++.
Nilay Vaish [Thu, 6 Nov 2014 11:42:20 +0000 (05:42 -0600)]
ruby: slicc: allow adding a bool to an int, like C++.

9 years agoruby: remove sparse memory.
Nilay Vaish [Thu, 6 Nov 2014 11:42:20 +0000 (05:42 -0600)]
ruby: remove sparse memory.
In my opinion, it creates needless complications in rest of the code.
Also, this structure hinders the move towards common set of code for
physical memory controllers.

9 years agoruby: single physical memory in fs mode
Nilay Vaish [Thu, 6 Nov 2014 11:41:44 +0000 (05:41 -0600)]
ruby: single physical memory in fs mode
Both ruby and the system used to maintain memory copies.  With the changes
carried for programmed io accesses, only one single memory is required for
fs simulations.  This patch sets the copy of memory that used to reside
with the system to null, so that no space is allocated, but address checks
can still be carried out.  All the memory accesses now source and sink values
to the memory maintained by ruby.

9 years agoruby: dma sequencer: remove RubyPort as parent class
Nilay Vaish [Thu, 6 Nov 2014 06:55:09 +0000 (00:55 -0600)]
ruby: dma sequencer: remove RubyPort as parent class
As of now DMASequencer inherits from the RubyPort class.  But the code in
RubyPort class is heavily tailored for the CPU Sequencer.  There are parts of
the code that are not required at all for the DMA sequencer.  Moreover, the
next patch uses the dma sequencer for carrying out memory accesses for all the
io devices.  Hence, it is better to have a leaner dma sequencer.

9 years agotests: Update stats no match.
Ali Saidi [Mon, 3 Nov 2014 16:14:42 +0000 (10:14 -0600)]
tests: Update stats no match.

Bootloader I had on my sytem was an older version with a couple of
instruction differences.

9 years agoarm, tests: Forgot the system.terminal files for the new regressions.
Ali Saidi [Thu, 30 Oct 2014 05:04:12 +0000 (00:04 -0500)]
arm, tests: Forgot the system.terminal files for the new regressions.

9 years agoarm, tests: Add 64-bit ARM regression tests
Ali Saidi [Thu, 30 Oct 2014 04:50:15 +0000 (23:50 -0500)]
arm, tests: Add 64-bit ARM regression tests

9 years agoautomated merge
Ali Saidi [Thu, 30 Oct 2014 04:22:26 +0000 (23:22 -0500)]
automated merge

9 years agotests: Update regressions for the new kernels and various preceeding fixes.
Ali Saidi [Thu, 30 Oct 2014 04:18:29 +0000 (23:18 -0500)]
tests: Update regressions for the new kernels and various preceeding fixes.

9 years agoarm, tests: Update config files to more recent kernels and create 64-bit regressions.
Ali Saidi [Thu, 30 Oct 2014 04:18:27 +0000 (23:18 -0500)]
arm, tests: Update config files to more recent kernels and create 64-bit regressions.

This changes the default ARM system to a Versatile Express-like system that supports
2GB of memory and PCI devices and updates the default kernels/file-systems for
AArch64 ARM systems (64-bit) to support up to 32GB of memory and PCI devices. Some
platforms that are no longer supported have been pruned from the configuration files.

In addition a set of 64-bit ARM regressions have been added to the regression system.

9 years agocpu: Add writeback modeling for drain functionality
Mitch Hayenga [Thu, 30 Oct 2014 04:18:27 +0000 (23:18 -0500)]
cpu: Add writeback modeling for drain functionality

It is possible for the O3 CPU to consider itself drained and
later have a squashed instruction perform a writeback.  This
patch re-adds tracking of in-flight instructions to prevent
falsely signaling a drained event.

9 years agocpu: Add drain check functionality to IEW
Mitch Hayenga [Thu, 30 Oct 2014 04:18:26 +0000 (23:18 -0500)]
cpu: Add drain check functionality to IEW

IEW did not check the instQueue and memDepUnit to ensure
they were drained.  This caused issues when drainSanityCheck()
did check those structures after asserting IEW was drained.

9 years agoarm, mem: Fix drain bug and provide drain prints for more components.
Ali Saidi [Thu, 30 Oct 2014 04:18:26 +0000 (23:18 -0500)]
arm, mem: Fix drain bug and provide drain prints for more components.

9 years agoarm: Fix multi-system AArch64 boot w/caches.
Ali Saidi [Thu, 30 Oct 2014 04:18:26 +0000 (23:18 -0500)]
arm: Fix multi-system AArch64 boot w/caches.

Automatically extract cpu release address from DTB file.
Check SCTLR_EL1 to verify all caches are enabled.

9 years agoarm: fix bare-metal memory setup.
Ali Saidi [Thu, 30 Oct 2014 04:18:26 +0000 (23:18 -0500)]
arm: fix bare-metal memory setup.

The bare-metal configuration option still configured memory with the old scheme
that no-longer works. This change unifies the code so there aren't any differences.

9 years agoarm: Mark some miscregs (timer counter) registers at unverifiable.
Ali Saidi [Thu, 30 Oct 2014 04:18:24 +0000 (23:18 -0500)]
arm: Mark some miscregs (timer counter) registers at unverifiable.

The checker can't verify timer registers, so it should just grab the version
from the executing CPU, otherwise it could get a larger value and diverge
execution.

9 years agocpu: Add support to checker for CACHE_BLOCK_ZERO commands.
Ali Saidi [Thu, 30 Oct 2014 04:18:24 +0000 (23:18 -0500)]
cpu: Add support to checker for CACHE_BLOCK_ZERO commands.

The checker didn't know how to properly validate these new commands.

9 years agocpu: Fix barrier push to store buffer when full bug in Minor
Andrew Bardsley [Thu, 30 Oct 2014 04:18:24 +0000 (23:18 -0500)]
cpu: Fix barrier push to store buffer when full bug in Minor

This patch fixes a bug where a completing load or store which is also a
barrier can push a barrier into the store buffer without first checking
that there is a free slot.

The bug was not fatal but would print a warning that the store buffer
was full when inserting.

9 years agomem: don't inhibit WriteInv's or defer snoops on their MSHRs
Curtis Dunham [Tue, 21 Oct 2014 22:04:41 +0000 (17:04 -0500)]
mem: don't inhibit WriteInv's or defer snoops on their MSHRs

WriteInvalidate semantics depend on the unconditional writeback
or they won't complete.  Also, there's no point in deferring snoops
on their MSHRs, as they don't get new data at the end of their life
cycle the way other transactions do.

Add comment in the cache about a minor inefficiency re: WriteInvalidate.

9 years agomem: have WriteInvalidate obsolete MSHRs
Curtis Dunham [Thu, 30 Oct 2014 04:18:24 +0000 (23:18 -0500)]
mem: have WriteInvalidate obsolete MSHRs

Since WriteInvalidate directly writes into the cache, it can
create tricky timing interleavings with reads and writes to the
same cache line that haven't yet completed.  This patch ensures
that these requests, when completed, don't overwrite the newer
data from the WriteInvalidate.

9 years agosyscall_emul: add retry flag to SyscallReturn
Steve Reinhardt [Tue, 2 Sep 2014 21:07:50 +0000 (16:07 -0500)]
syscall_emul: add retry flag to SyscallReturn

This hook allows blocking emulated system calls to indicate
that they would block, but return control to the simulator
so that the simulation does not hang.  The actual retry
functionality requires additional support, to be provided
in a future changeset.

9 years agosyscall_emul: minor style fix to LiveProcess constructor
Steve Reinhardt [Wed, 22 Oct 2014 22:53:34 +0000 (15:53 -0700)]
syscall_emul: minor style fix to LiveProcess constructor

9 years agosyscall_emul: devirtualize BaseBufferArg methods
Steve Reinhardt [Wed, 22 Oct 2014 22:53:34 +0000 (15:53 -0700)]
syscall_emul: devirtualize BaseBufferArg methods

Not clear why they were marked virtual to begin with,
but that doesn't appear to be necessary.

9 years agosyscall_emul: Put BufferArg classes in a separate header.
Steve Reinhardt [Wed, 22 Oct 2014 22:53:34 +0000 (15:53 -0700)]
syscall_emul: Put BufferArg classes in a separate header.

Move the BufferArg classes that support syscall buffer args
(i.e., pointers into simulated user space) out of syscall_emul.hh
and into a new header syscall_emul_buf.hh so they are accessible
to emulated driver implementations.

Take the opportunity to add some comments as well.

9 years agosyscall_emul: add EmulatedDriver object
Steve Reinhardt [Wed, 22 Oct 2014 22:53:34 +0000 (15:53 -0700)]
syscall_emul: add EmulatedDriver object

Fake SE-mode device drivers can now be added by
deriving from this abstract object.

9 years agosim: revert 6709bbcf564d
Nilay Vaish [Wed, 22 Oct 2014 20:59:57 +0000 (15:59 -0500)]
sim: revert 6709bbcf564d
The identifier SYS_getdents is not available on Mac OS X.  Therefore, its use
results in compilation failure.  It seems there is no straight forward way to
implement the system call getdents using readdir() or similar C functions.
Hence the commit 6709bbcf564d is being rolled back.

9 years agox86: Fixes to avoid LTO warnings
Andreas Hansson [Mon, 20 Oct 2014 22:03:56 +0000 (18:03 -0400)]
x86: Fixes to avoid LTO warnings

This patch fixes a few minor issues that caused link-time warnings
when using LTO, mainly for x86. The most important change is how the
syscall array is created. Previously gcc and clang would complain that
the declaration and definition types did not match. The organisation
is now changed to match how it is done for ARM, moving the code that
was previously in syscalls.cc into process.cc, and having a class
variable pointing to the static array.

With these changes, there are no longer any warnings using gcc 4.6.3
with LTO.

9 years agomisc: Use gmtime for conversion to UTC to avoid getenv/setenv
Andreas Hansson [Mon, 20 Oct 2014 22:03:55 +0000 (18:03 -0400)]
misc: Use gmtime for conversion to UTC to avoid getenv/setenv

This patch changes how we turn time into UTC. Previously we
manipulated the TZ environment variable, but this has issues as the
strings that are manipulated could be tainted (see e.g. CERT
ENV34-C). Now we simply rely on the built-in gmtime function and avoid
touching getenv/setenv all together.

9 years agomem: Fix DRAM activationlLimit bug
Omar Naji [Mon, 20 Oct 2014 22:03:55 +0000 (18:03 -0400)]
mem: Fix DRAM activationlLimit bug

Ensure that we do the proper event scheduling also when the activation
limit is disabled.

9 years agobase: Fix for stats node on gcc < 4.6.3
Andreas Hansson [Mon, 20 Oct 2014 22:03:54 +0000 (18:03 -0400)]
base: Fix for stats node on gcc < 4.6.3

This patch adds an explicit function to get the underlying node as gcc
4.6.1 and 4.6.2 have issues otherwise.

9 years agoext: Bump DRAMPower to avoid compilation issues
Andreas Hansson [Mon, 20 Oct 2014 22:03:53 +0000 (18:03 -0400)]
ext: Bump DRAMPower to avoid compilation issues

This patch bumps DRAMPower to commit
19433a6897ede4bbb19b06694faa8589b5a6569a which contains a small fix
for clang, and a work-around for LTO with gcc 4.6.