sim-se: Initialize shared page table base upon clone
When the clone syscall is called, a new process is created which allocates a new page table. If clone was called with CLONE_THREAD, the page table of that new process is then marked as shared. Next, initState is called on the process which calls the page table's initState. For the multi level page table, initState only sets the base pointer if shared is false. This means that in this order the base pointer of the new page table is not currently initialized causing spurious errors. To fix this, the page table is explicitly initialized after the new process and new page table are created but before the page table is marked as shared. The process initState continues as normal and the new page table's base pointer is not modified by further calls to initState as it is already marked shared. Change-Id: I4a533e13565fa572fb9153a926f70958bc7488b7 Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/56366 Reviewed-by: Jason Lowe-Power <power.jg@gmail.com> Maintainer: Jason Lowe-Power <power.jg@gmail.com> Reviewed-by: Matt Sinclair <mattdsinclair@gmail.com> Tested-by: kokoro <noreply+kokoro@google.com>
This commit is contained in:
@@ -1672,6 +1672,7 @@ cloneFunc(SyscallDesc *desc, ThreadContext *tc, RegVal flags, RegVal newStack,
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (flags & OS::TGT_CLONE_THREAD) {
|
if (flags & OS::TGT_CLONE_THREAD) {
|
||||||
|
cp->pTable->initState();
|
||||||
cp->pTable->shared = true;
|
cp->pTable->shared = true;
|
||||||
cp->useForClone = true;
|
cp->useForClone = true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user