diff options
author | Gabe Black <gabeblack@google.com> | 2017-12-22 01:07:55 -0800 |
---|---|---|
committer | Gabe Black <gabeblack@google.com> | 2017-12-22 23:16:03 +0000 |
commit | b7618c69a511e3fde5cdb674a91e5683f92e770f (patch) | |
tree | e7f472f1014db9e41a98a5b7df759d88db917742 /src/cpu/o3 | |
parent | 4ac0a01e2fdeee8f17d15636409acd7208d9187e (diff) | |
download | gem5-b7618c69a511e3fde5cdb674a91e5683f92e770f.tar.xz |
arch,cpu: "virtualize" the TLB interface.
CPUs have historically instantiated the architecture specific version
of the TLBs to avoid a virtual function call, making them a little bit
more dependent on what the current ISA is. Some simple performance
measurement, the x86 twolf regression on the atomic CPU, shows that
there isn't actually any performance benefit, and if anything the
simulator goes slightly faster (although still within margin of error)
when the TLB functions are virtual.
This change switches everything outside of the architectures themselves
to use the generic BaseTLB type, and then inside the ISA for them to
cast that to their architecture specific type to call into architecture
specific interfaces.
The ARM TLB needed the most adjustment since it was using non-standard
translation function signatures. Specifically, they all took an extra
"type" parameter which defaulted to normal, and translateTiming
returned a Fault. translateTiming actually doesn't need to return a
Fault because everywhere that consumed it just stored it into a
structure which it then deleted(?), and the fault is stored in the
Translation object when the translation is done.
A little more work is needed to fully obviate the arch/tlb.hh header,
so the TheISA::TLB type is still visible outside of the ISAs.
Specifically, the TlbEntry type is used in the generic PageTable which
lives in src/mem.
Change-Id: I51b68ee74411f9af778317eff222f9349d2ed575
Reviewed-on: https://gem5-review.googlesource.com/6921
Maintainer: Gabe Black <gabeblack@google.com>
Reviewed-by: Jason Lowe-Power <jason@lowepower.com>
Diffstat (limited to 'src/cpu/o3')
-rw-r--r-- | src/cpu/o3/cpu.hh | 4 | ||||
-rw-r--r-- | src/cpu/o3/fetch_impl.hh | 2 | ||||
-rwxr-xr-x | src/cpu/o3/thread_context.hh | 4 |
3 files changed, 5 insertions, 5 deletions
diff --git a/src/cpu/o3/cpu.hh b/src/cpu/o3/cpu.hh index 28ccd15b0..10af087d1 100644 --- a/src/cpu/o3/cpu.hh +++ b/src/cpu/o3/cpu.hh @@ -123,8 +123,8 @@ class FullO3CPU : public BaseO3CPU SwitchedOut }; - TheISA::TLB * itb; - TheISA::TLB * dtb; + BaseTLB *itb; + BaseTLB *dtb; /** Overall CPU status. */ Status _status; diff --git a/src/cpu/o3/fetch_impl.hh b/src/cpu/o3/fetch_impl.hh index 0cf8a47a7..6cca77a87 100644 --- a/src/cpu/o3/fetch_impl.hh +++ b/src/cpu/o3/fetch_impl.hh @@ -51,8 +51,8 @@ #include <map> #include <queue> +#include "arch/generic/tlb.hh" #include "arch/isa_traits.hh" -#include "arch/tlb.hh" #include "arch/utility.hh" #include "arch/vtophys.hh" #include "base/random.hh" diff --git a/src/cpu/o3/thread_context.hh b/src/cpu/o3/thread_context.hh index ac4ceed02..2256a8a14 100755 --- a/src/cpu/o3/thread_context.hh +++ b/src/cpu/o3/thread_context.hh @@ -79,10 +79,10 @@ class O3ThreadContext : public ThreadContext O3ThreadState<Impl> *thread; /** Returns a pointer to the ITB. */ - TheISA::TLB *getITBPtr() { return cpu->itb; } + BaseTLB *getITBPtr() { return cpu->itb; } /** Returns a pointer to the DTB. */ - TheISA::TLB *getDTBPtr() { return cpu->dtb; } + BaseTLB *getDTBPtr() { return cpu->dtb; } CheckerCPU *getCheckerCpuPtr() { return NULL; } |