diff options
Diffstat (limited to 'src/arch/x86/tlb.hh')
-rw-r--r-- | src/arch/x86/tlb.hh | 43 |
1 files changed, 34 insertions, 9 deletions
diff --git a/src/arch/x86/tlb.hh b/src/arch/x86/tlb.hh index 12739379c..a361c2291 100644 --- a/src/arch/x86/tlb.hh +++ b/src/arch/x86/tlb.hh @@ -59,10 +59,13 @@ #define __ARCH_X86_TLB_HH__ #include <list> +#include <vector> +#include <string> #include "arch/x86/pagetable.hh" #include "arch/x86/segmentregs.hh" #include "config/full_system.hh" +#include "mem/mem_object.hh" #include "mem/request.hh" #include "params/X86DTB.hh" #include "params/X86ITB.hh" @@ -74,16 +77,26 @@ class Packet; namespace X86ISA { + class Walker; + static const unsigned StoreCheck = 1 << NUM_SEGMENTREGS; + class TLB; + class TLB : public SimObject { -#if !FULL_SYSTEM protected: friend class FakeITLBFault; friend class FakeDTLBFault; -#endif + + bool _allowNX; + public: + bool allowNX() const + { + return _allowNX; + } + typedef X86TLBParams Params; TLB(const Params *p); @@ -91,28 +104,38 @@ namespace X86ISA TlbEntry *lookup(Addr va, bool update_lru = true); +#if FULL_SYSTEM protected: - int size; - - TlbEntry * tlb; - typedef std::list<TlbEntry *> EntryList; - EntryList freeList; - EntryList entryList; + Walker * walker; - void insert(Addr vpn, TlbEntry &entry); + void walk(ThreadContext * _tc, Addr vaddr); +#endif + public: void invalidateAll(); void invalidateNonGlobal(); void demapPage(Addr va); + protected: + int size; + + TlbEntry * tlb; + + typedef std::list<TlbEntry *> EntryList; + EntryList freeList; + EntryList entryList; + template<class TlbFault> Fault translate(RequestPtr &req, ThreadContext *tc, bool write, bool execute); public: + + void insert(Addr vpn, TlbEntry &entry); + // Checkpointing virtual void serialize(std::ostream &os); virtual void unserialize(Checkpoint *cp, const std::string §ion); @@ -124,6 +147,7 @@ namespace X86ISA typedef X86ITBParams Params; ITB(const Params *p) : TLB(p) { + _allowNX = false; } Fault translate(RequestPtr &req, ThreadContext *tc); @@ -137,6 +161,7 @@ namespace X86ISA typedef X86DTBParams Params; DTB(const Params *p) : TLB(p) { + _allowNX = true; } Fault translate(RequestPtr &req, ThreadContext *tc, bool write); #if FULL_SYSTEM |