tlb.hh revision 14088
16313Sgblack@eecs.umich.edu/*
26313Sgblack@eecs.umich.edu * Copyright (c) 2010-2013, 2016, 2019 ARM Limited
36313Sgblack@eecs.umich.edu * All rights reserved
46313Sgblack@eecs.umich.edu *
56313Sgblack@eecs.umich.edu * The license below extends only to copyright in the software and shall
66313Sgblack@eecs.umich.edu * not be construed as granting a license to any other intellectual
76313Sgblack@eecs.umich.edu * property including but not limited to intellectual property relating
86313Sgblack@eecs.umich.edu * to a hardware implementation of the functionality of the software
96313Sgblack@eecs.umich.edu * licensed hereunder.  You may use the software subject to the license
106313Sgblack@eecs.umich.edu * terms below provided that you ensure that this notice is replicated
116313Sgblack@eecs.umich.edu * unmodified and in its entirety in all distributions of the software,
126313Sgblack@eecs.umich.edu * modified or unmodified, in source code or in binary form.
136313Sgblack@eecs.umich.edu *
146313Sgblack@eecs.umich.edu * Copyright (c) 2001-2005 The Regents of The University of Michigan
156313Sgblack@eecs.umich.edu * All rights reserved.
166313Sgblack@eecs.umich.edu *
176313Sgblack@eecs.umich.edu * Redistribution and use in source and binary forms, with or without
186313Sgblack@eecs.umich.edu * modification, are permitted provided that the following conditions are
196313Sgblack@eecs.umich.edu * met: redistributions of source code must retain the above copyright
206313Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer;
216313Sgblack@eecs.umich.edu * redistributions in binary form must reproduce the above copyright
226313Sgblack@eecs.umich.edu * notice, this list of conditions and the following disclaimer in the
236313Sgblack@eecs.umich.edu * documentation and/or other materials provided with the distribution;
246313Sgblack@eecs.umich.edu * neither the name of the copyright holders nor the names of its
256313Sgblack@eecs.umich.edu * contributors may be used to endorse or promote products derived from
266313Sgblack@eecs.umich.edu * this software without specific prior written permission.
276313Sgblack@eecs.umich.edu *
286313Sgblack@eecs.umich.edu * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
296313Sgblack@eecs.umich.edu * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
306313Sgblack@eecs.umich.edu * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
316313Sgblack@eecs.umich.edu * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
326313Sgblack@eecs.umich.edu * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
336313Sgblack@eecs.umich.edu * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
348229Snate@binkert.org * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
356334Sgblack@eecs.umich.edu * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
366334Sgblack@eecs.umich.edu * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
376334Sgblack@eecs.umich.edu * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
386334Sgblack@eecs.umich.edu * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
396313Sgblack@eecs.umich.edu *
406334Sgblack@eecs.umich.edu * Authors: Ali Saidi
417878Sgblack@eecs.umich.edu */
429384SAndreas.Sandberg@arm.com
436313Sgblack@eecs.umich.edu#ifndef __ARCH_ARM_TLB_HH__
446334Sgblack@eecs.umich.edu#define __ARCH_ARM_TLB_HH__
456313Sgblack@eecs.umich.edu
466313Sgblack@eecs.umich.edu
479384SAndreas.Sandberg@arm.com#include "arch/arm/isa_traits.hh"
486334Sgblack@eecs.umich.edu#include "arch/arm/pagetable.hh"
496313Sgblack@eecs.umich.edu#include "arch/arm/utility.hh"
506313Sgblack@eecs.umich.edu#include "arch/arm/vtophys.hh"
516313Sgblack@eecs.umich.edu#include "arch/generic/tlb.hh"
529384SAndreas.Sandberg@arm.com#include "base/statistics.hh"
536313Sgblack@eecs.umich.edu#include "mem/request.hh"
546334Sgblack@eecs.umich.edu#include "params/ArmTLB.hh"
556334Sgblack@eecs.umich.edu#include "sim/probe/pmu.hh"
566334Sgblack@eecs.umich.edu
576334Sgblack@eecs.umich.educlass ThreadContext;
589384SAndreas.Sandberg@arm.com
599384SAndreas.Sandberg@arm.comnamespace ArmISA {
606313Sgblack@eecs.umich.edu
618181Sksewell@umich.educlass TableWalker;
628181Sksewell@umich.educlass Stage2LookUp;
638181Sksewell@umich.educlass Stage2MMU;
648181Sksewell@umich.educlass TLB;
656334Sgblack@eecs.umich.edu
666334Sgblack@eecs.umich.educlass TlbTestInterface
676334Sgblack@eecs.umich.edu{
686334Sgblack@eecs.umich.edu  public:
696334Sgblack@eecs.umich.edu    TlbTestInterface() {}
706334Sgblack@eecs.umich.edu    virtual ~TlbTestInterface() {}
716334Sgblack@eecs.umich.edu
726334Sgblack@eecs.umich.edu    /**
736334Sgblack@eecs.umich.edu     * Check if a TLB translation should be forced to fail.
746334Sgblack@eecs.umich.edu     *
756313Sgblack@eecs.umich.edu     * @param req Request requiring a translation.
768181Sksewell@umich.edu     * @param is_priv Access from a privileged mode (i.e., not EL0)
776334Sgblack@eecs.umich.edu     * @param mode Access type
788181Sksewell@umich.edu     * @param domain Domain type
796334Sgblack@eecs.umich.edu     */
806334Sgblack@eecs.umich.edu    virtual Fault translationCheck(const RequestPtr &req, bool is_priv,
816334Sgblack@eecs.umich.edu                                   BaseTLB::Mode mode,
826334Sgblack@eecs.umich.edu                                   TlbEntry::DomainType domain) = 0;
836334Sgblack@eecs.umich.edu
846334Sgblack@eecs.umich.edu    /**
856334Sgblack@eecs.umich.edu     * Check if a page table walker access should be forced to fail.
866334Sgblack@eecs.umich.edu     *
876334Sgblack@eecs.umich.edu     * @param pa Physical address the walker is accessing
886334Sgblack@eecs.umich.edu     * @param size Walker access size
896334Sgblack@eecs.umich.edu     * @param va Virtual address that initiated the walk
906334Sgblack@eecs.umich.edu     * @param is_secure Access from secure state
916334Sgblack@eecs.umich.edu     * @param is_priv Access from a privileged mode (i.e., not EL0)
926334Sgblack@eecs.umich.edu     * @param mode Access type
936334Sgblack@eecs.umich.edu     * @param domain Domain type
946334Sgblack@eecs.umich.edu     * @param lookup_level Page table walker level
956334Sgblack@eecs.umich.edu     */
966334Sgblack@eecs.umich.edu    virtual Fault walkCheck(Addr pa, Addr size, Addr va, bool is_secure,
976334Sgblack@eecs.umich.edu                            Addr is_priv, BaseTLB::Mode mode,
986334Sgblack@eecs.umich.edu                            TlbEntry::DomainType domain,
996334Sgblack@eecs.umich.edu                            LookupLevel lookup_level) = 0;
1006334Sgblack@eecs.umich.edu};
1016334Sgblack@eecs.umich.edu
1026334Sgblack@eecs.umich.educlass TLB : public BaseTLB
1036334Sgblack@eecs.umich.edu{
1046334Sgblack@eecs.umich.edu  public:
1056334Sgblack@eecs.umich.edu    enum ArmFlags {
1066334Sgblack@eecs.umich.edu        AlignmentMask = 0x7,
1076334Sgblack@eecs.umich.edu
1086334Sgblack@eecs.umich.edu        AlignByte = 0x0,
1096334Sgblack@eecs.umich.edu        AlignHalfWord = 0x1,
1106334Sgblack@eecs.umich.edu        AlignWord = 0x2,
1116334Sgblack@eecs.umich.edu        AlignDoubleWord = 0x3,
1126334Sgblack@eecs.umich.edu        AlignQuadWord = 0x4,
1136334Sgblack@eecs.umich.edu        AlignOctWord = 0x5,
1146334Sgblack@eecs.umich.edu
1156334Sgblack@eecs.umich.edu        AllowUnaligned = 0x8,
1166334Sgblack@eecs.umich.edu        // Priv code operating as if it wasn't
1176334Sgblack@eecs.umich.edu        UserMode = 0x10,
1186334Sgblack@eecs.umich.edu        // Because zero otherwise looks like a valid setting and may be used
1196334Sgblack@eecs.umich.edu        // accidentally, this bit must be non-zero to show it was used on
1206334Sgblack@eecs.umich.edu        // purpose.
1216334Sgblack@eecs.umich.edu        MustBeOne = 0x40
1226334Sgblack@eecs.umich.edu    };
1236313Sgblack@eecs.umich.edu
1246334Sgblack@eecs.umich.edu    enum ArmTranslationType {
1256334Sgblack@eecs.umich.edu        NormalTran = 0,
1266334Sgblack@eecs.umich.edu        S1CTran = 0x1,
1276334Sgblack@eecs.umich.edu        HypMode = 0x2,
1286334Sgblack@eecs.umich.edu        // Secure code operating as if it wasn't (required by some Address
1296313Sgblack@eecs.umich.edu        // Translate operations)
1306334Sgblack@eecs.umich.edu        S1S2NsTran = 0x4,
1316334Sgblack@eecs.umich.edu        // Address translation instructions (eg AT S1E0R_Xt) need to be handled
1326334Sgblack@eecs.umich.edu        // in special ways during translation because they could need to act
1336313Sgblack@eecs.umich.edu        // like a different EL than the current EL. The following flags are
1346334Sgblack@eecs.umich.edu        // for these instructions
1356334Sgblack@eecs.umich.edu        S1E0Tran = 0x8,
1366313Sgblack@eecs.umich.edu        S1E1Tran = 0x10,
1376334Sgblack@eecs.umich.edu        S1E2Tran = 0x20,
1386334Sgblack@eecs.umich.edu        S1E3Tran = 0x40,
1396334Sgblack@eecs.umich.edu        S12E0Tran = 0x80,
1406334Sgblack@eecs.umich.edu        S12E1Tran = 0x100
1419180Sandreas.hansson@arm.com    };
1426334Sgblack@eecs.umich.edu
1436334Sgblack@eecs.umich.edu    /**
1446334Sgblack@eecs.umich.edu     * Determine the EL to use for the purpose of a translation given
1456334Sgblack@eecs.umich.edu     * a specific translation type. If the translation type doesn't
1466334Sgblack@eecs.umich.edu     * specify an EL, we use the current EL.
1476334Sgblack@eecs.umich.edu     */
1489180Sandreas.hansson@arm.com    static ExceptionLevel tranTypeEL(CPSR cpsr, ArmTranslationType type);
1496334Sgblack@eecs.umich.edu
1506334Sgblack@eecs.umich.edu  protected:
1516334Sgblack@eecs.umich.edu    TlbEntry* table;     // the Page Table
1526806Sgblack@eecs.umich.edu    int size;            // TLB Size
1536334Sgblack@eecs.umich.edu    bool isStage2;       // Indicates this TLB is part of the second stage MMU
1546334Sgblack@eecs.umich.edu    bool stage2Req;      // Indicates whether a stage 2 lookup is also required
1556334Sgblack@eecs.umich.edu    // Indicates whether a stage 2 lookup of the table descriptors is required.
1566334Sgblack@eecs.umich.edu    // Certain address translation instructions will intercept the IPA but the
1576334Sgblack@eecs.umich.edu    // table descriptors still need to be translated by the stage2.
1586334Sgblack@eecs.umich.edu    bool stage2DescReq;
1596334Sgblack@eecs.umich.edu    uint64_t _attr;      // Memory attributes for last accessed TLB entry
1609461Snilay@cs.wisc.edu    bool directToStage2; // Indicates whether all translation requests should
1619461Snilay@cs.wisc.edu                         // be routed directly to the stage 2 TLB
1629553Sandreas.hansson@arm.com
1639553Sandreas.hansson@arm.com    TableWalker *tableWalker;
1649553Sandreas.hansson@arm.com    TLB *stage2Tlb;
1659384SAndreas.Sandberg@arm.com    Stage2MMU *stage2Mmu;
1669384SAndreas.Sandberg@arm.com
1679384SAndreas.Sandberg@arm.com    TlbTestInterface *test;
1686313Sgblack@eecs.umich.edu
1696313Sgblack@eecs.umich.edu    // Access Stats
17010035Sandreas.hansson@arm.com    mutable Stats::Scalar instHits;
1716313Sgblack@eecs.umich.edu    mutable Stats::Scalar instMisses;
1726313Sgblack@eecs.umich.edu    mutable Stats::Scalar readHits;
1736313Sgblack@eecs.umich.edu    mutable Stats::Scalar readMisses;
1746313Sgblack@eecs.umich.edu    mutable Stats::Scalar writeHits;
1756313Sgblack@eecs.umich.edu    mutable Stats::Scalar writeMisses;
17610035Sandreas.hansson@arm.com    mutable Stats::Scalar inserts;
1776313Sgblack@eecs.umich.edu    mutable Stats::Scalar flushTlb;
1786313Sgblack@eecs.umich.edu    mutable Stats::Scalar flushTlbMva;
1796313Sgblack@eecs.umich.edu    mutable Stats::Scalar flushTlbMvaAsid;
1809920Syasuko.eckert@amd.com    mutable Stats::Scalar flushTlbAsid;
1819920Syasuko.eckert@amd.com    mutable Stats::Scalar flushedEntries;
1829920Syasuko.eckert@amd.com    mutable Stats::Scalar alignFaults;
18310035Sandreas.hansson@arm.com    mutable Stats::Scalar prefetchFaults;
1849920Syasuko.eckert@amd.com    mutable Stats::Scalar domainFaults;
1859920Syasuko.eckert@amd.com    mutable Stats::Scalar permsFaults;
1869920Syasuko.eckert@amd.com
18710033SAli.Saidi@ARM.com    Stats::Formula readAccesses;
18810033SAli.Saidi@ARM.com    Stats::Formula writeAccesses;
18910035Sandreas.hansson@arm.com    Stats::Formula instAccesses;
19010033SAli.Saidi@ARM.com    Stats::Formula hits;
19110033SAli.Saidi@ARM.com    Stats::Formula misses;
19210033SAli.Saidi@ARM.com    Stats::Formula accesses;
19310033SAli.Saidi@ARM.com
1946313Sgblack@eecs.umich.edu    /** PMU probe for TLB refills */
1956313Sgblack@eecs.umich.edu    ProbePoints::PMUUPtr ppRefills;
1966313Sgblack@eecs.umich.edu
1976313Sgblack@eecs.umich.edu    int rangeMRU; //On lookup, only move entries ahead when outside rangeMRU
198
199  public:
200    TLB(const ArmTLBParams *p);
201    TLB(const Params *p, int _size, TableWalker *_walker);
202
203    /** Lookup an entry in the TLB
204     * @param vpn virtual address
205     * @param asn context id/address space id to use
206     * @param vmid The virtual machine ID used for stage 2 translation
207     * @param secure if the lookup is secure
208     * @param hyp if the lookup is done from hyp mode
209     * @param functional if the lookup should modify state
210     * @param ignore_asn if on lookup asn should be ignored
211     * @return pointer to TLB entry if it exists
212     */
213    TlbEntry *lookup(Addr vpn, uint16_t asn, uint8_t vmid, bool hyp,
214                     bool secure, bool functional,
215                     bool ignore_asn, ExceptionLevel target_el);
216
217    virtual ~TLB();
218
219    void takeOverFrom(BaseTLB *otlb) override;
220
221    /// setup all the back pointers
222    void init() override;
223
224    void setTestInterface(SimObject *ti);
225
226    TableWalker *getTableWalker() { return tableWalker; }
227
228    void setMMU(Stage2MMU *m, MasterID master_id);
229
230    int getsize() const { return size; }
231
232    void insert(Addr vaddr, TlbEntry &pte);
233
234    Fault getTE(TlbEntry **te, const RequestPtr &req,
235                ThreadContext *tc, Mode mode,
236                Translation *translation, bool timing, bool functional,
237                bool is_secure, ArmTranslationType tranType);
238
239    Fault getResultTe(TlbEntry **te, const RequestPtr &req,
240                      ThreadContext *tc, Mode mode,
241                      Translation *translation, bool timing,
242                      bool functional, TlbEntry *mergeTe);
243
244    Fault checkPermissions(TlbEntry *te, const RequestPtr &req, Mode mode);
245    Fault checkPermissions64(TlbEntry *te, const RequestPtr &req, Mode mode,
246                             ThreadContext *tc);
247
248
249    /** Reset the entire TLB
250     * @param secure_lookup if the operation affects the secure world
251     */
252    void flushAllSecurity(bool secure_lookup, ExceptionLevel target_el,
253                          bool ignore_el = false);
254
255    /** Remove all entries in the non secure world, depending on whether they
256     *  were allocated in hyp mode or not
257     */
258    void flushAllNs(ExceptionLevel target_el, bool ignore_el = false);
259
260
261    /** Reset the entire TLB. Used for CPU switching to prevent stale
262     * translations after multiple switches
263     */
264    void flushAll() override
265    {
266        flushAllSecurity(false, EL0, true);
267        flushAllSecurity(true, EL0, true);
268    }
269
270    /** Remove any entries that match both a va and asn
271     * @param mva virtual address to flush
272     * @param asn contextid/asn to flush on match
273     * @param secure_lookup if the operation affects the secure world
274     */
275    void flushMvaAsid(Addr mva, uint64_t asn, bool secure_lookup,
276                      ExceptionLevel target_el);
277
278    /** Remove any entries that match the asn
279     * @param asn contextid/asn to flush on match
280     * @param secure_lookup if the operation affects the secure world
281     */
282    void flushAsid(uint64_t asn, bool secure_lookup,
283                   ExceptionLevel target_el);
284
285    /** Remove all entries that match the va regardless of asn
286     * @param mva address to flush from cache
287     * @param secure_lookup if the operation affects the secure world
288     */
289    void flushMva(Addr mva, bool secure_lookup, ExceptionLevel target_el);
290
291    /**
292     * Invalidate all entries in the stage 2 TLB that match the given ipa
293     * and the current VMID
294     * @param ipa the address to invalidate
295     * @param secure_lookup if the operation affects the secure world
296     */
297    void flushIpaVmid(Addr ipa, bool secure_lookup, ExceptionLevel target_el);
298
299    Fault trickBoxCheck(const RequestPtr &req, Mode mode,
300                        TlbEntry::DomainType domain);
301
302    Fault walkTrickBoxCheck(Addr pa, bool is_secure, Addr va, Addr sz,
303                            bool is_exec, bool is_write,
304                            TlbEntry::DomainType domain,
305                            LookupLevel lookup_level);
306
307    void printTlb() const;
308
309    void demapPage(Addr vaddr, uint64_t asn) override
310    {
311        // needed for x86 only
312        panic("demapPage() is not implemented.\n");
313    }
314
315    /**
316     * Do a functional lookup on the TLB (for debugging)
317     * and don't modify any internal state
318     * @param tc thread context to get the context id from
319     * @param vaddr virtual address to translate
320     * @param pa returned physical address
321     * @return if the translation was successful
322     */
323    bool translateFunctional(ThreadContext *tc, Addr vaddr, Addr &paddr);
324
325    /**
326     * Do a functional lookup on the TLB (for checker cpu) that
327     * behaves like a normal lookup without modifying any page table state.
328     */
329    Fault translateFunctional(const RequestPtr &req, ThreadContext *tc,
330            Mode mode, ArmTranslationType tranType);
331    Fault
332    translateFunctional(const RequestPtr &req,
333                        ThreadContext *tc, Mode mode) override
334    {
335        return translateFunctional(req, tc, mode, NormalTran);
336    }
337
338    /** Accessor functions for memory attributes for last accessed TLB entry
339     */
340    void
341    setAttr(uint64_t attr)
342    {
343        _attr = attr;
344    }
345
346    uint64_t
347    getAttr() const
348    {
349        return _attr;
350    }
351
352    Fault translateFs(const RequestPtr &req, ThreadContext *tc, Mode mode,
353            Translation *translation, bool &delay,
354            bool timing, ArmTranslationType tranType, bool functional = false);
355    Fault translateSe(const RequestPtr &req, ThreadContext *tc, Mode mode,
356            Translation *translation, bool &delay, bool timing);
357    Fault translateAtomic(const RequestPtr &req, ThreadContext *tc, Mode mode,
358            ArmTranslationType tranType);
359    Fault
360    translateAtomic(const RequestPtr &req,
361                    ThreadContext *tc, Mode mode) override
362    {
363        return translateAtomic(req, tc, mode, NormalTran);
364    }
365    void translateTiming(
366            const RequestPtr &req, ThreadContext *tc,
367            Translation *translation, Mode mode,
368            ArmTranslationType tranType);
369    void
370    translateTiming(const RequestPtr &req, ThreadContext *tc,
371                    Translation *translation, Mode mode) override
372    {
373        translateTiming(req, tc, translation, mode, NormalTran);
374    }
375    Fault translateComplete(const RequestPtr &req, ThreadContext *tc,
376            Translation *translation, Mode mode, ArmTranslationType tranType,
377            bool callFromS2);
378    Fault finalizePhysical(
379            const RequestPtr &req,
380            ThreadContext *tc, Mode mode) const override;
381
382    void drainResume() override;
383
384    // Checkpointing
385    void serialize(CheckpointOut &cp) const override;
386    void unserialize(CheckpointIn &cp) override;
387
388    void regStats() override;
389
390    void regProbePoints() override;
391
392    /**
393     * Get the table walker port. This is used for migrating
394     * port connections during a CPU takeOverFrom() call. For
395     * architectures that do not have a table walker, NULL is
396     * returned, hence the use of a pointer rather than a
397     * reference. For ARM this method will always return a valid port
398     * pointer.
399     *
400     * @return A pointer to the walker master port
401     */
402    Port *getTableWalkerPort() override;
403
404    // Caching misc register values here.
405    // Writing to misc registers needs to invalidate them.
406    // translateFunctional/translateSe/translateFs checks if they are
407    // invalid and call updateMiscReg if necessary.
408protected:
409    CPSR cpsr;
410    bool aarch64;
411    ExceptionLevel aarch64EL;
412    SCTLR sctlr;
413    SCR scr;
414    bool isPriv;
415    bool isSecure;
416    bool isHyp;
417    TTBCR ttbcr;
418    uint16_t asid;
419    uint8_t vmid;
420    PRRR prrr;
421    NMRR nmrr;
422    HCR hcr;
423    uint32_t dacr;
424    bool miscRegValid;
425    ContextID miscRegContext;
426    ArmTranslationType curTranType;
427
428    // Cached copies of system-level properties
429    bool haveLPAE;
430    bool haveVirtualization;
431    bool haveLargeAsid64;
432
433    AddrRange m5opRange;
434
435    void updateMiscReg(ThreadContext *tc,
436                       ArmTranslationType tranType = NormalTran);
437
438public:
439    const Params *
440    params() const
441    {
442        return dynamic_cast<const Params *>(_params);
443    }
444    inline void invalidateMiscReg() { miscRegValid = false; }
445
446private:
447    /** Remove any entries that match both a va and asn
448     * @param mva virtual address to flush
449     * @param asn contextid/asn to flush on match
450     * @param secure_lookup if the operation affects the secure world
451     * @param ignore_asn if the flush should ignore the asn
452     */
453    void _flushMva(Addr mva, uint64_t asn, bool secure_lookup,
454                   bool ignore_asn, ExceptionLevel target_el);
455
456  public: /* Testing */
457    Fault testTranslation(const RequestPtr &req, Mode mode,
458                          TlbEntry::DomainType domain);
459    Fault testWalk(Addr pa, Addr size, Addr va, bool is_secure, Mode mode,
460                   TlbEntry::DomainType domain,
461                   LookupLevel lookup_level);
462};
463
464template<typename T>
465TLB *
466getITBPtr(T *tc)
467{
468    auto tlb = static_cast<TLB *>(tc->getITBPtr());
469    assert(tlb);
470    return tlb;
471}
472
473template<typename T>
474TLB *
475getDTBPtr(T *tc)
476{
477    auto tlb = static_cast<TLB *>(tc->getDTBPtr());
478    assert(tlb);
479    return tlb;
480}
481
482} // namespace ArmISA
483
484#endif // __ARCH_ARM_TLB_HH__
485