gem5  v20.1.0.0
vgic.cc
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2013,2018 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 #include "dev/arm/vgic.hh"
39 
40 #include "arch/arm/interrupts.hh"
41 #include "base/trace.hh"
42 #include "debug/Checkpoint.hh"
43 #include "debug/VGIC.hh"
44 #include "dev/arm/base_gic.hh"
45 #include "mem/packet.hh"
46 #include "mem/packet_access.hh"
47 
49  : PioDevice(p), gicvIIDR(p->gicv_iidr), platform(p->platform),
50  gic(p->gic), vcpuAddr(p->vcpu_addr), hvAddr(p->hv_addr),
51  pioDelay(p->pio_delay), maintInt(p->maint_int)
52 {
53  for (int x = 0; x < VGIC_CPU_MAX; x++) {
55  [this, x]{ processPostVIntEvent(x); },
56  "Post VInterrupt to CPU");
57  maintIntPosted[x] = false;
58  vIntPosted[x] = false;
59  }
60  assert(sys->threads.numRunning() <= VGIC_CPU_MAX);
61 }
62 
64 {
65  for (int x = 0; x < VGIC_CPU_MAX; x++)
66  delete postVIntEvent[x];
67 }
68 
69 Tick
71 {
72  Addr addr = pkt->getAddr();
73 
74  if (addr >= vcpuAddr && addr < vcpuAddr + GICV_SIZE)
75  return readVCpu(pkt);
76  else if (addr >= hvAddr && addr < hvAddr + GICH_REG_SIZE)
77  return readCtrl(pkt);
78  else
79  panic("Read to unknown address %#x\n", pkt->getAddr());
80 }
81 
82 Tick
84 {
85  Addr addr = pkt->getAddr();
86 
87  if (addr >= vcpuAddr && addr < vcpuAddr + GICV_SIZE)
88  return writeVCpu(pkt);
89  else if (addr >= hvAddr && addr < hvAddr + GICH_REG_SIZE)
90  return writeCtrl(pkt);
91  else
92  panic("Write to unknown address %#x\n", pkt->getAddr());
93 }
94 
95 Tick
97 {
98  Addr daddr = pkt->getAddr() - vcpuAddr;
99 
100  ContextID ctx_id = pkt->req->contextId();
101  assert(ctx_id < VGIC_CPU_MAX);
102  struct vcpuIntData *vid = &vcpuData[ctx_id];
103 
104  DPRINTF(VGIC, "VGIC VCPU read register %#x\n", daddr);
105 
106  switch (daddr) {
107  case GICV_CTLR:
108  pkt->setLE<uint32_t>(vid->vctrl);
109  break;
110  case GICV_IAR: {
111  int i = findHighestPendingLR(vid);
112  if (i < 0 || !vid->vctrl.En) {
113  pkt->setLE<uint32_t>(1023); // "No int" marker
114  } else {
115  ListReg *lr = &vid->LR[i];
116 
117  pkt->setLE<uint32_t>(lr->VirtualID |
118  (((int)lr->CpuID) << 10));
119  // We don't support auto-EOI of HW interrupts via real GIC!
120  // Fortunately, KVM doesn't use this. How about Xen...? Ulp!
121  if (lr->HW)
122  panic("VGIC does not support 'HW' List Register feature (LR %#x)!\n",
123  *lr);
124  lr->State = LR_ACTIVE;
125  DPRINTF(VGIC, "Consumed interrupt %d (cpu%d) from LR%d (EOI%d)\n",
126  lr->VirtualID, lr->CpuID, i, lr->EOI);
127  }
128  } break;
129  case GICV_IIDR:
130  pkt->setLE<uint32_t>(gicvIIDR);
131  break;
132  default:
133  panic("VGIC VCPU read of bad address %#x\n", daddr);
134  }
135 
136  updateIntState(ctx_id);
137 
138  pkt->makeAtomicResponse();
139  return pioDelay;
140 }
141 
142 Tick
144 {
145  Addr daddr = pkt->getAddr() - hvAddr;
146 
147  ContextID ctx_id = pkt->req->contextId();
148 
149  DPRINTF(VGIC, "VGIC HVCtrl read register %#x\n", daddr);
150 
151  /* Munge the address: 0-0xfff is the usual space banked by requestor CPU.
152  * Anything > that is 0x200-sized slices of 'per CPU' regs.
153  */
154  if (daddr & ~0x1ff) {
155  ctx_id = (daddr >> 9);
156  if (ctx_id > 8)
157  panic("VGIC: Weird unbanked hv ctrl address %#x!\n", daddr);
158  daddr &= ~0x1ff;
159  }
160  assert(ctx_id < VGIC_CPU_MAX);
161  struct vcpuIntData *vid = &vcpuData[ctx_id];
162 
163  switch (daddr) {
164  case GICH_HCR:
165  pkt->setLE<uint32_t>(vid->hcr);
166  break;
167 
168  case GICH_VTR:
169  pkt->setLE<uint32_t>(0x44000000 | (NUM_LR - 1));
170  break;
171 
172  case GICH_VMCR:
173  pkt->setLE<uint32_t>(
174  ((uint32_t)vid->VMPriMask << 27) |
175  ((uint32_t)vid->VMBP << 21) |
176  ((uint32_t)vid->VMABP << 18) |
177  ((uint32_t)vid->VEM << 9) |
178  ((uint32_t)vid->VMCBPR << 4) |
179  ((uint32_t)vid->VMFiqEn << 3) |
180  ((uint32_t)vid->VMAckCtl << 2) |
181  ((uint32_t)vid->VMGrp1En << 1) |
182  ((uint32_t)vid->VMGrp0En << 0)
183  );
184  break;
185 
186  case GICH_MISR:
187  pkt->setLE<uint32_t>(getMISR(vid));
188  break;
189 
190  case GICH_EISR0:
191  pkt->setLE<uint32_t>(vid->eisr & 0xffffffff);
192  break;
193 
194  case GICH_EISR1:
195  pkt->setLE<uint32_t>(vid->eisr >> 32);
196  break;
197 
198  case GICH_ELSR0: {
199  uint32_t bm = 0;
200  for (int i = 0; i < ((NUM_LR < 32) ? NUM_LR : 32); i++) {
201  if (!vid->LR[i].State)
202  bm |= 1 << i;
203  }
204  pkt->setLE<uint32_t>(bm);
205  } break;
206 
207  case GICH_ELSR1: {
208  uint32_t bm = 0;
209  for (int i = 32; i < NUM_LR; i++) {
210  if (!vid->LR[i].State)
211  bm |= 1 << (i-32);
212  }
213  pkt->setLE<uint32_t>(bm);
214  } break;
215 
216  case GICH_APR0:
217  warn_once("VGIC GICH_APR read!\n");
218  pkt->setLE<uint32_t>(0);
219  break;
220 
221  case GICH_LR0:
222  case GICH_LR1:
223  case GICH_LR2:
224  case GICH_LR3:
225  pkt->setLE<uint32_t>(vid->LR[(daddr - GICH_LR0) >> 2]);
226  break;
227 
228  default:
229  panic("VGIC HVCtrl read of bad address %#x\n", daddr);
230  }
231 
232  pkt->makeAtomicResponse();
233  return pioDelay;
234 }
235 
236 Tick
238 {
239  Addr daddr = pkt->getAddr() - vcpuAddr;
240 
241  ContextID ctx_id = pkt->req->contextId();
242  assert(ctx_id < VGIC_CPU_MAX);
243  struct vcpuIntData *vid = &vcpuData[ctx_id];
244 
245  DPRINTF(VGIC, "VGIC VCPU write register %#x <= %#x\n",
246  daddr, pkt->getLE<uint32_t>());
247 
248  switch (daddr) {
249  case GICV_CTLR:
250  vid->vctrl = pkt->getLE<uint32_t>();
251  break;
252  case GICV_PMR:
253  vid->VMPriMask = pkt->getLE<uint32_t>();
254  break;
255  case GICV_EOIR: {
256  // We don't handle the split EOI-then-DIR mode. Linux (guest)
257  // doesn't need it though.
258  assert(!vid->vctrl.EOImode);
259  uint32_t w = pkt->getLE<uint32_t>();
260  unsigned int virq = w & 0x3ff;
261  unsigned int vcpu = (w >> 10) & 7;
262  int i = findLRForVIRQ(vid, virq, vcpu);
263  if (i < 0) {
264  DPRINTF(VGIC, "EOIR: No LR for irq %d(cpu%d)\n", virq, vcpu);
265  } else {
266  DPRINTF(VGIC, "EOIR: Found LR%d for irq %d(cpu%d)\n", i, virq, vcpu);
267  ListReg *lr = &vid->LR[i];
268  lr->State = 0;
269  // Maintenance interrupt -- via eisr -- is flagged when
270  // LRs have EOI=1 and State=INVALID!
271  }
272  } break;
273  default:
274  panic("VGIC VCPU write %#x to unk address %#x\n",
275  pkt->getLE<uint32_t>(), daddr);
276  }
277 
278  // This updates the EISRs and flags IRQs:
279  updateIntState(ctx_id);
280 
281  pkt->makeAtomicResponse();
282  return pioDelay;
283 }
284 
285 Tick
287 {
288  Addr daddr = pkt->getAddr() - hvAddr;
289 
290  ContextID ctx_id = pkt->req->contextId();
291 
292  DPRINTF(VGIC, "VGIC HVCtrl write register %#x <= %#x\n",
293  daddr, pkt->getLE<uint32_t>());
294 
295  /* Munge the address: 0-0xfff is the usual space banked by requestor CPU.
296  * Anything > that is 0x200-sized slices of 'per CPU' regs.
297  */
298  if (daddr & ~0x1ff) {
299  ctx_id = (daddr >> 9);
300  if (ctx_id > 8)
301  panic("VGIC: Weird unbanked hv ctrl address %#x!\n", daddr);
302  daddr &= ~0x1ff;
303  }
304  assert(ctx_id < VGIC_CPU_MAX);
305  struct vcpuIntData *vid = &vcpuData[ctx_id];
306 
307  switch (daddr) {
308  case GICH_HCR:
309  vid->hcr = pkt->getLE<uint32_t>();
310  // update int state
311  break;
312 
313  case GICH_VMCR: {
314  uint32_t d = pkt->getLE<uint32_t>();
315  vid->VMPriMask = d >> 27;
316  vid->VMBP = (d >> 21) & 7;
317  vid->VMABP = (d >> 18) & 7;
318  vid->VEM = (d >> 9) & 1;
319  vid->VMCBPR = (d >> 4) & 1;
320  vid->VMFiqEn = (d >> 3) & 1;
321  vid->VMAckCtl = (d >> 2) & 1;
322  vid->VMGrp1En = (d >> 1) & 1;
323  vid->VMGrp0En = d & 1;
324  } break;
325 
326  case GICH_APR0:
327  warn_once("VGIC GICH_APR0 written, ignored\n");
328  break;
329 
330  case GICH_LR0:
331  case GICH_LR1:
332  case GICH_LR2:
333  case GICH_LR3:
334  vid->LR[(daddr - GICH_LR0) >> 2] = pkt->getLE<uint32_t>();
335  // update int state
336  break;
337 
338  default:
339  panic("VGIC HVCtrl write to bad address %#x\n", daddr);
340  }
341 
342  updateIntState(ctx_id);
343 
344  pkt->makeAtomicResponse();
345  return pioDelay;
346 }
347 
348 
349 uint32_t
350 VGic::getMISR(struct vcpuIntData *vid)
351 {
352  return (!!vid->hcr.VGrp1DIE && !vid->VMGrp1En ? 0x80 : 0) |
353  (!!vid->hcr.VGrp1EIE && vid->VMGrp1En ? 0x40 : 0) |
354  (!!vid->hcr.VGrp0DIE && !vid->VMGrp0En ? 0x20 : 0) |
355  (!!vid->hcr.VGrp0EIE && vid->VMGrp0En ? 0x10 : 0) |
356  (!!vid->hcr.NPIE && !lrPending(vid) ? 0x08 : 0) |
357  (!!vid->hcr.LRENPIE && vid->hcr.EOICount ? 0x04 : 0) |
358  (!!vid->hcr.UIE && lrValid(vid) <= 1 ? 0x02 : 0) |
359  (vid->eisr ? 0x01 : 0);
360 }
361 
362 void
363 VGic::postVInt(uint32_t cpu, Tick when)
364 {
365  DPRINTF(VGIC, "Posting VIRQ to %d\n", cpu);
366  if (!(postVIntEvent[cpu]->scheduled()))
367  eventq->schedule(postVIntEvent[cpu], when);
368 }
369 
370 void
371 VGic::unPostVInt(uint32_t cpu)
372 {
373  DPRINTF(VGIC, "Unposting VIRQ to %d\n", cpu);
375 }
376 
377 void
379 {
381 }
382 
383 
384 void
385 VGic::postMaintInt(uint32_t cpu)
386 {
387  DPRINTF(VGIC, "Posting maintenance PPI to GIC/cpu%d\n", cpu);
388  // Linux DT configures this as Level.
389  gic->sendPPInt(maintInt, cpu);
390 }
391 
392 void
393 VGic::unPostMaintInt(uint32_t cpu)
394 {
395  DPRINTF(VGIC, "Unposting maintenance PPI to GIC/cpu%d\n", cpu);
396  gic->clearPPInt(maintInt, cpu);
397 }
398 
399 /* Update state (in general); something concerned with ctx_id has changed.
400  * This may raise a maintenance interrupt.
401  */
402 void
404 {
405  // @todo This should update APRs!
406 
407  // Build EISR contents:
408  // (Cached so that regs can read them without messing about again)
409  struct vcpuIntData *tvid = &vcpuData[ctx_id];
410 
411  tvid->eisr = 0;
412  for (int i = 0; i < NUM_LR; i++) {
413  if (!tvid->LR[i].State && tvid->LR[i].EOI) {
414  tvid->eisr |= 1 << i;
415  }
416  }
417 
418  assert(sys->threads.numRunning() <= VGIC_CPU_MAX);
419  for (int i = 0; i < sys->threads.numRunning(); i++) {
420  struct vcpuIntData *vid = &vcpuData[i];
421  // Are any LRs active that weren't before?
422  if (!vIntPosted[i]) {
423  if (lrPending(vid) && vid->vctrl.En) {
424  vIntPosted[i] = true;
425  postVInt(i, curTick() + 1);
426  }
427  } else if (!lrPending(vid)) {
428  vIntPosted[i] = false;
429  unPostVInt(i);
430  }
431 
432  // Any maintenance ints to send?
433  if (!maintIntPosted[i]) {
434  if (vid->hcr.En && getMISR(vid)) {
435  maintIntPosted[i] = true;
436  postMaintInt(i);
437  }
438  } else {
439  if (!vid->hcr.En || !getMISR(vid)) {
440  unPostMaintInt(i);
441  maintIntPosted[i] = false;
442  }
443  }
444  }
445 }
446 
449 {
450  AddrRangeList ranges;
451  ranges.push_back(RangeSize(hvAddr, GICH_REG_SIZE));
452  ranges.push_back(RangeSize(vcpuAddr, GICV_SIZE));
453  return ranges;
454 }
455 
456 void
458 {
459  Tick interrupt_time[VGIC_CPU_MAX];
460  for (uint32_t cpu = 0; cpu < VGIC_CPU_MAX; cpu++) {
461  interrupt_time[cpu] = 0;
462  if (postVIntEvent[cpu]->scheduled()) {
463  interrupt_time[cpu] = postVIntEvent[cpu]->when();
464  }
465  }
466 
467  DPRINTF(Checkpoint, "Serializing VGIC\n");
468 
469  SERIALIZE_ARRAY(interrupt_time, VGIC_CPU_MAX);
476 
477  for (uint32_t cpu = 0; cpu < VGIC_CPU_MAX; cpu++)
478  vcpuData[cpu].serializeSection(cp, csprintf("vcpuData%d", cpu));
479 }
480 
481 void
483 {
484  uint32_t vctrl_val = vctrl;
485  SERIALIZE_SCALAR(vctrl_val);
486  uint32_t hcr_val = hcr;
487  SERIALIZE_SCALAR(hcr_val);
488  uint64_t eisr_val = eisr;
489  SERIALIZE_SCALAR(eisr_val);
490  uint8_t VMGrp0En_val = VMGrp0En;
491  SERIALIZE_SCALAR(VMGrp0En_val);
492  uint8_t VMGrp1En_val = VMGrp1En;
493  SERIALIZE_SCALAR(VMGrp1En_val);
494  uint8_t VMAckCtl_val = VMAckCtl;
495  SERIALIZE_SCALAR(VMAckCtl_val);
496  uint8_t VMFiqEn_val = VMFiqEn;
497  SERIALIZE_SCALAR(VMFiqEn_val);
498  uint8_t VMCBPR_val = VMCBPR;
499  SERIALIZE_SCALAR(VMCBPR_val);
500  uint8_t VEM_val = VEM;
501  SERIALIZE_SCALAR(VEM_val);
502  uint8_t VMABP_val = VMABP;
503  SERIALIZE_SCALAR(VMABP_val);
504  uint8_t VMBP_val = VMBP;
505  SERIALIZE_SCALAR(VMBP_val);
506  uint8_t VMPriMask_val = VMPriMask;
507  SERIALIZE_SCALAR(VMPriMask_val);
508 
509  for (int i = 0; i < NUM_LR; i++) {
510  ScopedCheckpointSection sec_lr(cp, csprintf("LR%d", i));
511  paramOut(cp, "lr", LR[i]);
512  }
513 }
514 
516 {
517  DPRINTF(Checkpoint, "Unserializing Arm GIC\n");
518 
519  Tick interrupt_time[VGIC_CPU_MAX];
520  UNSERIALIZE_ARRAY(interrupt_time, VGIC_CPU_MAX);
521  for (uint32_t cpu = 0; cpu < VGIC_CPU_MAX; cpu++) {
522  if (interrupt_time[cpu])
523  schedule(postVIntEvent[cpu], interrupt_time[cpu]);
524 
525  vcpuData[cpu].unserializeSection(cp, csprintf("vcpuData%d", cpu));
526  }
533 }
534 
535 void
537 {
538  paramIn(cp, "vctrl_val", vctrl);
539  paramIn(cp, "hcr_val", hcr);
540  paramIn(cp, "eisr_val", eisr);
541  paramIn(cp, "VMGrp0En_val", VMGrp0En);
542  paramIn(cp, "VMGrp1En_val", VMGrp1En);
543  paramIn(cp, "VMAckCtl_val", VMAckCtl);
544  paramIn(cp, "VMFiqEn_val", VMFiqEn);
545  paramIn(cp, "VMCBPR_val", VMCBPR);
546  paramIn(cp, "VEM_val", VEM);
547  paramIn(cp, "VMABP_val", VMABP);
548  paramIn(cp, "VMPriMask_val", VMPriMask);
549 
550  for (int i = 0; i < NUM_LR; i++) {
551  ScopedCheckpointSection sec_lr(cp, csprintf("LR%d", i));
552  paramIn(cp, "lr", LR[i]);
553  }
554 }
555 
556 VGic *
557 VGicParams::create()
558 {
559  return new VGic(this);
560 }
VGic::unPostVInt
void unPostVInt(uint32_t cpu)
Definition: vgic.cc:371
VGic::vcpuAddr
Addr vcpuAddr
Definition: vgic.hh:116
Packet::makeAtomicResponse
void makeAtomicResponse()
Definition: packet.hh:1016
VGic::getAddrRanges
AddrRangeList getAddrRanges() const override
Every PIO device is obliged to provide an implementation that returns the address ranges the device r...
Definition: vgic.cc:448
System::Threads::numRunning
int numRunning() const
Definition: system.cc:165
IntrControl::clear
void clear(int cpu_id, int int_num, int index)
Definition: intr_control.cc:55
VGic::GICH_VMCR
static const int GICH_VMCR
Definition: vgic.hh:74
VGic::GICH_LR1
static const int GICH_LR1
Definition: vgic.hh:82
VGic::GICH_EISR0
static const int GICH_EISR0
Definition: vgic.hh:76
VGic::vIntPosted
bool vIntPosted[VGIC_CPU_MAX]
Definition: vgic.hh:111
IntrControl::post
void post(int cpu_id, int int_num, int index)
Definition: intr_control.cc:47
UNSERIALIZE_SCALAR
#define UNSERIALIZE_SCALAR(scalar)
Definition: serialize.hh:797
Packet::getAddr
Addr getAddr() const
Definition: packet.hh:754
VGic::getMISR
uint32_t getMISR(struct vcpuIntData *vid)
Definition: vgic.cc:350
VGic::postMaintInt
void postMaintInt(uint32_t cpu)
Definition: vgic.cc:385
warn_once
#define warn_once(...)
Definition: logging.hh:243
ArmISA::i
Bitfield< 7 > i
Definition: miscregs_types.hh:63
VGic::maintIntPosted
bool maintIntPosted[VGIC_CPU_MAX]
Definition: vgic.hh:110
VGic::GICV_IAR
static const int GICV_IAR
Definition: vgic.hh:90
VGic::GICH_VTR
static const int GICH_VTR
Definition: vgic.hh:73
ContextID
int ContextID
Globally unique thread context ID.
Definition: types.hh:231
base_gic.hh
VGic::updateIntState
void updateIntState(ContextID ctx_id)
Definition: vgic.cc:403
Tick
uint64_t Tick
Tick count type.
Definition: types.hh:63
VGic::GICH_EISR1
static const int GICH_EISR1
Definition: vgic.hh:77
serialize
void serialize(const ThreadContext &tc, CheckpointOut &cp)
Thread context serialization helpers.
Definition: thread_context.cc:142
vgic.hh
VGic::writeVCpu
Tick writeVCpu(PacketPtr pkt)
Definition: vgic.cc:237
VGic::~VGic
~VGic()
Definition: vgic.cc:63
Packet::req
RequestPtr req
A pointer to the original request.
Definition: packet.hh:340
VGic::pioDelay
Tick pioDelay
Definition: vgic.hh:118
VGic::readCtrl
Tick readCtrl(PacketPtr pkt)
Definition: vgic.cc:143
VGic::VGic
VGic(const Params *p)
Definition: vgic.cc:48
Serializable::serializeSection
void serializeSection(CheckpointOut &cp, const char *name) const
Serialize an object into a new section.
Definition: serialize.cc:171
Event::when
Tick when() const
Get the time that the event is scheduled.
Definition: eventq.hh:503
VGic::GICV_EOIR
static const int GICV_EOIR
Definition: vgic.hh:91
VGic::platform
Platform * platform
Definition: vgic.hh:113
VGic::findLRForVIRQ
int findLRForVIRQ(struct vcpuIntData *vid, int virq, int vcpu)
Definition: vgic.hh:253
paramOut
void paramOut(CheckpointOut &cp, const string &name, ExtMachInst const &machInst)
Definition: types.cc:38
VGic::writeCtrl
Tick writeCtrl(PacketPtr pkt)
Definition: vgic.cc:286
unserialize
void unserialize(ThreadContext &tc, CheckpointIn &cp)
Definition: thread_context.cc:183
packet.hh
VGic::maintInt
int maintInt
Definition: vgic.hh:119
VGic::hvAddr
Addr hvAddr
Definition: vgic.hh:117
EventFunctionWrapper
Definition: eventq.hh:1101
PioDevice::sys
System * sys
Definition: io_device.hh:102
VGic::lrPending
unsigned int lrPending(struct vcpuIntData *vid)
Definition: vgic.hh:220
VGic::lrValid
unsigned int lrValid(struct vcpuIntData *vid)
Definition: vgic.hh:229
VGic::GICH_ELSR0
static const int GICH_ELSR0
Definition: vgic.hh:78
cp
Definition: cprintf.cc:40
PioDevice
This device is the base class which all devices senstive to an address range inherit from.
Definition: io_device.hh:99
EventManager::schedule
void schedule(Event &event, Tick when)
Definition: eventq.hh:1005
interrupts.hh
VGic::GICH_APR0
static const int GICH_APR0
Definition: vgic.hh:80
MipsISA::w
Bitfield< 0 > w
Definition: pra_constants.hh:278
DPRINTF
#define DPRINTF(x,...)
Definition: trace.hh:234
ArmISA::d
Bitfield< 9 > d
Definition: miscregs_types.hh:60
VGic::GICV_IIDR
static const int GICV_IIDR
Definition: vgic.hh:99
VGic::read
Tick read(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: vgic.cc:70
VGic::GICH_MISR
static const int GICH_MISR
Definition: vgic.hh:75
RangeSize
AddrRange RangeSize(Addr start, Addr size)
Definition: addr_range.hh:638
VGic::GICV_CTLR
static const int GICV_CTLR
Definition: vgic.hh:87
VGic::serialize
void serialize(CheckpointOut &cp) const override
Serialize an object.
Definition: vgic.cc:457
VGic::readVCpu
Tick readVCpu(PacketPtr pkt)
Definition: vgic.cc:96
VGic::GICH_LR0
static const int GICH_LR0
Definition: vgic.hh:81
SERIALIZE_ARRAY
#define SERIALIZE_ARRAY(member, size)
Definition: serialize.hh:832
RiscvISA::x
Bitfield< 3 > x
Definition: pagetable.hh:69
VGic::postVIntEvent
EventFunctionWrapper * postVIntEvent[VGIC_CPU_MAX]
Definition: vgic.hh:109
VGic::vcpuData
EndBitUnion(VCTLR) struct vcpuIntData struct std::array< vcpuIntData, VGIC_CPU_MAX > vcpuData
Definition: vgic.hh:186
BaseGic::clearPPInt
virtual void clearPPInt(uint32_t num, uint32_t cpu)=0
Addr
uint64_t Addr
Address type This will probably be moved somewhere else in the near future.
Definition: types.hh:142
VGic::gic
BaseGic * gic
Definition: vgic.hh:114
VGic::GICH_ELSR1
static const int GICH_ELSR1
Definition: vgic.hh:79
SERIALIZE_SCALAR
#define SERIALIZE_SCALAR(scalar)
Definition: serialize.hh:790
packet_access.hh
VGic::unserialize
void unserialize(CheckpointIn &cp) override
Unserialize an object.
Definition: vgic.cc:515
ArmISA::INT_VIRT_IRQ
@ INT_VIRT_IRQ
Definition: interrupts.hh:64
VGic::LR_ACTIVE
static const uint32_t LR_ACTIVE
Definition: vgic.hh:103
EventQueue::schedule
void schedule(Event *event, Tick when, bool global=false)
Schedule the given event on this queue.
Definition: eventq.hh:757
VGic::NUM_LR
static const int NUM_LR
Definition: vgic.hh:67
System::threads
Threads threads
Definition: system.hh:309
Packet::getLE
T getLE() const
Get the data in the packet byte swapped from little endian to host endian.
Definition: packet_access.hh:75
VGic::write
Tick write(PacketPtr pkt) override
Pure virtual function that the device must implement.
Definition: vgic.cc:83
UNSERIALIZE_ARRAY
#define UNSERIALIZE_ARRAY(member, size)
Definition: serialize.hh:840
VGic
Definition: vgic.hh:63
VGic::findHighestPendingLR
int findHighestPendingLR(struct vcpuIntData *vid)
Returns LR index or -1 if none pending.
Definition: vgic.hh:240
Packet
A Packet is used to encapsulate a transfer between two objects in the memory system (e....
Definition: packet.hh:257
ArmISA::gic
Bitfield< 27, 24 > gic
Definition: miscregs_types.hh:171
VGic::GICV_PMR
static const int GICV_PMR
Definition: vgic.hh:88
Platform::intrctrl
IntrControl * intrctrl
Pointer to the interrupt controller.
Definition: platform.hh:53
addr
ip6_addr_t addr
Definition: inet.hh:423
EventManager::eventq
EventQueue * eventq
A pointer to this object's event queue.
Definition: eventq.hh:977
paramIn
void paramIn(CheckpointIn &cp, const string &name, ExtMachInst &machInst)
Definition: types.cc:69
VGic::gicvIIDR
const uint32_t gicvIIDR
Definition: vgic.hh:104
VGic::processPostVIntEvent
void processPostVIntEvent(uint32_t cpu)
Post interrupt to CPU.
Definition: vgic.cc:378
VGic::GICV_SIZE
static const int GICV_SIZE
Definition: vgic.hh:86
Packet::setLE
void setLE(T v)
Set the value in the data pointer to v as little endian.
Definition: packet_access.hh:105
VGic::unPostMaintInt
void unPostMaintInt(uint32_t cpu)
Definition: vgic.cc:393
CheckpointOut
std::ostream CheckpointOut
Definition: serialize.hh:63
trace.hh
VGic::Params
VGicParams Params
Definition: vgic.hh:189
MipsISA::p
Bitfield< 0 > p
Definition: pra_constants.hh:323
BaseGic::sendPPInt
virtual void sendPPInt(uint32_t num, uint32_t cpu)=0
Interface call for private peripheral interrupts.
std::list< AddrRange >
CheckpointIn
Definition: serialize.hh:67
VGic::postVInt
void postVInt(uint32_t cpu, Tick when)
Definition: vgic.cc:363
csprintf
std::string csprintf(const char *format, const Args &...args)
Definition: cprintf.hh:158
VGic::GICH_LR2
static const int GICH_LR2
Definition: vgic.hh:83
VGic::GICH_HCR
static const int GICH_HCR
Definition: vgic.hh:72
VGic::VGIC_CPU_MAX
static const int VGIC_CPU_MAX
Definition: vgic.hh:66
panic
#define panic(...)
This implements a cprintf based panic() function.
Definition: logging.hh:171
curTick
Tick curTick()
The current simulated tick.
Definition: core.hh:45
VGic::GICH_LR3
static const int GICH_LR3
Definition: vgic.hh:84
VGic::GICH_REG_SIZE
static const int GICH_REG_SIZE
Definition: vgic.hh:70

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