From ad0056d2e811284870edcc5350db9fa3dbff6f2e Mon Sep 17 00:00:00 2001 From: Gabe Black Date: Fri, 22 Dec 2017 17:14:47 -0800 Subject: [PATCH] arch,mem: Remove the default value for page size. MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit This breaks one more architecture dependence outside of the ISAs. Change-Id: I071f9ed73aef78e1cd1752247c183e30854b2d28 Reviewed-on: https://gem5-review.googlesource.com/6982 Maintainer: Gabe Black Reviewed-by: Alexandru Duțu Reviewed-by: Jason Lowe-Power Reviewed-by: Brandon Potter --- src/arch/alpha/process.cc | 3 ++- src/arch/arm/process.cc | 3 ++- src/arch/mips/process.cc | 3 ++- src/arch/power/process.cc | 3 ++- src/arch/riscv/process.cc | 4 +++- src/arch/sparc/process.cc | 5 +++-- src/arch/x86/process.cc | 5 +++-- src/mem/multi_level_page_table.hh | 2 +- src/mem/multi_level_page_table_impl.hh | 5 +++-- src/mem/page_table.hh | 6 ++---- 10 files changed, 23 insertions(+), 16 deletions(-) diff --git a/src/arch/alpha/process.cc b/src/arch/alpha/process.cc index 3cc0b0daf..bcfe36270 100644 --- a/src/arch/alpha/process.cc +++ b/src/arch/alpha/process.cc @@ -49,7 +49,8 @@ using namespace AlphaISA; using namespace std; AlphaProcess::AlphaProcess(ProcessParams *params, ObjectFile *objFile) - : Process(params, new FuncPageTable(params->name, params->pid), objFile) + : Process(params, new FuncPageTable(params->name, params->pid, PageBytes), + objFile) { fatal_if(!params->useArchPT, "Arch page tables not implemented."); Addr brk_point = objFile->dataBase() + objFile->dataSize() + diff --git a/src/arch/arm/process.cc b/src/arch/arm/process.cc index b64579a5d..5daa54a1f 100644 --- a/src/arch/arm/process.cc +++ b/src/arch/arm/process.cc @@ -63,7 +63,8 @@ using namespace ArmISA; ArmProcess::ArmProcess(ProcessParams *params, ObjectFile *objFile, ObjectFile::Arch _arch) - : Process(params, new FuncPageTable(params->name, params->pid), objFile), + : Process(params, new FuncPageTable(params->name, params->pid, PageBytes), + objFile), arch(_arch) { fatal_if(!params->useArchPT, "Arch page tables not implemented."); diff --git a/src/arch/mips/process.cc b/src/arch/mips/process.cc index f3b1108f4..76f7e869c 100644 --- a/src/arch/mips/process.cc +++ b/src/arch/mips/process.cc @@ -50,7 +50,8 @@ using namespace std; using namespace MipsISA; MipsProcess::MipsProcess(ProcessParams *params, ObjectFile *objFile) - : Process(params, new FuncPageTable(params->name, params->pid), objFile) + : Process(params, new FuncPageTable(params->name, params->pid, PageBytes), + objFile) { fatal_if(!params->useArchPT, "Arch page tables not implemented."); // Set up stack. On MIPS, stack starts at the top of kuseg diff --git a/src/arch/power/process.cc b/src/arch/power/process.cc index 87e5bac9e..343cd4b4e 100644 --- a/src/arch/power/process.cc +++ b/src/arch/power/process.cc @@ -50,7 +50,8 @@ using namespace std; using namespace PowerISA; PowerProcess::PowerProcess(ProcessParams *params, ObjectFile *objFile) - : Process(params, new FuncPageTable(params->name, params->pid), objFile) + : Process(params, new FuncPageTable(params->name, params->pid, PageBytes), + objFile) { fatal_if(!params->useArchPT, "Arch page tables not implemented."); // Set up break point (Top of Heap) diff --git a/src/arch/riscv/process.cc b/src/arch/riscv/process.cc index 88a093a06..44b276a4b 100644 --- a/src/arch/riscv/process.cc +++ b/src/arch/riscv/process.cc @@ -60,7 +60,9 @@ using namespace std; using namespace RiscvISA; RiscvProcess::RiscvProcess(ProcessParams *params, ObjectFile *objFile) : - Process(params, new FuncPageTable(params->name, params->pid), objFile) + Process(params, new FuncPageTable(params->name, params->pid, + PageBytes), + objFile) { fatal_if(!params->useArchPT, "Arch page tables not implemented."); const Addr stack_base = 0x7FFFFFFFFFFFFFFFL; diff --git a/src/arch/sparc/process.cc b/src/arch/sparc/process.cc index fe91589d0..59ef5c4ac 100644 --- a/src/arch/sparc/process.cc +++ b/src/arch/sparc/process.cc @@ -56,8 +56,9 @@ static const int FirstArgumentReg = 8; SparcProcess::SparcProcess(ProcessParams *params, ObjectFile *objFile, Addr _StackBias) - : Process(params, new FuncPageTable(params->name, params->pid), objFile), - StackBias(_StackBias) + : Process(params, new FuncPageTable(params->name, params->pid, PageBytes), + objFile), + StackBias(_StackBias) { fatal_if(!params->useArchPT, "Arch page tables not implemented."); // Initialize these to 0s diff --git a/src/arch/x86/process.cc b/src/arch/x86/process.cc index f11cc3438..bea002d34 100644 --- a/src/arch/x86/process.cc +++ b/src/arch/x86/process.cc @@ -101,9 +101,10 @@ X86Process::X86Process(ProcessParams *params, ObjectFile *objFile, : Process(params, params->useArchPT ? static_cast( new ArchPageTable(params->name, params->pid, - params->system)) : + params->system, PageBytes)) : static_cast( - new FuncPageTable(params->name, params->pid)), + new FuncPageTable(params->name, params->pid, + PageBytes)), objFile), syscallDescs(_syscallDescs), numSyscallDescs(_numSyscallDescs) { diff --git a/src/mem/multi_level_page_table.hh b/src/mem/multi_level_page_table.hh index 402c37126..0e079b730 100644 --- a/src/mem/multi_level_page_table.hh +++ b/src/mem/multi_level_page_table.hh @@ -140,7 +140,7 @@ class MultiLevelPageTable : public PageTableBase public: MultiLevelPageTable(const std::string &__name, uint64_t _pid, - System *_sys); + System *_sys, Addr pageSize); ~MultiLevelPageTable(); void initState(ThreadContext* tc) override; diff --git a/src/mem/multi_level_page_table_impl.hh b/src/mem/multi_level_page_table_impl.hh index 7cd32db16..4ff5f5c61 100644 --- a/src/mem/multi_level_page_table_impl.hh +++ b/src/mem/multi_level_page_table_impl.hh @@ -46,8 +46,9 @@ using namespace TheISA; template MultiLevelPageTable::MultiLevelPageTable(const std::string &__name, - uint64_t _pid, System *_sys) - : PageTableBase(__name, _pid), system(_sys), + uint64_t _pid, System *_sys, + Addr pageSize) + : PageTableBase(__name, _pid, pageSize), system(_sys), logLevelSize(PageTableLayout), numLevels(logLevelSize.size()) { diff --git a/src/mem/page_table.hh b/src/mem/page_table.hh index 883b47cdc..f784b2166 100644 --- a/src/mem/page_table.hh +++ b/src/mem/page_table.hh @@ -73,8 +73,7 @@ class PageTableBase : public Serializable public: - PageTableBase(const std::string &__name, uint64_t _pid, - Addr _pageSize = TheISA::PageBytes) + PageTableBase(const std::string &__name, uint64_t _pid, Addr _pageSize) : pageSize(_pageSize), offsetMask(mask(floorLog2(_pageSize))), pid(_pid), _name(__name) { @@ -211,8 +210,7 @@ class FuncPageTable : public PageTableBase public: - FuncPageTable(const std::string &__name, uint64_t _pid, - Addr _pageSize = TheISA::PageBytes); + FuncPageTable(const std::string &__name, uint64_t _pid, Addr _pageSize); ~FuncPageTable(); -- 2.30.2