summaryrefslogtreecommitdiff
path: root/src/arch
diff options
context:
space:
mode:
authorTuan Ta <qtt2@cornell.edu>2018-04-02 15:19:40 -0400
committerTuan Ta <qtt2@cornell.edu>2019-02-06 18:41:49 +0000
commit02dafc5498750d9734ba8f2a1608a846f90b71d1 (patch)
treee955d25ed5c54939233110ec0c75a0d2e21f46e7 /src/arch
parent8efcc0faac252d716704b5f8f9f3e1c165910ebe (diff)
downloadgem5-02dafc5498750d9734ba8f2a1608a846f90b71d1.tar.xz
cpu: fix how a thread starts up in MinorCPU
When a thread is activated by another thread calling a clone system call, the child thread's context is initialized in the middle of the clone system call and before the context is fully initialized. Therefore, the child thread starts fetching an unitialized PC, which could lead to a page fault. This patch adds a pipeline wakeup event that is scheduled later in the cycle when the thread is activated. This event ensures that the first fetch only happens after the thread context is fully initialized (e.g., in case of clone syscall, it is when the parent thread copies its context over to the child thread). When a thread first starts or wakes up, input queue to the Fetch2 stage needs to be drained since the execution flow is likely to change and previously fetched instructions in the queue may no longer be in the correct flow. This patch dumps/drains all inputs in the input queue of a thread context in the Fetch2 stage when the associated thread wakes up. Change-Id: Iad970638e435858b7289cd471158cc0afdbbb0e5 Reviewed-on: https://gem5-review.googlesource.com/c/8182 Reviewed-by: Brandon Potter <Brandon.Potter@amd.com> Reviewed-by: Jason Lowe-Power <jason@lowepower.com> Maintainer: Brandon Potter <Brandon.Potter@amd.com>
Diffstat (limited to 'src/arch')
0 files changed, 0 insertions, 0 deletions