gem5  v20.1.0.0
tlbi_op.hh
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2018-2019 ARM Limited
3  * All rights reserved
4  *
5  * The license below extends only to copyright in the software and shall
6  * not be construed as granting a license to any other intellectual
7  * property including but not limited to intellectual property relating
8  * to a hardware implementation of the functionality of the software
9  * licensed hereunder. You may use the software subject to the license
10  * terms below provided that you ensure that this notice is replicated
11  * unmodified and in its entirety in all distributions of the software,
12  * modified or unmodified, in source code or in binary form.
13  *
14  * Redistribution and use in source and binary forms, with or without
15  * modification, are permitted provided that the following conditions are
16  * met: redistributions of source code must retain the above copyright
17  * notice, this list of conditions and the following disclaimer;
18  * redistributions in binary form must reproduce the above copyright
19  * notice, this list of conditions and the following disclaimer in the
20  * documentation and/or other materials provided with the distribution;
21  * neither the name of the copyright holders nor the names of its
22  * contributors may be used to endorse or promote products derived from
23  * this software without specific prior written permission.
24  *
25  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
26  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
27  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
28  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
29  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
30  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
31  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
32  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
33  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
34  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
35  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
36  */
37 
38 #ifndef __ARCH_ARM_TLBI_HH__
39 #define __ARCH_ARM_TLBI_HH__
40 
41 #include "arch/arm/system.hh"
42 #include "arch/arm/tlb.hh"
43 #include "cpu/thread_context.hh"
44 
51 namespace ArmISA {
52 
53 class TLBIOp
54 {
55  public:
56  TLBIOp(ExceptionLevel _targetEL, bool _secure)
57  : secureLookup(_secure), targetEL(_targetEL)
58  {}
59 
60  virtual ~TLBIOp() {}
61  virtual void operator()(ThreadContext* tc) {}
62 
68  void
70  {
71  for (auto *oc: tc->getSystemPtr()->threads)
72  (*this)(oc);
73  }
74 
75  protected:
78 };
79 
81 class TLBIALL : public TLBIOp
82 {
83  public:
84  TLBIALL(ExceptionLevel _targetEL, bool _secure)
85  : TLBIOp(_targetEL, _secure)
86  {}
87 
88  void operator()(ThreadContext* tc) override;
89 };
90 
92 class ITLBIALL : public TLBIOp
93 {
94  public:
95  ITLBIALL(ExceptionLevel _targetEL, bool _secure)
96  : TLBIOp(_targetEL, _secure)
97  {}
98 
99  void broadcast(ThreadContext *tc) = delete;
100 
101  void operator()(ThreadContext* tc) override;
102 };
103 
105 class DTLBIALL : public TLBIOp
106 {
107  public:
108  DTLBIALL(ExceptionLevel _targetEL, bool _secure)
109  : TLBIOp(_targetEL, _secure)
110  {}
111 
112  void broadcast(ThreadContext *tc) = delete;
113 
114  void operator()(ThreadContext* tc) override;
115 };
116 
118 class TLBIASID : public TLBIOp
119 {
120  public:
121  TLBIASID(ExceptionLevel _targetEL, bool _secure, uint16_t _asid)
122  : TLBIOp(_targetEL, _secure), asid(_asid)
123  {}
124 
125  void operator()(ThreadContext* tc) override;
126 
127  protected:
128  uint16_t asid;
129 };
130 
132 class ITLBIASID : public TLBIOp
133 {
134  public:
135  ITLBIASID(ExceptionLevel _targetEL, bool _secure, uint16_t _asid)
136  : TLBIOp(_targetEL, _secure), asid(_asid)
137  {}
138 
139  void broadcast(ThreadContext *tc) = delete;
140 
141  void operator()(ThreadContext* tc) override;
142 
143  protected:
144  uint16_t asid;
145 };
146 
148 class DTLBIASID : public TLBIOp
149 {
150  public:
151  DTLBIASID(ExceptionLevel _targetEL, bool _secure, uint16_t _asid)
152  : TLBIOp(_targetEL, _secure), asid(_asid)
153  {}
154 
155  void broadcast(ThreadContext *tc) = delete;
156 
157  void operator()(ThreadContext* tc) override;
158 
159  protected:
160  uint16_t asid;
161 };
162 
164 class TLBIALLN : public TLBIOp
165 {
166  public:
168  : TLBIOp(_targetEL, false)
169  {}
170 
171  void operator()(ThreadContext* tc) override;
172 };
173 
175 class TLBIMVAA : public TLBIOp
176 {
177  public:
178  TLBIMVAA(ExceptionLevel _targetEL, bool _secure,
179  Addr _addr)
180  : TLBIOp(_targetEL, _secure), addr(_addr)
181  {}
182 
183  void operator()(ThreadContext* tc) override;
184 
185  protected:
187 };
188 
190 class TLBIMVA : public TLBIOp
191 {
192  public:
193  TLBIMVA(ExceptionLevel _targetEL, bool _secure,
194  Addr _addr, uint16_t _asid)
195  : TLBIOp(_targetEL, _secure), addr(_addr), asid(_asid)
196  {}
197 
198  void operator()(ThreadContext* tc) override;
199 
200  protected:
202  uint16_t asid;
203 };
204 
206 class ITLBIMVA : public TLBIOp
207 {
208  public:
209  ITLBIMVA(ExceptionLevel _targetEL, bool _secure,
210  Addr _addr, uint16_t _asid)
211  : TLBIOp(_targetEL, _secure), addr(_addr), asid(_asid)
212  {}
213 
214  void broadcast(ThreadContext *tc) = delete;
215 
216  void operator()(ThreadContext* tc) override;
217 
218  protected:
220  uint16_t asid;
221 };
222 
224 class DTLBIMVA : public TLBIOp
225 {
226  public:
227  DTLBIMVA(ExceptionLevel _targetEL, bool _secure,
228  Addr _addr, uint16_t _asid)
229  : TLBIOp(_targetEL, _secure), addr(_addr), asid(_asid)
230  {}
231 
232  void broadcast(ThreadContext *tc) = delete;
233 
234  void operator()(ThreadContext* tc) override;
235 
236  protected:
238  uint16_t asid;
239 };
240 
242 class TLBIIPA : public TLBIOp
243 {
244  public:
245  TLBIIPA(ExceptionLevel _targetEL, bool _secure, Addr _addr)
246  : TLBIOp(_targetEL, _secure), addr(_addr)
247  {}
248 
249  void operator()(ThreadContext* tc) override;
250 
251  protected:
253 };
254 
255 } // namespace ArmISA
256 
257 #endif //__ARCH_ARM_TLBI_HH__
ArmISA::TLBIASID::asid
uint16_t asid
Definition: tlbi_op.hh:128
ArmISA::ITLBIASID::ITLBIASID
ITLBIASID(ExceptionLevel _targetEL, bool _secure, uint16_t _asid)
Definition: tlbi_op.hh:135
ArmISA::DTLBIALL::DTLBIALL
DTLBIALL(ExceptionLevel _targetEL, bool _secure)
Definition: tlbi_op.hh:108
ArmISA::DTLBIMVA::broadcast
void broadcast(ThreadContext *tc)=delete
ArmISA::TLBIALLN::TLBIALLN
TLBIALLN(ExceptionLevel _targetEL)
Definition: tlbi_op.hh:167
ArmISA::DTLBIASID::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:96
ArmISA::ITLBIASID::asid
uint16_t asid
Definition: tlbi_op.hh:144
ArmISA::TLBIOp
Definition: tlbi_op.hh:53
ArmISA::ITLBIALL::broadcast
void broadcast(ThreadContext *tc)=delete
ArmISA::DTLBIMVA::addr
Addr addr
Definition: tlbi_op.hh:237
ArmISA::TLBIOp::operator()
virtual void operator()(ThreadContext *tc)
Definition: tlbi_op.hh:61
ArmISA::TLBIMVA
TLB Invalidate by VA.
Definition: tlbi_op.hh:190
ArmISA::ITLBIMVA::broadcast
void broadcast(ThreadContext *tc)=delete
ArmISA::DTLBIALL
Data TLB Invalidate All.
Definition: tlbi_op.hh:105
ArmISA::TLBIOp::broadcast
void broadcast(ThreadContext *tc)
Broadcast the TLB Invalidate operation to all TLBs in the Arm system.
Definition: tlbi_op.hh:69
tlb.hh
ArmISA::TLBIMVAA::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:115
ArmISA::DTLBIASID::asid
uint16_t asid
Definition: tlbi_op.hh:160
ArmISA::TLBIMVA::addr
Addr addr
Definition: tlbi_op.hh:201
ArmISA::TLBIMVAA::TLBIMVAA
TLBIMVAA(ExceptionLevel _targetEL, bool _secure, Addr _addr)
Definition: tlbi_op.hh:178
ArmISA::TLBIALL::TLBIALL
TLBIALL(ExceptionLevel _targetEL, bool _secure)
Definition: tlbi_op.hh:84
system.hh
ArmISA::TLBIASID
TLB Invalidate by ASID match.
Definition: tlbi_op.hh:118
ArmISA
Definition: ccregs.hh:41
ArmISA::TLBIALL::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:46
ArmISA::TLBIIPA::addr
Addr addr
Definition: tlbi_op.hh:252
ArmISA::TLBIOp::~TLBIOp
virtual ~TLBIOp()
Definition: tlbi_op.hh:60
ArmISA::DTLBIMVA::asid
uint16_t asid
Definition: tlbi_op.hh:238
ArmISA::TLBIOp::secureLookup
bool secureLookup
Definition: tlbi_op.hh:76
ThreadContext
ThreadContext is the external interface to all thread state for anything outside of the CPU.
Definition: thread_context.hh:88
ArmISA::TLBIOp::targetEL
ExceptionLevel targetEL
Definition: tlbi_op.hh:77
ArmISA::ITLBIASID::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:90
ArmISA::ExceptionLevel
ExceptionLevel
Definition: types.hh:621
ArmISA::ITLBIALL::ITLBIALL
ITLBIALL(ExceptionLevel _targetEL, bool _secure)
Definition: tlbi_op.hh:95
ArmISA::ITLBIMVA::ITLBIMVA
ITLBIMVA(ExceptionLevel _targetEL, bool _secure, Addr _addr, uint16_t _asid)
Definition: tlbi_op.hh:209
ArmISA::ITLBIASID::broadcast
void broadcast(ThreadContext *tc)=delete
ArmISA::ITLBIALL::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:64
ArmISA::TLBIMVA::TLBIMVA
TLBIMVA(ExceptionLevel _targetEL, bool _secure, Addr _addr, uint16_t _asid)
Definition: tlbi_op.hh:193
ArmISA::TLBIMVAA
TLB Invalidate by VA, All ASID.
Definition: tlbi_op.hh:175
ArmISA::DTLBIASID::broadcast
void broadcast(ThreadContext *tc)=delete
ArmISA::TLBIMVAA::addr
Addr addr
Definition: tlbi_op.hh:186
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
ArmISA::TLBIOp::TLBIOp
TLBIOp(ExceptionLevel _targetEL, bool _secure)
Definition: tlbi_op.hh:56
ArmISA::TLBIALL
TLB Invalidate All.
Definition: tlbi_op.hh:81
ArmISA::TLBIMVA::asid
uint16_t asid
Definition: tlbi_op.hh:202
ArmISA::DTLBIMVA
Data TLB Invalidate by VA.
Definition: tlbi_op.hh:224
ArmISA::DTLBIMVA::DTLBIMVA
DTLBIMVA(ExceptionLevel _targetEL, bool _secure, Addr _addr, uint16_t _asid)
Definition: tlbi_op.hh:227
ArmISA::ITLBIALL
Instruction TLB Invalidate All.
Definition: tlbi_op.hh:92
System::threads
Threads threads
Definition: system.hh:309
ArmISA::TLBIMVA::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:130
ArmISA::TLBIALLN::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:102
ArmISA::ITLBIMVA::addr
Addr addr
Definition: tlbi_op.hh:219
ArmISA::DTLBIALL::broadcast
void broadcast(ThreadContext *tc)=delete
ArmISA::DTLBIALL::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:70
ArmISA::TLBIIPA
TLB Invalidate by Intermediate Physical Address.
Definition: tlbi_op.hh:242
ArmISA::TLBIASID::TLBIASID
TLBIASID(ExceptionLevel _targetEL, bool _secure, uint16_t _asid)
Definition: tlbi_op.hh:121
ArmISA::DTLBIMVA::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:156
ArmISA::TLBIIPA::TLBIIPA
TLBIIPA(ExceptionLevel _targetEL, bool _secure, Addr _addr)
Definition: tlbi_op.hh:245
ArmISA::DTLBIASID::DTLBIASID
DTLBIASID(ExceptionLevel _targetEL, bool _secure, uint16_t _asid)
Definition: tlbi_op.hh:151
ArmISA::DTLBIASID
Data TLB Invalidate by ASID match.
Definition: tlbi_op.hh:148
ArmISA::ITLBIMVA::asid
uint16_t asid
Definition: tlbi_op.hh:220
ArmISA::ITLBIASID
Instruction TLB Invalidate by ASID match.
Definition: tlbi_op.hh:132
ArmISA::TLBIASID::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:76
ArmISA::ITLBIMVA
Instruction TLB Invalidate by VA.
Definition: tlbi_op.hh:206
thread_context.hh
ArmISA::ITLBIMVA::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:149
ThreadContext::getSystemPtr
virtual System * getSystemPtr()=0
ArmISA::TLBIIPA::operator()
void operator()(ThreadContext *tc) override
Definition: tlbi_op.cc:163
ArmISA::TLBIALLN
TLB Invalidate All, Non-Secure.
Definition: tlbi_op.hh:164

Generated on Wed Sep 30 2020 14:02:01 for gem5 by doxygen 1.8.17