x86, mem: Pass the multi level page table layout in as a parameter.
authorGabe Black <gabeblack@google.com>
Sat, 6 Jan 2018 01:48:40 +0000 (17:48 -0800)
committerGabe Black <gabeblack@google.com>
Sat, 20 Jan 2018 08:07:23 +0000 (08:07 +0000)
Don't get it from a global constant declared in an ISA header file.

Change-Id: Ie19440abdd76500a5e12e6791e6f755ad9e95af3
Reviewed-on: https://gem5-review.googlesource.com/7344
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Brandon Potter <Brandon.Potter@amd.com>
Reviewed-by: Alexandru Duțu <alexandru.dutu@amd.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
src/arch/x86/process.cc
src/mem/multi_level_page_table.hh
src/mem/multi_level_page_table_impl.hh

index 52255af7ab7b30425919e8788f7835a9a5c1eaf2..627750cbd5f8ba024e7f2dfa502c29e8ba70d9ea 100644 (file)
@@ -101,7 +101,8 @@ X86Process::X86Process(ProcessParams *params, ObjectFile *objFile,
     : Process(params, params->useArchPT ?
                       static_cast<EmulationPageTable *>(
                               new ArchPageTable(params->name, params->pid,
-                                                params->system, PageBytes)) :
+                                                params->system, PageBytes,
+                                                PageTableLayout)) :
                       new EmulationPageTable(params->name, params->pid,
                                              PageBytes),
               objFile),
index 10e411eb1abe642e0421539ddac952d47af7121a..f71dc0dbc42fa05dc5f9e38e2be2bbd3a1c1a073 100644 (file)
@@ -139,7 +139,8 @@ class MultiLevelPageTable : public EmulationPageTable
 
 public:
     MultiLevelPageTable(const std::string &__name, uint64_t _pid,
-                        System *_sys, Addr pageSize);
+                        System *_sys, Addr pageSize,
+                        const std::vector<uint8_t> &layout);
     ~MultiLevelPageTable();
 
     void initState(ThreadContext* tc) override;
index 3222f5f11d86d738087c37f3e00499e509088d07..2d7ddc4e4c7867c01f7408fa66e400277b8cd74c 100644 (file)
@@ -45,11 +45,11 @@ using namespace std;
 using namespace TheISA;
 
 template <class ISAOps>
-MultiLevelPageTable<ISAOps>::MultiLevelPageTable(const std::string &__name,
-                                                 uint64_t _pid, System *_sys,
-                                                 Addr pageSize)
+MultiLevelPageTable<ISAOps>::MultiLevelPageTable(
+        const std::string &__name, uint64_t _pid, System *_sys,
+        Addr pageSize, const std::vector<uint8_t> &layout)
     : EmulationPageTable(__name, _pid, pageSize), system(_sys),
-    logLevelSize(PageTableLayout),
+    logLevelSize(layout),
     numLevels(logLevelSize.size())
 {
 }