tlb.hh revision 10463
16019Shines@cs.fsu.edu/*
210037SARM gem5 Developers * Copyright (c) 2010-2013 ARM Limited
37399SAli.Saidi@ARM.com * All rights reserved
47399SAli.Saidi@ARM.com *
57399SAli.Saidi@ARM.com * The license below extends only to copyright in the software and shall
67399SAli.Saidi@ARM.com * not be construed as granting a license to any other intellectual
77399SAli.Saidi@ARM.com * property including but not limited to intellectual property relating
87399SAli.Saidi@ARM.com * to a hardware implementation of the functionality of the software
97399SAli.Saidi@ARM.com * licensed hereunder.  You may use the software subject to the license
107399SAli.Saidi@ARM.com * terms below provided that you ensure that this notice is replicated
117399SAli.Saidi@ARM.com * unmodified and in its entirety in all distributions of the software,
127399SAli.Saidi@ARM.com * modified or unmodified, in source code or in binary form.
137399SAli.Saidi@ARM.com *
146019Shines@cs.fsu.edu * Copyright (c) 2001-2005 The Regents of The University of Michigan
156019Shines@cs.fsu.edu * All rights reserved.
166019Shines@cs.fsu.edu *
176019Shines@cs.fsu.edu * Redistribution and use in source and binary forms, with or without
186019Shines@cs.fsu.edu * modification, are permitted provided that the following conditions are
196019Shines@cs.fsu.edu * met: redistributions of source code must retain the above copyright
206019Shines@cs.fsu.edu * notice, this list of conditions and the following disclaimer;
216019Shines@cs.fsu.edu * redistributions in binary form must reproduce the above copyright
226019Shines@cs.fsu.edu * notice, this list of conditions and the following disclaimer in the
236019Shines@cs.fsu.edu * documentation and/or other materials provided with the distribution;
246019Shines@cs.fsu.edu * neither the name of the copyright holders nor the names of its
256019Shines@cs.fsu.edu * contributors may be used to endorse or promote products derived from
266019Shines@cs.fsu.edu * this software without specific prior written permission.
276019Shines@cs.fsu.edu *
286019Shines@cs.fsu.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
296019Shines@cs.fsu.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
306019Shines@cs.fsu.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
316019Shines@cs.fsu.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
326019Shines@cs.fsu.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
336019Shines@cs.fsu.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
346019Shines@cs.fsu.edu * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
356019Shines@cs.fsu.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
366019Shines@cs.fsu.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
376019Shines@cs.fsu.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
386019Shines@cs.fsu.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
396019Shines@cs.fsu.edu *
407399SAli.Saidi@ARM.com * Authors: Ali Saidi
416019Shines@cs.fsu.edu */
426019Shines@cs.fsu.edu
436019Shines@cs.fsu.edu#ifndef __ARCH_ARM_TLB_HH__
446019Shines@cs.fsu.edu#define __ARCH_ARM_TLB_HH__
456019Shines@cs.fsu.edu
466019Shines@cs.fsu.edu
476019Shines@cs.fsu.edu#include "arch/arm/isa_traits.hh"
488229Snate@binkert.org#include "arch/arm/pagetable.hh"
496019Shines@cs.fsu.edu#include "arch/arm/utility.hh"
506019Shines@cs.fsu.edu#include "arch/arm/vtophys.hh"
516019Shines@cs.fsu.edu#include "base/statistics.hh"
5210037SARM gem5 Developers#include "dev/dma_device.hh"
536019Shines@cs.fsu.edu#include "mem/request.hh"
546116Snate@binkert.org#include "params/ArmTLB.hh"
557878Sgblack@eecs.umich.edu#include "sim/fault_fwd.hh"
5610463SAndreas.Sandberg@ARM.com#include "sim/probe/pmu.hh"
576019Shines@cs.fsu.edu#include "sim/tlb.hh"
586019Shines@cs.fsu.edu
596019Shines@cs.fsu.educlass ThreadContext;
606019Shines@cs.fsu.edu
616019Shines@cs.fsu.edunamespace ArmISA {
626019Shines@cs.fsu.edu
637404SAli.Saidi@ARM.comclass TableWalker;
6410037SARM gem5 Developersclass Stage2LookUp;
6510037SARM gem5 Developersclass Stage2MMU;
667404SAli.Saidi@ARM.com
676019Shines@cs.fsu.educlass TLB : public BaseTLB
686019Shines@cs.fsu.edu{
697294Sgblack@eecs.umich.edu  public:
707294Sgblack@eecs.umich.edu    enum ArmFlags {
7110037SARM gem5 Developers        AlignmentMask = 0x7,
727294Sgblack@eecs.umich.edu
737294Sgblack@eecs.umich.edu        AlignByte = 0x0,
747294Sgblack@eecs.umich.edu        AlignHalfWord = 0x1,
7510037SARM gem5 Developers        AlignWord = 0x2,
7610037SARM gem5 Developers        AlignDoubleWord = 0x3,
7710037SARM gem5 Developers        AlignQuadWord = 0x4,
7810037SARM gem5 Developers        AlignOctWord = 0x5,
797294Sgblack@eecs.umich.edu
8010037SARM gem5 Developers        AllowUnaligned = 0x8,
817404SAli.Saidi@ARM.com        // Priv code operating as if it wasn't
8210037SARM gem5 Developers        UserMode = 0x10,
837294Sgblack@eecs.umich.edu        // Because zero otherwise looks like a valid setting and may be used
847294Sgblack@eecs.umich.edu        // accidentally, this bit must be non-zero to show it was used on
857294Sgblack@eecs.umich.edu        // purpose.
8610037SARM gem5 Developers        MustBeOne = 0x40
8710037SARM gem5 Developers    };
8810037SARM gem5 Developers
8910037SARM gem5 Developers    enum ArmTranslationType {
9010037SARM gem5 Developers        NormalTran = 0,
9110037SARM gem5 Developers        S1CTran = 0x1,
9210037SARM gem5 Developers        HypMode = 0x2,
9310037SARM gem5 Developers        // Secure code operating as if it wasn't (required by some Address
9410037SARM gem5 Developers        // Translate operations)
9510037SARM gem5 Developers        S1S2NsTran = 0x4
967294Sgblack@eecs.umich.edu    };
976019Shines@cs.fsu.edu  protected:
9810037SARM gem5 Developers    TlbEntry* table;     // the Page Table
9910037SARM gem5 Developers    int size;            // TLB Size
10010037SARM gem5 Developers    bool isStage2;       // Indicates this TLB is part of the second stage MMU
10110037SARM gem5 Developers    bool stage2Req;      // Indicates whether a stage 2 lookup is also required
10210037SARM gem5 Developers    uint64_t _attr;      // Memory attributes for last accessed TLB entry
10310037SARM gem5 Developers    bool directToStage2; // Indicates whether all translation requests should
10410037SARM gem5 Developers                         // be routed directly to the stage 2 TLB
1057436Sdam.sunwoo@arm.com
1067404SAli.Saidi@ARM.com    TableWalker *tableWalker;
10710037SARM gem5 Developers    TLB *stage2Tlb;
10810037SARM gem5 Developers    Stage2MMU *stage2Mmu;
1096019Shines@cs.fsu.edu
1107399SAli.Saidi@ARM.com    // Access Stats
1117734SAli.Saidi@ARM.com    mutable Stats::Scalar instHits;
1127734SAli.Saidi@ARM.com    mutable Stats::Scalar instMisses;
1137734SAli.Saidi@ARM.com    mutable Stats::Scalar readHits;
1147734SAli.Saidi@ARM.com    mutable Stats::Scalar readMisses;
1157734SAli.Saidi@ARM.com    mutable Stats::Scalar writeHits;
1167734SAli.Saidi@ARM.com    mutable Stats::Scalar writeMisses;
1177734SAli.Saidi@ARM.com    mutable Stats::Scalar inserts;
1187734SAli.Saidi@ARM.com    mutable Stats::Scalar flushTlb;
1197734SAli.Saidi@ARM.com    mutable Stats::Scalar flushTlbMva;
1207734SAli.Saidi@ARM.com    mutable Stats::Scalar flushTlbMvaAsid;
1217734SAli.Saidi@ARM.com    mutable Stats::Scalar flushTlbAsid;
1227734SAli.Saidi@ARM.com    mutable Stats::Scalar flushedEntries;
1237734SAli.Saidi@ARM.com    mutable Stats::Scalar alignFaults;
1247734SAli.Saidi@ARM.com    mutable Stats::Scalar prefetchFaults;
1257734SAli.Saidi@ARM.com    mutable Stats::Scalar domainFaults;
1267734SAli.Saidi@ARM.com    mutable Stats::Scalar permsFaults;
1277734SAli.Saidi@ARM.com
1287734SAli.Saidi@ARM.com    Stats::Formula readAccesses;
1297734SAli.Saidi@ARM.com    Stats::Formula writeAccesses;
1307734SAli.Saidi@ARM.com    Stats::Formula instAccesses;
1316019Shines@cs.fsu.edu    Stats::Formula hits;
1326019Shines@cs.fsu.edu    Stats::Formula misses;
1336019Shines@cs.fsu.edu    Stats::Formula accesses;
1346019Shines@cs.fsu.edu
13510463SAndreas.Sandberg@ARM.com    /** PMU probe for TLB refills */
13610463SAndreas.Sandberg@ARM.com    ProbePoints::PMUUPtr ppRefills;
13710463SAndreas.Sandberg@ARM.com
1387697SAli.Saidi@ARM.com    int rangeMRU; //On lookup, only move entries ahead when outside rangeMRU
1397404SAli.Saidi@ARM.com
1408527SAli.Saidi@ARM.com    bool bootUncacheability;
1418527SAli.Saidi@ARM.com
1426019Shines@cs.fsu.edu  public:
14310037SARM gem5 Developers    TLB(const ArmTLBParams *p);
14410037SARM gem5 Developers    TLB(const Params *p, int _size, TableWalker *_walker);
1456019Shines@cs.fsu.edu
1469535Smrinmoy.ghosh@arm.com    /** Lookup an entry in the TLB
1479535Smrinmoy.ghosh@arm.com     * @param vpn virtual address
1489535Smrinmoy.ghosh@arm.com     * @param asn context id/address space id to use
14910037SARM gem5 Developers     * @param vmid The virtual machine ID used for stage 2 translation
15010037SARM gem5 Developers     * @param secure if the lookup is secure
15110037SARM gem5 Developers     * @param hyp if the lookup is done from hyp mode
1529535Smrinmoy.ghosh@arm.com     * @param functional if the lookup should modify state
15310037SARM gem5 Developers     * @param ignore_asn if on lookup asn should be ignored
15410037SARM gem5 Developers     * @return pointer to TLB entry if it exists
1559535Smrinmoy.ghosh@arm.com     */
15610037SARM gem5 Developers    TlbEntry *lookup(Addr vpn, uint16_t asn, uint8_t vmid, bool hyp,
15710037SARM gem5 Developers                     bool secure, bool functional,
15810037SARM gem5 Developers                     bool ignore_asn, uint8_t target_el);
1599535Smrinmoy.ghosh@arm.com
1606019Shines@cs.fsu.edu    virtual ~TLB();
16110037SARM gem5 Developers
16210194SGeoffrey.Blake@arm.com    void takeOverFrom(BaseTLB *otlb);
16310194SGeoffrey.Blake@arm.com
16410037SARM gem5 Developers    /// setup all the back pointers
16510037SARM gem5 Developers    virtual void init();
16610037SARM gem5 Developers
16710037SARM gem5 Developers    void setMMU(Stage2MMU *m);
16810037SARM gem5 Developers
1696019Shines@cs.fsu.edu    int getsize() const { return size; }
1706019Shines@cs.fsu.edu
1717404SAli.Saidi@ARM.com    void insert(Addr vaddr, TlbEntry &pte);
1727404SAli.Saidi@ARM.com
17310037SARM gem5 Developers    Fault getTE(TlbEntry **te, RequestPtr req, ThreadContext *tc, Mode mode,
17410037SARM gem5 Developers                Translation *translation, bool timing, bool functional,
17510037SARM gem5 Developers                bool is_secure, ArmTranslationType tranType);
17610037SARM gem5 Developers
17710037SARM gem5 Developers    Fault getResultTe(TlbEntry **te, RequestPtr req, ThreadContext *tc,
17810037SARM gem5 Developers                      Mode mode, Translation *translation, bool timing,
17910037SARM gem5 Developers                      bool functional, TlbEntry *mergeTe);
18010037SARM gem5 Developers
18110037SARM gem5 Developers    Fault checkPermissions(TlbEntry *te, RequestPtr req, Mode mode);
18210037SARM gem5 Developers    Fault checkPermissions64(TlbEntry *te, RequestPtr req, Mode mode,
18310037SARM gem5 Developers                             ThreadContext *tc);
18410037SARM gem5 Developers
18510037SARM gem5 Developers
18610037SARM gem5 Developers    /** Reset the entire TLB
18710037SARM gem5 Developers     * @param secure_lookup if the operation affects the secure world
18810037SARM gem5 Developers     */
18910037SARM gem5 Developers    void flushAllSecurity(bool secure_lookup, uint8_t target_el,
19010037SARM gem5 Developers                          bool ignore_el = false);
19110037SARM gem5 Developers
19210037SARM gem5 Developers    /** Remove all entries in the non secure world, depending on whether they
19310037SARM gem5 Developers     *  were allocated in hyp mode or not
19410037SARM gem5 Developers     * @param hyp if the opperation affects hyp mode
19510037SARM gem5 Developers     */
19610037SARM gem5 Developers    void flushAllNs(bool hyp, uint8_t target_el, bool ignore_el = false);
19710037SARM gem5 Developers
19810037SARM gem5 Developers
19910037SARM gem5 Developers    /** Reset the entire TLB. Used for CPU switching to prevent stale
20010037SARM gem5 Developers     * translations after multiple switches
20110037SARM gem5 Developers     */
20210037SARM gem5 Developers    void flushAll()
20310037SARM gem5 Developers    {
20410037SARM gem5 Developers        flushAllSecurity(false, 0, true);
20510037SARM gem5 Developers        flushAllSecurity(true, 0, true);
20610037SARM gem5 Developers    }
2077404SAli.Saidi@ARM.com
2087404SAli.Saidi@ARM.com    /** Remove any entries that match both a va and asn
2097404SAli.Saidi@ARM.com     * @param mva virtual address to flush
2107404SAli.Saidi@ARM.com     * @param asn contextid/asn to flush on match
21110037SARM gem5 Developers     * @param secure_lookup if the operation affects the secure world
2127404SAli.Saidi@ARM.com     */
21310037SARM gem5 Developers    void flushMvaAsid(Addr mva, uint64_t asn, bool secure_lookup,
21410037SARM gem5 Developers                      uint8_t target_el);
2157404SAli.Saidi@ARM.com
2167404SAli.Saidi@ARM.com    /** Remove any entries that match the asn
2177404SAli.Saidi@ARM.com     * @param asn contextid/asn to flush on match
21810037SARM gem5 Developers     * @param secure_lookup if the operation affects the secure world
2197404SAli.Saidi@ARM.com     */
22010037SARM gem5 Developers    void flushAsid(uint64_t asn, bool secure_lookup, uint8_t target_el);
2217404SAli.Saidi@ARM.com
2227404SAli.Saidi@ARM.com    /** Remove all entries that match the va regardless of asn
2237404SAli.Saidi@ARM.com     * @param mva address to flush from cache
22410037SARM gem5 Developers     * @param secure_lookup if the operation affects the secure world
22510037SARM gem5 Developers     * @param hyp if the operation affects hyp mode
2267404SAli.Saidi@ARM.com     */
22710037SARM gem5 Developers    void flushMva(Addr mva, bool secure_lookup, bool hyp, uint8_t target_el);
2287404SAli.Saidi@ARM.com
22910037SARM gem5 Developers    Fault trickBoxCheck(RequestPtr req, Mode mode, TlbEntry::DomainType domain);
23010037SARM gem5 Developers    Fault walkTrickBoxCheck(Addr pa, bool is_secure, Addr va, Addr sz, bool is_exec,
23110037SARM gem5 Developers            bool is_write, TlbEntry::DomainType domain, LookupLevel lookup_level);
2327404SAli.Saidi@ARM.com
23310037SARM gem5 Developers    void printTlb() const;
2347404SAli.Saidi@ARM.com
2358527SAli.Saidi@ARM.com    void allCpusCaching() { bootUncacheability = true; }
2366019Shines@cs.fsu.edu    void demapPage(Addr vaddr, uint64_t asn)
2376019Shines@cs.fsu.edu    {
23810037SARM gem5 Developers        // needed for x86 only
23910037SARM gem5 Developers        panic("demapPage() is not implemented.\n");
2406019Shines@cs.fsu.edu    }
2416019Shines@cs.fsu.edu
2426019Shines@cs.fsu.edu    static bool validVirtualAddress(Addr vaddr);
2436019Shines@cs.fsu.edu
2447694SAli.Saidi@ARM.com    /**
2457694SAli.Saidi@ARM.com     * Do a functional lookup on the TLB (for debugging)
2467694SAli.Saidi@ARM.com     * and don't modify any internal state
2477694SAli.Saidi@ARM.com     * @param tc thread context to get the context id from
2487694SAli.Saidi@ARM.com     * @param vaddr virtual address to translate
2497694SAli.Saidi@ARM.com     * @param pa returned physical address
2507694SAli.Saidi@ARM.com     * @return if the translation was successful
2517694SAli.Saidi@ARM.com     */
2527694SAli.Saidi@ARM.com    bool translateFunctional(ThreadContext *tc, Addr vaddr, Addr &paddr);
2537694SAli.Saidi@ARM.com
2548733Sgeoffrey.blake@arm.com    /**
2558733Sgeoffrey.blake@arm.com     * Do a functional lookup on the TLB (for checker cpu) that
2568733Sgeoffrey.blake@arm.com     * behaves like a normal lookup without modifying any page table state.
2578733Sgeoffrey.blake@arm.com     */
25810037SARM gem5 Developers    Fault translateFunctional(RequestPtr req, ThreadContext *tc, Mode mode,
25910037SARM gem5 Developers            ArmTranslationType tranType = NormalTran);
2608733Sgeoffrey.blake@arm.com
2617436Sdam.sunwoo@arm.com    /** Accessor functions for memory attributes for last accessed TLB entry
2627436Sdam.sunwoo@arm.com     */
2637436Sdam.sunwoo@arm.com    void
26410037SARM gem5 Developers    setAttr(uint64_t attr)
2657436Sdam.sunwoo@arm.com    {
2667436Sdam.sunwoo@arm.com        _attr = attr;
2677436Sdam.sunwoo@arm.com    }
26810037SARM gem5 Developers
26910037SARM gem5 Developers    uint64_t
2707436Sdam.sunwoo@arm.com    getAttr() const
2717436Sdam.sunwoo@arm.com    {
2727436Sdam.sunwoo@arm.com        return _attr;
2737436Sdam.sunwoo@arm.com    }
2747436Sdam.sunwoo@arm.com
2757404SAli.Saidi@ARM.com    Fault translateFs(RequestPtr req, ThreadContext *tc, Mode mode,
2768733Sgeoffrey.blake@arm.com            Translation *translation, bool &delay,
27710037SARM gem5 Developers            bool timing, ArmTranslationType tranType, bool functional = false);
2787404SAli.Saidi@ARM.com    Fault translateSe(RequestPtr req, ThreadContext *tc, Mode mode,
2797404SAli.Saidi@ARM.com            Translation *translation, bool &delay, bool timing);
28010037SARM gem5 Developers    Fault translateAtomic(RequestPtr req, ThreadContext *tc, Mode mode,
28110037SARM gem5 Developers            ArmTranslationType tranType = NormalTran);
2827404SAli.Saidi@ARM.com    Fault translateTiming(RequestPtr req, ThreadContext *tc,
28310037SARM gem5 Developers            Translation *translation, Mode mode,
28410037SARM gem5 Developers            ArmTranslationType tranType = NormalTran);
28510037SARM gem5 Developers    Fault translateComplete(RequestPtr req, ThreadContext *tc,
28610037SARM gem5 Developers            Translation *translation, Mode mode, ArmTranslationType tranType,
28710037SARM gem5 Developers            bool callFromS2);
2889738Sandreas@sandberg.pp.se    Fault finalizePhysical(RequestPtr req, ThreadContext *tc, Mode mode) const;
2896116Snate@binkert.org
2909439SAndreas.Sandberg@ARM.com    void drainResume();
2919439SAndreas.Sandberg@ARM.com
2926019Shines@cs.fsu.edu    // Checkpointing
2936019Shines@cs.fsu.edu    void serialize(std::ostream &os);
2946019Shines@cs.fsu.edu    void unserialize(Checkpoint *cp, const std::string &section);
2956019Shines@cs.fsu.edu
2966019Shines@cs.fsu.edu    void regStats();
2977749SAli.Saidi@ARM.com
29810463SAndreas.Sandberg@ARM.com    void regProbePoints() M5_ATTR_OVERRIDE;
29910463SAndreas.Sandberg@ARM.com
3008922Swilliam.wang@arm.com    /**
3018922Swilliam.wang@arm.com     * Get the table walker master port. This is used for migrating
3028922Swilliam.wang@arm.com     * port connections during a CPU takeOverFrom() call. For
3038922Swilliam.wang@arm.com     * architectures that do not have a table walker, NULL is
3048922Swilliam.wang@arm.com     * returned, hence the use of a pointer rather than a
3058922Swilliam.wang@arm.com     * reference. For ARM this method will always return a valid port
3068922Swilliam.wang@arm.com     * pointer.
3078922Swilliam.wang@arm.com     *
3088922Swilliam.wang@arm.com     * @return A pointer to the walker master port
3098922Swilliam.wang@arm.com     */
3109294Sandreas.hansson@arm.com    virtual BaseMasterPort* getMasterPort();
3117781SAli.Saidi@ARM.com
31210037SARM gem5 Developers    /**
31310037SARM gem5 Developers     * Allow the MMU (overseeing both stage 1 and stage 2 TLBs) to
31410037SARM gem5 Developers     * access the table walker port of this TLB so that it can
31510037SARM gem5 Developers     * orchestrate staged translations.
31610037SARM gem5 Developers     *
31710037SARM gem5 Developers     * @return The table walker DMA port
31810037SARM gem5 Developers     */
31910037SARM gem5 Developers    DmaPort& getWalkerPort();
32010037SARM gem5 Developers
3217749SAli.Saidi@ARM.com    // Caching misc register values here.
3227749SAli.Saidi@ARM.com    // Writing to misc registers needs to invalidate them.
3237749SAli.Saidi@ARM.com    // translateFunctional/translateSe/translateFs checks if they are
3247749SAli.Saidi@ARM.com    // invalid and call updateMiscReg if necessary.
3257749SAli.Saidi@ARM.comprotected:
32610037SARM gem5 Developers    bool aarch64;
32710037SARM gem5 Developers    ExceptionLevel aarch64EL;
3287749SAli.Saidi@ARM.com    SCTLR sctlr;
32910037SARM gem5 Developers    SCR scr;
3307749SAli.Saidi@ARM.com    bool isPriv;
33110037SARM gem5 Developers    bool isSecure;
33210037SARM gem5 Developers    bool isHyp;
33310037SARM gem5 Developers    TTBCR ttbcr;
33410037SARM gem5 Developers    uint16_t asid;
33510037SARM gem5 Developers    uint8_t vmid;
3367749SAli.Saidi@ARM.com    PRRR prrr;
3377749SAli.Saidi@ARM.com    NMRR nmrr;
33810037SARM gem5 Developers    HCR hcr;
3397749SAli.Saidi@ARM.com    uint32_t dacr;
3407749SAli.Saidi@ARM.com    bool miscRegValid;
34110037SARM gem5 Developers    ArmTranslationType curTranType;
34210037SARM gem5 Developers
34310037SARM gem5 Developers    // Cached copies of system-level properties
34410037SARM gem5 Developers    bool haveLPAE;
34510037SARM gem5 Developers    bool haveVirtualization;
34610037SARM gem5 Developers    bool haveLargeAsid64;
34710037SARM gem5 Developers
34810037SARM gem5 Developers    void updateMiscReg(ThreadContext *tc,
34910037SARM gem5 Developers                       ArmTranslationType tranType = NormalTran);
35010037SARM gem5 Developers
3517749SAli.Saidi@ARM.compublic:
3528299Schander.sudanthi@arm.com    const Params *
3538299Schander.sudanthi@arm.com    params() const
3548299Schander.sudanthi@arm.com    {
3558299Schander.sudanthi@arm.com        return dynamic_cast<const Params *>(_params);
3568299Schander.sudanthi@arm.com    }
3577749SAli.Saidi@ARM.com    inline void invalidateMiscReg() { miscRegValid = false; }
35810037SARM gem5 Developers
35910037SARM gem5 Developersprivate:
36010037SARM gem5 Developers    /** Remove any entries that match both a va and asn
36110037SARM gem5 Developers     * @param mva virtual address to flush
36210037SARM gem5 Developers     * @param asn contextid/asn to flush on match
36310037SARM gem5 Developers     * @param secure_lookup if the operation affects the secure world
36410037SARM gem5 Developers     * @param hyp if the operation affects hyp mode
36510037SARM gem5 Developers     * @param ignore_asn if the flush should ignore the asn
36610037SARM gem5 Developers     */
36710037SARM gem5 Developers    void _flushMva(Addr mva, uint64_t asn, bool secure_lookup,
36810037SARM gem5 Developers                   bool hyp, bool ignore_asn, uint8_t target_el);
36910037SARM gem5 Developers
37010037SARM gem5 Developers    bool checkELMatch(uint8_t target_el, uint8_t tentry_el, bool ignore_el);
3716019Shines@cs.fsu.edu};
3726019Shines@cs.fsu.edu
3737811Ssteve.reinhardt@amd.com} // namespace ArmISA
3746019Shines@cs.fsu.edu
3756019Shines@cs.fsu.edu#endif // __ARCH_ARM_TLB_HH__
376