diff options
author | Alexandru Dutu <alexandru.dutu@amd.com> | 2019-04-15 23:36:36 -0400 |
---|---|---|
committer | Alexandru Duțu <alexandru.dutu@amd.com> | 2019-04-22 23:11:31 +0000 |
commit | c5b3db6da28611280c291d9e0540f087cf55a54e (patch) | |
tree | 71506b9c6f2f6b0fc5d4a3361ee2e247cf518805 /src/mem | |
parent | 382263c6706296fee2548f74fd4b811553106dba (diff) | |
download | gem5-c5b3db6da28611280c291d9e0540f087cf55a54e.tar.xz |
sim-se: Enhance clone for X86KvmCPU
This changeset enables clone to work with X86KvmCPU model, which
will allow running multi-threaded applications at near hardware
speeds. Even though the application is multi-threaded, the KvmCPU
model uses one event queue, therefore, only one hardware thread
will be used, through KVM, to simulate multiple application threads.
Change-Id: I2b2a7b1edb1c56eeb9c4fa0553cd236029cd53f8
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/18268
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Maintainer: Jason Lowe-Power <jason@lowepower.com>
Tested-by: kokoro <noreply+kokoro@google.com>
Diffstat (limited to 'src/mem')
-rw-r--r-- | src/mem/multi_level_page_table.hh | 3 | ||||
-rw-r--r-- | src/mem/page_table.hh | 5 |
2 files changed, 7 insertions, 1 deletions
diff --git a/src/mem/multi_level_page_table.hh b/src/mem/multi_level_page_table.hh index bd40d37c1..f517eafe8 100644 --- a/src/mem/multi_level_page_table.hh +++ b/src/mem/multi_level_page_table.hh @@ -204,6 +204,9 @@ public: void initState(ThreadContext* tc) override { + if (shared) + return; + _basePtr = prepTopTable<EntryTypes...>(system, pageSize); } diff --git a/src/mem/page_table.hh b/src/mem/page_table.hh index 447d3a50f..03e18c2d0 100644 --- a/src/mem/page_table.hh +++ b/src/mem/page_table.hh @@ -75,7 +75,7 @@ class EmulationPageTable : public Serializable EmulationPageTable( const std::string &__name, uint64_t _pid, Addr _pageSize) : pageSize(_pageSize), offsetMask(mask(floorLog2(_pageSize))), - _pid(_pid), _name(__name) + _pid(_pid), _name(__name), shared(false) { assert(isPowerOf2(pageSize)); } @@ -96,6 +96,9 @@ class EmulationPageTable : public Serializable ReadOnly = 8, }; + // flag which marks the page table as shared among software threads + bool shared; + virtual void initState(ThreadContext* tc) {}; // for DPRINTF compatibility |